You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Threat model, controls and their tests. Reporting vulnerabilities:
SECURITY.md. Findings in the original code that led to this
design: audit.md.
Assets and attackers
Asset
Why it matters
Hidden test data
Leaking it lets anyone pass every problem
Verdicts and standings
Forged results corrupt rankings
Accounts and sessions
Impersonation, admin takeover
The judge host
Runs untrusted code from anyone with an account
Personal data
E-mail addresses, names, country
Attackers considered: anonymous visitors, registered users trying to cheat or
escalate, malicious code submitted to the judge, and a network attacker
between browser and server (mitigated by HTTPS in production).
Users change only their own account (/me); no endpoint takes another user's ID for writes
by design
Judging integrity
The server judges; clients send only source code
(JudgingIT.correctSolutionIsAccepted).
Hidden test inputs and expected outputs are never returned; program output is
stored only for sample tests (JudgingIT.hiddenTestDataIsNeverReturned).
Only in-contest submissions count for standings
(StandingsIT.icpcScoringWithPenaltyAndSharedRanks).
Submissions are idempotent per clientRequestId
(JudgingIT.clientRequestIdMakesSubmitIdempotent).
Untrusted code
See judge.md: isolate sandboxes, unprivileged user, no
network, CPU/memory/process limits per run, container-level limits for the
judge in production. The Piston container is privileged; it is never exposed
and shares a network only with the API.
Input handling
Bean Validation on every request body; field errors returned as
errors[] without echoing internals.
Size limits: source and run input 64 KiB (also checked in bytes), tests
1 MiB, request headers 16 KiB, multipart disabled.
SQL only through bound parameters; ILIKE search escapes % and _.
Markdown is rendered in the browser without raw HTML.
HTTP hardening
CSP default-src 'self'; script-src 'self' (Monaco is bundled, no CDN),
frame-ancestors 'none', X-Content-Type-Options, Referrer-Policy,
Permissions-Policy, Cross-Origin-Opener-Policy (nginx); HSTS at Caddy.
Errors are RFC 9457 problem details without stack traces or exception
messages (server.error.include-*: never); unexpected errors return a
generic message and a requestId that links to the server log.
Actuator is not routed publicly; only health, info and prometheus are
exposed, health details hidden.
The API trusts X-Forwarded-For only from private-network proxies.
Secrets
No secrets in the repository: configuration comes from the environment
(.env, ignored by Git; template .env.example).
CI runs gitleaks on the full history.
Historical secrets. The original code committed a JWT signing secret and
JDoodle API credentials (see audit.md). They are removed from the
current tree, but remain in Git history. Treat them as compromised: the JWT
secret is no longer used by anything; the JDoodle client secret must be
rotated in the JDoodle dashboard by the account owner.
Logging and privacy
Structured JSON logs (ECS) with requestId; passwords, tokens, session IDs
and mail bodies are never logged.
Deleting the account removes the user's submissions, registrations and
comments.
Residual risks and follow-ups
Risk
Mitigation today
Possible next step
Piston escape (kernel or isolate bug)
Isolate sandbox, no job network, private network, container limits