Skip to content

Fix CodeQL alert #1: YouTube URL hostname validation#181

Merged
neatudarius merged 2 commits into
mainfrom
fix/codeql-youtube-url-sanitization
Jul 9, 2026
Merged

Fix CodeQL alert #1: YouTube URL hostname validation#181
neatudarius merged 2 commits into
mainfrom
fix/codeql-youtube-url-sanitization

Conversation

@neatudarius

Copy link
Copy Markdown
Member

Summary

  • Replace url.includes("youtube.com") / url.includes("youtu.be") with hostname allowlist parsing via the URL API
  • Align getHTML with the same hostname logic for youtu.be vs youtube.com URLs

Fixes code scanning alert #1 (js/incomplete-url-substring-sanitization).

Replaces closed #177 with a single-file change on current main.

Test plan

  • CodeQL check passes on PR
  • YouTube embeds still work for youtube.com/watch?v=… and youtu.be/… links in blog/docs

Made with Cursor

Parse URLs with the URL API and allowlist YouTube hostnames instead of
matching youtube.com/youtu.be substrings anywhere in the URL string.

Fixes code scanning alert #1 (js/incomplete-url-substring-sanitization).

Co-authored-by: Cursor <cursoragent@cursor.com>
@netlify

netlify Bot commented Jul 9, 2026

Copy link
Copy Markdown

Deploy Preview for bemanproject ready!

Name Link
🔨 Latest commit 7bc56b1
🔍 Latest deploy log https://app.netlify.com/projects/bemanproject/deploys/6a5030c4ce8a060008013e8d
😎 Deploy Preview https://deploy-preview-181--bemanproject.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Co-authored-by: Cursor <cursoragent@cursor.com>
@neatudarius
neatudarius merged commit 3537a08 into main Jul 9, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant