π‘οΈ Sentinel: [HIGH] Fix URI-based XSS vulnerabilities in dynamic hrefs#83
π‘οΈ Sentinel: [HIGH] Fix URI-based XSS vulnerabilities in dynamic hrefs#83
Conversation
Added `sanitizeUrl` utility to enforce HTTP/HTTPS protocols and applied it to dynamic URLs injected into href attributes. Co-authored-by: longestmt <1509654+longestmt@users.noreply.github.com>
|
π 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
π¨ Severity: HIGH
π‘ Vulnerability: Cross-Site Scripting (XSS) via
javascript:URIs being injected into dynamichrefattributes (ex.mediaUrlin exercises page andinfo.urlin settings page).π― Impact: An attacker who controls these URLs could execute arbitrary JavaScript in the context of the application when a user clicks the affected links.
π§ Fix: Introduced a
sanitizeUrlutility insrc/utils/sanitize.jsthat strictly validates the URL protocol against an allowlist (http://orhttps://) and appliesescapeHTML. Applied this utility to all instances where dynamic URLs are interpolated intohrefattributes.β Verification:
node -con modified files to verify syntax.pnpm buildto confirm compilation.javascript:protocols by returning an empty string, effectively neutralizing the payload.PR created automatically by Jules for task 10207364139024820208 started by @longestmt