mirror of
https://github.com/prompt-security/clawsec.git
synced 2026-06-21 09:21:21 +03:00
- Add backslash escaping before quote escaping in oneline() function
- Prevents incomplete string escaping vulnerability - Resolves CodeQL alert: https://github.com/prompt-security/clawsec/security/code-scanning/16
This commit is contained in:
@@ -52,6 +52,7 @@ function envOrEmpty(name) {
|
||||
function oneline(v) {
|
||||
return String(v ?? "")
|
||||
.replace(/[\r\n]+/g, " ")
|
||||
.replace(/\\/g, "\\\\")
|
||||
.replace(/"/g, "\\\"")
|
||||
.trim();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user