Skip to content

Conversation

@Git-Hub-Chris
Copy link
Owner

Potential fix for https://github.com/Git-Hub-Chris/MicrosoftVsCode/security/code-scanning/14

To fix the incomplete escaping, the code should also escape backslash characters in addition to asterisks. The safest approach is to escape all backslashes first, before escaping any other metacharacters (like asterisks), to avoid double-escaping or other confusion. This can be done by first replacing all backslash (\) characters with double-backslash (\\), and then escaping asterisks by replacing * with \*, both using global regular expressions. Only lines directly related to the escaping should be edited (line 759: const escapedName = ...). No extra imports are necessary because the replace method and regular expressions are native in JavaScript/TypeScript.

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

…ing or encoding

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: Christopher Birnie-Browne <153604499+Git-Hub-Chris@users.noreply.github.com>
@Git-Hub-Chris Git-Hub-Chris marked this pull request as ready for review September 26, 2025 06:33
@Git-Hub-Chris Git-Hub-Chris merged commit 1de00bf into Main Sep 26, 2025
11 checks passed
@Git-Hub-Chris Git-Hub-Chris deleted the alert-autofix-14 branch September 26, 2025 06:33
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