Skip to content

Commit 3a579a5

Browse files
Potential fix for pull request finding 'CodeQL / Log injection'
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 063f6ca commit 3a579a5

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

fixtures/flight/server/global.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,10 @@ function request(options, body) {
8787
}
8888

8989
function sanitizeForLog(value) {
90-
return String(value).replace(/[\r\n]+/g, ' ');
90+
return String(value)
91+
.replace(/[\r\n]+/g, ' ')
92+
.replace(/[\x00-\x1F\x7F]+/g, ' ')
93+
.trim();
9194
}
9295

9396
async function renderApp(req, res, next) {

0 commit comments

Comments
 (0)