Skip to content

Potential fix for code scanning alert no. 2: Incomplete string escaping or encoding#16

Draft
cliffano wants to merge 1 commit into
mainfrom
alert-autofix-2
Draft

Potential fix for code scanning alert no. 2: Incomplete string escaping or encoding#16
cliffano wants to merge 1 commit into
mainfrom
alert-autofix-2

Conversation

@cliffano

@cliffano cliffano commented Jun 6, 2026

Copy link
Copy Markdown
Owner

Potential fix for https://github.com/cliffano/jazz/security/code-scanning/2

General fix: when constructing a JavaScript string literal from raw text, escape backslashes first, then escape control characters and quotes globally.

Best minimal fix in lib/jazz/compiler.js is to update the ast.Str handling block in _compileExpr (lines 253–257 region) so it includes .replace(/\\/g, "\\\\") before the existing replacements. This preserves existing behavior while making escaping complete for backslashes.

No new imports, helper methods, or dependencies are required.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

…ng or encoding

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@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.

1 participant