Fix regex path matcher bugs and template injection vulnerabilities#34
Fix regex path matcher bugs and template injection vulnerabilities#34jbalagiya wants to merge 1 commit into
Conversation
* Add `escapeForScript` helper to sanitize data in `worker.js` * Use callback in `String.prototype.replace` within `renderTemplate` to prevent `$` special replacement character bugs * Update route regex to `(.+)` instead of `([^/]+)` to correctly capture base64 strings containing slashes for `/c/` and `/w/` routes Co-authored-by: jbalagiya <143921503+jbalagiya@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. |
This submission includes a fix for two major issues in
worker.js./c/and/w/paths previously failed when the base64-encoded URL contained slashes. By updating the matcher from([^/]+)to(.+), it captures the entire base64 string accurately.$&inside the replacement string). This has been addressed by escaping special script characters using a newescapeForScripthelper, and applying the variables using the callback form of.replace().PR created automatically by Jules for task 4258484493235967541 started by @jbalagiya