Skip to content

Commit 73e2464

Browse files
Block IPv6 unspecified feed URLs (#15)
1 parent 9942ef8 commit 73e2464

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

plugins/feed-discovery/src/feed-discovery.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ describe("site probing helpers", () => {
5050

5151
it("blocks private SSRF targets", async () => {
5252
await expect(assertSafeHttpUrl("http://127.0.0.1/feed")).rejects.toThrow(/Blocked internal/);
53+
await expect(assertSafeHttpUrl("http://[::]/feed")).rejects.toThrow(/Blocked internal/);
5354
await expect(assertSafeHttpUrl("http://[::ffff:192.168.1.10]/feed")).rejects.toThrow(/Blocked internal/);
5455
await expect(assertSafeHttpUrl("file:///etc/passwd")).rejects.toThrow(/Unsupported URL protocol/);
5556
});

plugins/feed-discovery/src/url-safety.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ function isBlockedIp(value: string) {
7878
return isBlockedIp(`${high >> 8}.${high & 255}.${low >> 8}.${low & 255}`);
7979
}
8080
return (
81+
normalized === "::" ||
8182
normalized === "::1" ||
8283
normalized.startsWith("fc") ||
8384
normalized.startsWith("fd") ||

0 commit comments

Comments
 (0)