Skip to content

Conversation

@rtivital
Copy link
Member

Potential fix for https://github.com/mantinedev/mantine/security/code-scanning/2

To fully escape dangerous characters in the CSS variable interpolation, we must escape both single quotes and backslashes within the label string. The best approach is to first escape all backslashes (\), then escape single quotes ('), since newly-added backslashes could interfere with subsequent escaping if done out of order. Both should use the global regex flag to capture all instances in the string.

Edit only line 47, within packages/@mantine/spotlight/src/SpotlightActionsGroup.tsx, to ensure label is properly escaped. No additional dependencies are required because JavaScript's built-in string replace with regular expressions suffices.


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

rtivital and others added 2 commits September 13, 2025 20:12
…ng or encoding

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@rtivital rtivital marked this pull request as ready for review September 13, 2025 17:44
@rtivital rtivital merged commit 0d60bdd into master Sep 13, 2025
4 checks passed
@rtivital rtivital deleted the alert-autofix-2 branch September 13, 2025 17:44
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