Skip to content

🛡️ Sentinel: [CRITICAL] Fix XSS vulnerability in ShiftScreen.tsx#61

Open
TargetMisser wants to merge 2 commits intomainfrom
sentinel-fix-xss-shiftscreen-15818564123666207320
Open

🛡️ Sentinel: [CRITICAL] Fix XSS vulnerability in ShiftScreen.tsx#61
TargetMisser wants to merge 2 commits intomainfrom
sentinel-fix-xss-shiftscreen-15818564123666207320

Conversation

@TargetMisser
Copy link
Copy Markdown
Owner

🚨 Severity: CRITICAL
💡 Vulnerability: The ShiftScreen.tsx component previously injected a dynamic base64 JSON string directly into a JavaScript template literal executed by a WebView (injectJavaScript). It attempted to mitigate issues via manual single quote replacement (.replace(/'/g, "\\'")), which is unreliable and vulnerable to XSS and syntax corruption via unhandled backslashes or line endings.
🎯 Impact: Attackers or malformed inputs could execute arbitrary JavaScript within the context of the WebView.
🔧 Fix: Wrapped the data in JSON.stringify(base64Json) when passing it to the JavaScript string literal. This leverages native encoding to safely escape all characters and completely neutralizes injection risks.
✅ Verification: Ran npm run typecheck and verified syntax changes in src/screens/ShiftScreen.tsx (the solution aligns precisely with prior fixes on HomeScreen.tsx).


PR created automatically by Jules for task 15818564123666207320 started by @TargetMisser

Co-authored-by: TargetMisser <52361977+TargetMisser@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.

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
flight-work-app Ready Ready Preview, Comment, Open in v0 Apr 8, 2026 1:24am

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes an XSS vector in ShiftScreen.tsx where untrusted/dynamic content was interpolated into JavaScript executed via WebView.injectJavaScript.

Changes:

  • Removes manual single-quote escaping on the JSON payload.
  • Passes the payload into injected JS using JSON.stringify(...) so it is encoded as a safe JS string literal.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: TargetMisser <52361977+TargetMisser@users.noreply.github.com>
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.

2 participants