Skip to content

Commit 2e84fae

Browse files
committed
fix(engine): block future-use IPv4 downloads
1 parent 4b81f78 commit 2e84fae

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

‎packages/engine/src/utils/urlDownloader.test.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ describe("assertPublicHttpsUrl — SSRF guard", () => {
109109
"https://198.18.0.1/secret",
110110
"https://192.0.2.1/secret",
111111
"https://224.0.0.1/secret",
112+
"https://240.0.0.1/secret",
113+
"https://255.255.255.255/secret",
112114
]) {
113115
expect(() => assertPublicHttpsUrl(url), url).toThrow("private/reserved");
114116
}

‎packages/engine/src/utils/urlDownloader.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ for (const [network, prefix] of [
114114
["198.51.100.0", 24],
115115
["203.0.113.0", 24],
116116
["224.0.0.0", 4],
117+
["240.0.0.0", 4],
117118
] as const) {
118119
NON_PUBLIC_IPV4_ADDRESSES.addSubnet(network, prefix, "ipv4");
119120
}

0 commit comments

Comments
 (0)