Closed
π fix(offscreen): extend URL scheme check to block data: and vbscript: hrefs#44
data: and vbscript: hrefs#44Conversation
Copilot
AI
changed the title
[WIP] Fix code scanning alert #5
fix(offscreen): extend URL scheme check to block Aug 2, 2026
data: and vbscript: hrefs
qveys
marked this pull request as ready for review
August 2, 2026 19:24
There was a problem hiding this comment.
Pull request overview
This PR updates the offscreen crawl HTML parser to reject additional unsafe URL schemes during link extraction, addressing CodeQL alert #5 by preventing data: and vbscript: links from being returned by extractLinks().
Changes:
- Extend
extractLinks()βs href scheme guard to also rejectdata:andvbscript:URLs (in addition to existingmailto:,javascript:, and#). - Tighten crawl link extraction behavior to avoid propagating potentially executable-content URLs into the crawl pipeline.
Comment on lines
219
to
223
| href.startsWith("mailto:") || | ||
| href.startsWith("javascript:") || | ||
| href.startsWith("data:") || | ||
| href.startsWith("vbscript:") || | ||
| href.startsWith("#") |
data: and vbscript: hrefsdata: and vbscript: hrefs
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 alert #5:
extractLinksinoffscreen.jsonly rejectedjavascript:hrefs, leavingdata:andvbscript:β equally capable of encoding executable content β unfiltered during crawl link extraction.Change
js/offscreen.jsβ adddata:andvbscript:to the href scheme rejection guard alongside the existingjavascript:andmailto:checks: