π Sentinel: [HIGH] Fix XSS vulnerabilities in workout and history pages#74
π Sentinel: [HIGH] Fix XSS vulnerabilities in workout and history pages#74
Conversation
Fixed multiple Stored Cross-Site Scripting (XSS) vulnerabilities in `src/pages/history.js` and `src/pages/workout.js`. Several user-controlled variables (e.g., plan names, day names, exercise names, muscle groups) were being directly interpolated into `innerHTML` strings without prior sanitization. This allowed malicious payloads to be injected via UI input or imported JSON data and executed within the application. All unescaped template interpolations have now been wrapped with the existing `escapeHTML()` utility to securely sanitize the inputs before DOM insertion. 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: Stored Cross-Site Scripting (XSS) via unsanitized user-controllable input (e.g., plan names, day names, exercise names, equipment strings) rendered directly into
innerHTMLstrings insrc/pages/workout.jsandsrc/pages/history.js.π― Impact: An attacker could execute arbitrary JavaScript within a victim's browser context by crafting a malicious plan, day, or custom exercise name and importing it via the application's data functionality. This breaks security boundaries and exposes IndexedDB data.
π§ Fix: Wrapped all previously unescaped template variables in the affected UI functions with the centralized
escapeHTML()utility fromsrc/utils/sanitize.js.β Verification: Ran
pnpm buildand Native Node Tests to confirm regressions weren't introduced and syntax is valid. Verified XSS mitigation logic behavior.PR created automatically by Jules for task 3442407995150504058 started by @longestmt