Grader bypasses and verifier gaps in LSCBench (Last Secure Code Benchmark) tasks

オープン
#4 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
docker, python, shell

調査の方向性

Start with the shared tests/test.sh and tests/split_axes.py, then trace the cited task files such as tests/run-tests.vsb.sh and instruction.md to verify the report rewrite and skipped test paths. The issue proposes isolating submissions from the grader and checking expected test ids; review how those changes would cover both Python and service tasks across the 450 task dataset. Done means the reported score bypasses are prevented and each claimed route is verified against the relevant task suites.

索引モデルが issue の本文から書いたものです。

説明

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.

We looked at the Harbor Hub dataset last-secure-code-benchmark/last-secure-code-benchmark at revision 5, version 3.0.1 (2026-10-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

  • cve-2020-15110_file: submitted code rewrites the scored test report (full score without doing the work)

    The submission runs in the same process that writes the scored report. tests/test.sh:35-42 mints the report token and exports it, tests/test.sh:89 puts the report path in PYTEST_ADDOPTS, and tests/test.sh:90 starts pytest, which imports the agent's kubespawner/spawner.py in-process (instruction.md:67-79, tests/run-tests.vsb.sh:11). An atexit hook in that module runs after pytest has written /tests/results/<token>.xml and before tests/split_axes.py reads it (tests/test.sh:95), so it can delete every <failure> element and both axes score 1. In service tasks such as cve-2023-34237_repo the submitted daemon starts at tests/test.sh:17-24 and runs as the same user until grading ends, so it can also rewrite the report once it appears in /tests/results. If that user is root (the image default unless the base image sets another, which is not in the task files), it can also replace /tests/split_axes.py. All 450 tasks share this tests/test.sh and run the submission inside the verifier. The in-process route applies to tasks whose suites import Python code; the daemon route applies to service tasks.

    • Suggested fix: Run the suites and the report writer in a process and account the submission cannot touch (for Python tasks, call the submission in a subprocess under another user), and keep the token, /tests and the report directory out of that account's reach. Harbor: No [verifier].user is set and tests/Dockerfile adds no USER, so the verifier runs as the image's default user. An unprivileged [verifier].user blocks only replacing /tests/split_axes.py, not the report rewrites.
  • cve-2020-15110_file: skipped tests count as passed (partial bypass; likely, not proven yet)

    tests/split_axes.py:95-96 passes an axis when at least one case in that suite was not skipped and none failed; skipped cases are only counted (tests/split_axes.py:88-90) and there is no list of expected test ids. In Python tasks the suites import the submission into the pytest process (instruction.md:67-79), so a function the agent does not implement can call pytest.skip(), and every test that reaches it is reported as skipped instead of failed. The axis then scores 1 as long as one case per suite avoids that code and passes. The hidden suites are not published, so we could not confirm how many cases do. The scorer is shared by all 450 tasks; this route needs suites that import the submission (Python tasks).

    • Suggested fix: Compare the collected test ids against a frozen list per suite and fail the axis on any skipped or missing id.
  • cve-2020-5238_repo: four of the five rebuilt extensions are never exercised (partial bypass; likely, not proven yet)

    task.toml:4 asks for seven files that implement five extensions (table, strikethrough, autolink, tagfilter, tasklist), and environment/spec.md describes all of them. The same spec says every caller runs the built binary with --extension table only (environment/spec.md:563-568), and tests/run-tests.vsb.sh:21 runs only test_func.py and test_vuln.py. So the other four extensions can be stubs that compile and register, and the score does not change. The hidden suites are not in the published task, so this rests on the spec's own description of them. Also reported for cve-2019-10767_repo, which we did not check.

    • Suggested fix: Add cases that exercise each reconstructed extension, or cut the artifact list and instruction down to the table extension the suites test.

Lower-impact notes

These only weaken a check and do not change a score on their own.

Lower-impact notes (1)
  • path_traversal_absolute_resolve_file (Hygiene only (instruction calls a writable copy a read-only mount)): instruction.md:51 says the functional contract is mounted read-only, but environment/Dockerfile:108 copies file_specs/ into the image and environment/docker-compose.yaml adds no mount. The agent runs as the image's default user, so it can edit /file_specs. The verifier runs in a separate container and receives only NoteService.java (task.toml:4), so editing the contract cannot change the score. Same wording in the file-tier tasks (reported as 150 of 450). Repo-tier tasks such as cve-2023-34237_repo say the same of /app/spec.md (instruction.md:4 there), which is also a plain copy (environment/Dockerfile:70 there). Suggested fix: Reword the instruction, or make the spec read-only in practice (read-only mount, or a non-root agent user). Harbor: No [agent].user is set, so the agent has the image's default account and can write the copied spec.
主要言語
Shell
スター
140
フォーク
2
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

alibaba/last-secure-code-benchmark のほかの issue

alibaba/last-secure-code-benchmark の issue をすべて見る

似ている issue

Shell/Bash の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。