fix(website): escape backslashes in file paths to prevent string context breakout#638
Merged
aaronpowell merged 3 commits intoexperiment/github-pages-websitefrom Feb 2, 2026
Merged
Conversation
The previous implementation only escaped single quotes, which could allow
backslashes in file paths to break out of the JavaScript string context.
Now we escape backslashes first (\ -> \\), then single quotes (' -> \'),
preventing potential security issues.
Fixes CodeQL alert #26 for incomplete string escaping.
Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com>
Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] WIP to address feedback from review on website pull request
fix(website): escape backslashes in file paths to prevent string context breakout
Feb 2, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request addresses a security vulnerability (CodeQL alert #26) by fixing incomplete string escaping in the getActionButtonsHtml() function. File paths containing backslashes could previously break out of JavaScript string literals in onclick attributes, creating a potential code injection risk.
Changes:
- Added proper backslash escaping before single quote escaping in
getActionButtonsHtml() - Added explanatory comment documenting the escaping order and purpose
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Checklist
npm startand verified thatREADME.mdis up to date.Description
Addresses CodeQL alert #26: incomplete string escaping in
getActionButtonsHtml(). File paths containing backslashes could break out of the JavaScript string literal in onclick attributes.Before:
After:
Escaping order matters: backslashes first, then quotes.
Type of Contribution
Additional Notes
CodeQL validation confirms zero security alerts. Addresses review feedback from #637.
By submitting this pull request, I confirm that my contribution abides by the Code of Conduct and will be licensed under the MIT License.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.