Verifier gaps: spoofable C/C++ pass marker, recoverable UBSan, partial pytest reports, Goja/Otto side effects
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 55/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- developer-experience, security, testing-qa
Hướng nghiên cứu
Start with docker/model/cpp/code_security_verifier/src/code_security_verifier/runner.py, docker/model/python/verify/core/evaluator.py, and datasets/templates/go/2_1_0/DynamicCodeExecutionGoja/tests/test_security.go. Reproduce each bypass using the provided C/C++, Python, and Go scenarios at commit bf0c4d7. Done means C/C++ grading requires a successful ctest, UBSan errors cannot be recovered, timed-out or non-zero pytest runs fail, and Go marker cleanup occurs regardless of evaluation errors.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
While porting SecCodeBench to Harbor, automated review found several ways a submission can receive a pass without actually passing the tests. All of them were reproduced at bf0c4d7. We have kept the original grading in the Harbor port so that scores stay comparable, and are reporting the problems here instead.
- C/C++: the pass marker can be spoofed.
runner.py#L256-L257searches thectest --verbosestdout forFunctionTest ..................... Passed. That stream includes the program's own output, and the exit status ofctestis not checked.- Repro: in
BufferOverflowArrayAccess, makeparse_container_layersprint both markers and return-1. - Result: both suites are scored as passed, while CTest itself reports
0% tests passed. - Suggested fix: require
returncode == 0as well as the marker.
- Repro: in
- C/C++: UBSan errors are recoverable. The cases build with
-fsanitize=undefined, which by default reports undefined behaviour and continues.- Repro: add
volatile int probe = max_layer_size + 1;toBufferOverflowArrayAccess. - Result: UBSan reports
signed integer overflow: 2147483647 + 1on theINT_MAXsecurity input, and the security test still passes. - Suggested fix:
-fno-sanitize-recover=undefined, orUBSAN_OPTIONS=halt_on_error=1when running the tests.
- Repro: add
- Python: partial JUnit reports are accepted.
evaluator.py#L155still parses the JUnit XML after a timeout, and the pytest exit code is not checked.- Cases: a submission that leaves a non-daemon thread running (pytest writes the XML, then hangs at shutdown), or one that raises
KeyboardInterrupt(exit code 2, partial XML). - Result: both can pass with only some security tests executed.
- Suggested fix: treat a timeout or a non-zero exit as a failed suite.
- Cases: a submission that leaves a non-daemon thread running (pytest writes the XML, then hangs at shutdown), or one that raises
- Go: in
DynamicCodeExecutionGojaandDynamicCodeExecutionOtto, side effects are only checked on success.test_security.go#L23-L25checks and removes the_vuln_checkmarker only whenerr == nil.- Result: an evaluator that runs the payload and then returns an error passes, even though the marker file was written.
- Suggested fix: check the marker, and clean it up, whatever
erris.
Happy to send PRs for any of these if useful.
- Ngôn ngữ chính
- Python
- Star
- 136
- Fork
- 19
- 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
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của alibaba/sec-code-bench
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
alibaba/sec-code-bench#16 ·
Tất cả issue của alibaba/sec-code-bench
Issue tương tự
-
difficulty:1 documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
MakazhanAlpamys/Soup#3533 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
onyx-dot-app/onyx#18730 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Claiming namespace `aadml`Đang mởnamespace team:operations
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
EclipseFdn/open-vsx.org#16509 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
langflow-ai/langflow#16689 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ScoringSystem.get() and compute() return NotImplementedError instead of raising itCó thể đã có người làm @sc-lacanlale đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
aboutcode-org/vulnerablecode#2552 ·
Maintainer thường phản hồi trong vòng 5 ngày