Skip to content

πŸ›‘οΈ Sentinel: [HIGH] Fix XSS in markdown rendering#1252

Open
khangnghiem wants to merge 1 commit into
mainfrom
fix/sentinel-xss-marked-parse-1499804241110270739
Open

πŸ›‘οΈ Sentinel: [HIGH] Fix XSS in markdown rendering#1252
khangnghiem wants to merge 1 commit into
mainfrom
fix/sentinel-xss-marked-parse-1499804241110270739

Conversation

@khangnghiem

Copy link
Copy Markdown
Owner

🚨 Severity: HIGH
πŸ’‘ Vulnerability: Missing HTML sanitization on the marked.parse output in site/app.js when rendering user-provided Markdown notes could allow execution of embedded malicious scripts.
🎯 Impact: A cross-site scripting (XSS) attack could execute arbitrary JavaScript in the context of the editor, potentially stealing session information or performing unauthorized actions.
πŸ”§ Fix: Wrapped the marked.parse output with window.DOMPurify.sanitize(rendered, { ADD_ATTR: ['data-note-node', 'data-node'] }) if DOMPurify is available. Also preserved the existing fallback logic of using a safe, regex-escaped string if DOMPurify isn't loaded (preventing a fail-open scenario).
βœ… Verification: Tested syntax with node --check site/app.js. Ran tests via cargo test --workspace and pnpm test inside fd-vscode. Journaled the critical learning in .jules/sentinel.md.


PR created automatically by Jules for task 1499804241110270739 started by @khangnghiem

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@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.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

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