Skip to content

test-cases: add CWE-287 (go) - #21

Closed
CSTRSK wants to merge 3 commits into
profullstack:masterfrom
CSTRSK:add-cwe-287-go
Closed

test-cases: add CWE-287 (go)#21
CSTRSK wants to merge 3 commits into
profullstack:masterfrom
CSTRSK:add-cwe-287-go

Conversation

@CSTRSK

@CSTRSK CSTRSK commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

New scanner test case for CWE-287 in go. Catalog regenerated.

CSTRSK added 3 commits August 8, 2026 19:35
…(Ruby path traversal)

Three new scanner test cases in languages/categories with zero coverage:
- javascript/command-injection-shelljs.js  (CWE-77, cmd injection via string concat vs execFile argv)
- java/hidden-backdoor-endpoint.java        (CWE-912, magic-token backdoor on health route)
- ruby/relative-path-traversal.rb           (CWE-23, ../ escape vs expand_path containment)

All follow the five safety rules (if (false)/NEVER_RUN guards, .invalid/.example
hosts, no side effects). Catalog regenerated: 65 test cases, 49 CWEs.
Four new scanner test cases in previously uncovered categories:
- javascript/bruteforce-no-rate-limit.js  (CWE-307, no lockout vs fail-counter)
- python/missing-object-level-authz.py     (CWE-285, IDOR fetch vs owner-scoped query)
- go/stack-trace-exposed.go               (CWE-200, debug.Stack to client vs server-side log)
- java/unbounded-request-collection.java  (CWE-400, readAllBytes vs size-capped)

All follow the five safety rules (if (false)/NEVER_RUN/ignore-tag guards,
no network, no side effects). Catalog regenerated: 69 test cases, 53 CWEs.
function archiveLogVulnerable(userFilename) {
if (false) {
// VULNERABLE: CWE-77 — user input interpolated into a shell string
return shell.exec('tar -czf /tmp/archive-' + userFilename + '.tar.gz /var/log/app');
if (false) {
// SAFE: input passed as argv element — no shell metacharacters interpreted
const { execFile } = require('child_process');
return execFile('tar', ['-czf', '/tmp/archive-' + userFilename + '.tar.gz', '/var/log/app']);
@ralyodio

ralyodio commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Closing: this PR has merge conflicts against master (conflicting on the shared VULNERABILITY_CATALOG files) and cannot be merged as-is. Reopen and rebase if you want to revive it.

@ralyodio ralyodio closed this Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants