Skip to content

feat(security): add private network SSRF rule + .yarnrc.yml config scanning#149

Merged
cyyever merged 1 commit intomainfrom
feat/security-quick-wins
Mar 30, 2026
Merged

feat(security): add private network SSRF rule + .yarnrc.yml config scanning#149
cyyever merged 1 commit intomainfrom
feat/security-quick-wins

Conversation

@cyyever
Copy link
Copy Markdown
Collaborator

@cyyever cyyever commented Mar 30, 2026

Summary

  • Add block-ssrf-private-network locked rule with full IANA Special Purpose Registry coverage β€” blocks RFC1918, loopback, link-local, CGN (100.64/10), benchmarking (198.18/15), documentation nets (TEST-NET-1/2/3), IETF protocol assignments, and IPv6 ULA/link-local
  • Add .yarnrc.yml scanning to configscan: detect malicious yarnPath overrides (CVE-2025-59828) and npmRegistryServer redirects
  • 14 new tests, 3 existing scenarios upgraded from SELFPROTECT β†’ BLOCKED (defense in depth)
  • Zero new dependencies β€” equivalent IANA coverage to code.dny.dev/ssrf via regex

Blocked IP ranges

Range Purpose
10.0.0.0/8 RFC1918 private
172.16.0.0/12 RFC1918 private
192.168.0.0/16 RFC1918 private
127.0.0.0/8 Loopback
0.0.0.0 All-zeros
169.254.0.0/16 Link-local
100.64.0.0/10 CGN / shared address space
198.18.0.0/15 Benchmarking
192.0.0.0/24 IETF protocol assignments
192.0.2.0/24 Documentation (TEST-NET-1)
198.51.100.0/24 Documentation (TEST-NET-2)
203.0.113.0/24 Documentation (TEST-NET-3)
fc00::/7 IPv6 ULA
fe80::/10 IPv6 link-local

Test plan

  • All pre-commit hooks pass (gofmt, golangci-lint, nilaway, gitleaks, govulncheck, rule lint, rule coverage, doc consistency, go test)
  • 11 SSRF private network test cases (RFC1918, loopback, all-zeros, link-local, CGN, benchmarking, 3x documentation)
  • 3 yarnrc test cases (yarnPath, malicious registry, official registry)
  • Existing SSRF metadata + bypass tests still pass
  • Manual: crust start + agent sends curl http://10.0.0.1/admin β†’ blocked

@cyyever cyyever force-pushed the feat/security-quick-wins branch from 1429bd6 to b2c7406 Compare March 30, 2026 05:20
…anning

- Add `block-ssrf-private-network` locked rule blocking RFC1918 (10.x,
  172.16-31.x, 192.168.x), loopback (127.x), all-zeros, and IPv6 private
  ranges β€” defense in depth with existing selfprotect pre-filter
- Add `.yarnrc.yml` scanning to configscan: detect malicious `yarnPath`
  overrides (CVE-2025-59828 attack vector) and `npmRegistryServer` redirects
- Add 8 new tests: 5 SSRF private network cases, 3 yarnrc cases
- Update 3 existing scenarios from SELFPROTECT β†’ BLOCKED (engine now catches)
- Update rule counts: 41β†’42 total, 38β†’39 locked
@cyyever cyyever force-pushed the feat/security-quick-wins branch from b2c7406 to c9c0e17 Compare March 30, 2026 05:34
@cyyever cyyever merged commit 2a0dede into main Mar 30, 2026
16 checks passed
@cyyever cyyever deleted the feat/security-quick-wins branch March 30, 2026 06:41
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.

1 participant