Skip to content

🛡️ Sentinel: [HIGH] Fix URL protocol validation XSS vulnerability - #58

Open
one-more-refactor wants to merge 1 commit into
masterfrom
sentinel/robust-url-validation-17624849589202118736
Open

one-more-refactor wants to merge 1 commit into
masterfrom
sentinel/robust-url-validation-17624849589202118736

Conversation

@one-more-refactor

Copy link
Copy Markdown
Owner

🚨 Severity

HIGH

💡 Vulnerability

The announcement link validation previously used basic string prefix checks (startsWith). Attackers could potentially obfuscate URI schemes (e.g. inserting ASCII control characters or null bytes like java\x01script:) to bypass simple prefix filters.

🎯 Impact

If exploited, malicious links could execute arbitrary JavaScript in the victim operator/user's browser context (XSS).

🔧 Fix

  1. Strip ASCII control characters and null bytes ([\x00-\x1F\x7F]).
  2. Parse the sanitized link using standard new URL(clean, origin).
  3. Require the protocol to strictly resolve to http: or https:.

✅ Verification

Ran bun test with 5 unit test cases in src/url.test.ts covering valid URLs, relative paths, and obfuscated javascript:, data:, and vbscript: payloads. All tests passed. Also verified with bun run check and bun run build.


PR created automatically by Jules for task 17624849589202118736 started by @one-more-refactor

…fuscation

- Replace prefix matching with URL parsing and control character stripping
- Reject javascript:, data:, vbscript:, and other dangerous schemes
- Add unit tests verifying valid and obfuscated URLs

Co-authored-by: one-more-refactor <297687349+one-more-refactor@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: c0582d79-987b-4b4f-a88b-bd0daae3136c


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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