# 2025-05-17 20:49:02.177296 +/commit # 2025-05-17 20:49:02.177350 +/commit # 2025-05-17 20:49:46.433239 +/commit # 2025-05-17 20:49:46.433283 +/commit # 2025-05-17 20:52:23.409720 +evaluate this security report in this repository. is it sensible? + +``` +I have got a security warning from github codeql for the onmount.js and wanted to inform you about the "Incomplete string escaping or encoding" issue. + +Copilot Autofix recommends to use following code: + +return '[role~="' + selector.substr(1).replace(/\\/g, '\\\\').replace(/"/g, '\\"') + '"]' + +instead of following one: + +return '[role~="' + selector.substr(1).replace(/"/g, '\\"') + '"]' + + +Description of the issue: + +"To fix the issue, we need to ensure that backslashes in the input string are properly escaped. This can be achieved by adding a replace call to escape backslashes before escaping double quotes. Specifically: + + Use a regular expression with the g flag to replace all occurrences of backslashes (\) with double backslashes (\\). + Chain this with the existing replace call for escaping double quotes. +``` + +see: + +- index.js +- test/helpers/index.js # 2025-05-17 20:52:25.295071 +a # 2025-05-17 20:56:13.125899 +/commit # 2025-05-17 20:56:13.125937 +/commit # 2025-05-17 20:58:50.720262 +/commit # 2025-05-17 20:58:50.720310 +/commit # 2025-05-17 20:59:07.894412 +/commit # 2025-05-17 20:59:07.894459 +/commit