Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions nemoclaw/src/blueprint/ssrf.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ describe("isPrivateIp", () => {
"100.64.0.1", // RFC 6598 CGNAT
"100.127.255.254", // RFC 6598 CGNAT upper bound
"::ffff:100.64.0.1", // IPv4-mapped IPv6 — CGNAT
"0.0.0.0", // RFC 1122 "This network"
"0.255.255.255", // RFC 1122 upper bound
"198.18.0.1", // RFC 2544 benchmark testing
"198.19.255.254", // RFC 2544 upper bound
"::ffff:0.0.0.0", // IPv4-mapped IPv6 — "This network"
"::ffff:198.18.0.1", // IPv4-mapped IPv6 — benchmark
])("detects private IP: %s", (ip) => {
expect(isPrivateIp(ip)).toBe(true);
});
Expand Down
2 changes: 2 additions & 0 deletions nemoclaw/src/blueprint/ssrf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ interface CidrRange {
}

const PRIVATE_NETWORKS: CidrRange[] = [
cidr("0.0.0.0", 8), // "This network" (RFC 1122) — resolves to localhost on many systems
cidr("127.0.0.0", 8),
cidr("10.0.0.0", 8),
cidr("172.16.0.0", 12),
cidr("192.168.0.0", 16),
cidr("169.254.0.0", 16),
cidr("100.64.0.0", 10), // RFC 6598 CGNAT (shared address space)
cidr("198.18.0.0", 15), // Benchmark testing (RFC 2544)
cidr6("::1", 128),
cidr6("::", 128),
cidr6("fc00::", 7),
Expand Down
Loading