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

Đang mở
#4 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
docker, python, shell
Lĩnh vực
security, testing-qa

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.
Ngôn ngữ chính
Shell
Star
140
Fork
2
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của alibaba/last-secure-code-benchmark

Tất cả issue của alibaba/last-secure-code-benchmark

Issue tương tự

Thêm issue về Shell/Bash

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.