π‘οΈ Sentinel: [HIGH] Fix XSS in workout and history pages#97
π‘οΈ Sentinel: [HIGH] Fix XSS in workout and history pages#97
Conversation
This commit fixes multiple Cross-Site Scripting (XSS) vulnerabilities in `src/pages/history.js` and `src/pages/workout.js`. Several user-controlled variables, including workout day names, dates, plan names, exercise names, and exercise equipment were being directly interpolated into `innerHTML` using template strings without sanitization. All of these identified insertion points are now correctly wrapped with `escapeHTML()`. In addition to text content, HTML attributes interpolating user input (such as `data-swap-name`) are also safely sanitized. 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: Multiple Cross-Site Scripting (XSS) vulnerabilities in the active workout and workout history views due to user-provided data (plan names, exercise names, dates) being injected directly into
innerHTMLusing unescaped template literals. Also missed sanitization ondata-attributes creating a risk for attribute breakout XSS.π― Impact: An attacker or a malicious shared plan JSON could execute arbitrary JavaScript in the context of the user's application, potentially leading to unauthorized data access or session manipulation.
π§ Fix: Wrapped all identified vulnerable interpolation points in
src/pages/workout.jsandsrc/pages/history.jswith theescapeHTML()utility, ensuring data is safely rendered in the DOM.β Verification: Successfully ran
pnpm buildand executed anode -csyntax check to ensure there are no compilation errors. Checked that no tests fail as a result of the changes.PR created automatically by Jules for task 2672050732105551847 started by @longestmt