Investigate code scanning alert #63 (SSRF) — confirmed false positive, no code changes - #1691
Closed
David Pine (IEvangelist) with Copilot wants to merge 1 commit into
Closed
David Pine (IEvangelist) with Copilot wants to merge 1 commit into
David Pine (IEvangelist) with Copilot wants to merge 1 commit into
Conversation
Copilot
AI
changed the title
[WIP] Fix code scanning alert(s) flagged in repository
Investigate code scanning alert #63 (SSRF) — confirmed false positive, no code changes
Sep 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CodeQL flagged alert #63 (
js/request-forgery) in.github/extensions/og-preview/lib/http-fetch.mjs:152-222, reporting that the URL used infetchUrl()'s outgoing request depends on user-provided input.Investigation
http-fetch.mjsend-to-end, focused on the flaggedlib.request(parsed, ...)call in thevisit()helper.parseTarget()restricts URLs tohttp:/https:and rejects embedded credentials.resolveAddresses()resolves DNS explicitly and validates the returned records.addressKind()classifies every resolved address aspublic,private, orloopback(IPv4 + IPv6, including IPv4-mapped addresses).authorizePreview()requires an explicitOG_ALLOW_PRIVATE_NETWORKopt-in before any private-network origin is usable, and never trusts discovered/redirected URLs.addressKind(); requests targeting non-public, unauthorized destinations are rejected.http(s).request()call pins the connection to the pre-validated addresses via a customlookupcallback, defeating DNS-rebinding attacks between validation and connection time.tests/http-fetch.test.mjsalready exercise these SSRF scenarios (loopback/private addresses, mixed-scope DNS answers, redirect-based bypass attempts) and assert rejection.Conclusion
Alert #63 is a false positive. CodeQL's taint-tracking query flags any user-influenced URL reaching a network-request sink, but doesn't model this module's custom multi-step sanitizer (DNS pre-resolution + IP-range allow-listing + address-pinned request + per-redirect re-validation). No code changes were made since the flagged path is already correctly mitigated.