Skip to content

πŸ› fix(offscreen): extend URL scheme check to block data: and vbscript: hrefs - #44

Closed
qveys with Copilot wants to merge 4 commits into
mainfrom
copilot/fix-code-scanning-alerts-5
Closed

πŸ› fix(offscreen): extend URL scheme check to block data: and vbscript: hrefs#44
qveys with Copilot wants to merge 4 commits into
mainfrom
copilot/fix-code-scanning-alerts-5

Conversation

Copilot AI commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

CodeQL alert #5: extractLinks in offscreen.js only rejected javascript: hrefs, leaving data: and vbscript: β€” equally capable of encoding executable content β€” unfiltered during crawl link extraction.

Change

  • js/offscreen.js β€” add data: and vbscript: to the href scheme rejection guard alongside the existing javascript: and mailto: checks:
if (
  href.startsWith("mailto:") ||
  href.startsWith("javascript:") ||
  href.startsWith("data:") ||      // added
  href.startsWith("vbscript:") ||  // added
  href.startsWith("#")
) {
  return;
}

Copilot AI changed the title [WIP] Fix code scanning alert #5 fix(offscreen): extend URL scheme check to block data: and vbscript: hrefs Aug 2, 2026
Copilot AI requested a review from qveys August 2, 2026 18:59
@qveys
qveys marked this pull request as ready for review August 2, 2026 19:24
Copilot AI review requested due to automatic review settings August 2, 2026 19:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 reject data: and vbscript: URLs (in addition to existing mailto:, javascript:, and #).
  • Tighten crawl link extraction behavior to avoid propagating potentially executable-content URLs into the crawl pipeline.

Comment thread js/offscreen.js
Comment on lines 219 to 223
href.startsWith("mailto:") ||
href.startsWith("javascript:") ||
href.startsWith("data:") ||
href.startsWith("vbscript:") ||
href.startsWith("#")
@github-actions github-actions Bot added 🧩 Area: Crawl Multi-page crawl, discovery, queueing, or anti-bot handling. 🧩 Area: Tests Test suites, fixtures, or test tooling. labels Aug 2, 2026
@github-actions github-actions Bot changed the title fix(offscreen): extend URL scheme check to block data: and vbscript: hrefs 🩹 fix: [WIP] Fix code scanning alert #5 Aug 2, 2026
@github-actions github-actions Bot changed the title 🩹 fix: [WIP] Fix code scanning alert #5 πŸ› fix(offscreen): extend URL scheme check to block data: and vbscript: hrefs Aug 2, 2026
@qveys qveys closed this Aug 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🧩 Area: Crawl Multi-page crawl, discovery, queueing, or anti-bot handling. 🧩 Area: Tests Test suites, fixtures, or test tooling.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants