Skip to content

Potential fix for code scanning alert no. 13: Inefficient regular expression#53

Closed
NovasPlace wants to merge 1 commit into
masterfrom
alert-autofix-13
Closed

Potential fix for code scanning alert no. 13: Inefficient regular expression#53
NovasPlace wants to merge 1 commit into
masterfrom
alert-autofix-13

Conversation

@NovasPlace

Copy link
Copy Markdown
Owner

Potential fix for https://github.com/NovasPlace/CSM/security/code-scanning/13

The best fix is to remove nested/overlapping repetition ambiguity in QUOTED_POSIX_PATH_PATTERN by ensuring each repeated unit is a single path segment that cannot include /.
Concretely, in src/redactor.ts line 109 region, replace:

  • (?:\/[^"'\r\n]+)+

with a safer equivalent:

  • (?:\/[^\/"'\r\n]+)+

This preserves functionality (quoted absolute POSIX-like paths under the listed roots) while preventing the inner segment matcher from consuming /, eliminating the exponential backtracking shape CodeQL reported. No new methods, imports, or dependencies are required.

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

…ression

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@NovasPlace NovasPlace closed this Jul 20, 2026
@NovasPlace
NovasPlace deleted the alert-autofix-13 branch July 20, 2026 07:08
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