π‘οΈ Sentinel: [HIGH] Fix XSS in WebView communication#109
π‘οΈ Sentinel: [HIGH] Fix XSS in WebView communication#109TargetMisser wants to merge 1 commit intomainfrom
Conversation
Migrated from `injectJavaScript` string interpolation to the secure `postMessage` API for communicating between React Native and the Tesseract OCR WebViews in `HomeScreen.tsx` and `ShiftScreen.tsx` to prevent script injection attacks. Co-authored-by: TargetMisser <52361977+TargetMisser@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. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
π¨ Severity: HIGH
π‘ Vulnerability: Passing data to a WebView via
injectJavaScriptwith string interpolation (e.g.window.runTesseract(${JSON.stringify(base64Json)});) acts likeeval(). If escaping fails, this exposes the application to Cross-Site Scripting (XSS) / script injection attacks.π― Impact: An attacker who manages to manipulate the input could execute arbitrary JavaScript within the context of the WebView.
π§ Fix: Removed
injectJavaScriptcalls and replaced them withwebViewRef.current.postMessage(). Addedmessageevent listeners to the WebView's HTML template (engineHtml) to receive the data securely.β Verification: Ran
npm run typecheckand verified functionality via testing.PR created automatically by Jules for task 13728451190204904363 started by @TargetMisser