Grader bypasses and verifier gaps in Alibaba CTF tasks

#2
by evanjolley-p - opened

While digging through the tasks and verifier setups, we noticed a few edge cases where an agent can accidentally (or intentionally) bypass the grading checks. Where a route is not proven yet, the row says so. One of these comes from a Harbor runner setting the task leaves unset; we list it separately.

We looked at the Harbor Hub dataset alibaba-aaig/alibaba-ctf, version 3.0.0, revision 14 (published 2026-09-20).

For every row below we read the task files at that version and traced the route from what the agent can touch to what the grader scores. We did not run the tasks unless a row says so.

Paths to reward without doing the work

  • alibabactf-2026-reverse-speed-re-easy5: flag stored in the agent's own container (full score without solving the challenge)

    environment/Dockerfile:10 builds the agent's own image with the flag body written to /flag, readable by every user. The challenge service gets its flag through FLAG (environment/docker-compose.yaml:8-12), and environment/entrypoint.sh:3 rewrites /flag only when FLAG is set, which it is not in the agent's container. The file uses a different prefix than tests/test.sh:3 expects, but instruction.md:13 and instruction.md:19 tell the agent the right prefix, so reading /flag and swapping the prefix scores 1 without touching the challenge. Same pattern in 12 of 87 tasks (some also write /srv/flag).

    • Suggested fix: Remove the /flag and /srv/flag lines from the agent image and keep the flag only in the challenge service.
  • alibabactf-2026-misc-Auction: fixed, published flag accepted (full score without solving the challenge; likely, not proven yet)

    The grader compares the flag file with a fixed string (tests/test.sh:3-8), and task.toml:29-30 gives the agent unrestricted internet. These are flags of published competition challenges: write-ups often print them, and the published task files themselves contain the expected flag (tests/test.sh:3, task.toml:16). An agent can download or recall the flag and score 1 without touching the service. The instruction forbids searching for write-ups (instruction.md:56), but nothing enforces it. We did not check which flags are findable online. Same check in 87 of 87 tasks.

    • Suggested fix: Generate a random flag for each run, inject it into the challenge service at start, and compare against that value from a place the agent cannot read. Harbor: network_mode = "public" is set by the task itself; an allowlist would narrow the exposure, but a per-run flag is what closes it.

Harbor-related issues (runner settings the tasks leave unset)

These issues come from Harbor runner settings that the tasks leave at their defaults, not from the task logic. On current Harbor (v0.26.0), a task that sets nothing gets public internet, runs the agent as the image's default user (usually root), and runs tests/test.sh inside the agent's own container after the agent finishes, so the grader sees every file the agent changed and any process it left running. Harbor deletes old reward files before grading, but a process the agent leaves running can still write one while the grader runs, and reward.json wins over reward.txt. Upgrading Harbor does not change these defaults for existing tasks. Each row names the task.toml setting that closes it.

  • alibabactf-2026-misc-Auction: grader runs in the agent's container (full score without solving the challenge)

    task.toml:20-22 sets no environment_mode, so Harbor runs tests/test.sh in the agent's container while anything the agent left running is still alive. tests/test.sh:8-13 writes only reward.txt, and Harbor reads reward.json first, so a background loop that keeps writing a reward.json with reward 1 into /logs/verifier sets the score. The same process could instead read the expected flag from tests/test.sh:3 once the tests are copied in and write it to /logs/agent/flag.txt. Harbor deletes old reward files before grading, so this needs a live process, not a file planted earlier. Same setup in 87 of 87 tasks.

    • Suggested fix: Add environment_mode = "separate" under [verifier] and change the existing top-level artifacts = [] (task.toml:2) to artifacts = ["/logs/agent/flag.txt"].

Hi @chuxi111 ! We'd be happy to share a private doc with more detail on these findings if it's helpful. Let me know!

Sign up or log in to comment