Skip to content

Add CWE-22 path traversal test case (Go) - #175

Merged
ralyodio merged 8 commits into
profullstack:masterfrom
ezequiellich44-cmd:feat/path-traversal-go
Aug 17, 2026
Merged

Add CWE-22 path traversal test case (Go)#175
ralyodio merged 8 commits into
profullstack:masterfrom
ezequiellich44-cmd:feat/path-traversal-go

Conversation

@ezequiellich44-cmd

Copy link
Copy Markdown
Contributor

Test Case Submission

  • I have read docs/CONTRIBUTING.md
  • This test case is non-destructive — no disk, network, or process side effects
  • Every payload is behind a dead-code guard (if neverRun + //go:build ignore)
  • No hosts referenced
  • No credentials included
  • I have included all required metadata
  • I marked the expected lines with VULNERABLE: and correct-code lines with SAFE:
  • I ran the validation (metadata, guards, syntax)
  • I regenerated the catalog and committed the result

Details

  • Vulnerability type: Path traversal via unsanitized filepath.Join with request input
  • CWE ID: CWE-22
  • Language: Go
  • Expected detection: Yes
  • Why this pattern matters: Go's Go corpus has no path-traversal case yet. The fixture covers
    http.ServeFile and os.ReadFile with a tainted filename and a broken exact-prefix guard
    (strings.HasPrefix on the joined path, defeated by ../..), plus a filepath.Clean-based SAFE:
    control.

Safety statement

The whole file is behind //go:build ignore and the neverRun constant, so it can never be built or
run. No file is opened, no path resolved, and there are no hosts or credentials.

Scanner result

Leave blank on submission — CI fills this in.

@ezequiellich44-cmd

Copy link
Copy Markdown
Contributor Author

Sixth submission for the uGig listing: Go CWE-22 path-traversal case (2 VULNERABLE: + 1 SAFE:).

…asses

api.example.com resolves, which trips safety rule 3 (no resolvable
network destinations). Switch to api.example.invalid (RFC 2606) and
correct the @safe-guard text, which claimed no hosts were referenced.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Comment thread vulns/go/path-traversal-filepath.go Dismissed
Comment thread vulns/python/eval-code-injection.py Dismissed
Comment thread vulns/python/eval-code-injection.py Dismissed
Comment thread vulns/python/eval-code-injection.py Dismissed
Comment thread vulns/python/tls-verify-disabled.py Fixed
Comment thread vulns/python/tls-verify-disabled.py Dismissed
Regenerated the catalog rather than hand-resolving it, which is the only
resolution that cannot silently drop an entry.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@ralyodio
ralyodio merged commit 9eedb65 into profullstack:master Aug 17, 2026
5 checks passed
@ezequiellich44-cmd

Copy link
Copy Markdown
Contributor Author

/coinpay invoice 19 USD --crypto sol --wallet 3fZSMAyCEMhZwWiynbJDjoYNUT97aiV9BLzoUNroEMAz --for "Merged malware test-case submission PR #175: CWE-22 path traversal (Go) (commit 5361015)"

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