-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BLUE-273 Worker processed debug log flag #84
Conversation
PR Reviewer Guide 🔍(Review updated until commit b79d692)
|
@@ -47,7 +47,8 @@ | |||
worker.kill() | |||
} | |||
if (receiptLoadTraker < config.receiptLoadTrakerLimit) { | |||
console.log(`Receipt load is below the limit: ${receiptLoadTraker}/${config.receiptLoadTrakerLimit}`) | |||
if (config.workerProcessesDebugLog) | |||
console.log(`Receipt load is below the limit: ${receiptLoadTraker}/${config.receiptLoadTrakerLimit}`) |
Check warning
Code scanning / CodeQL
Log injection Medium
user-provided value
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI about 1 month ago
To fix the log injection issue, we need to sanitize the user-provided input before logging it. Specifically, we should remove any newline characters from the config.receiptLoadTrakerLimit
value before including it in the log message. This can be done using String.prototype.replace
to ensure no line endings are present in the user input.
-
Copy modified lines R50-R53
@@ -49,4 +49,6 @@ | ||
if (receiptLoadTraker < config.receiptLoadTrakerLimit) { | ||
if (config.workerProcessesDebugLog) | ||
console.log(`Receipt load is below the limit: ${receiptLoadTraker}/${config.receiptLoadTrakerLimit}`) | ||
if (config.workerProcessesDebugLog) { | ||
const sanitizedLimit = config.receiptLoadTrakerLimit.toString().replace(/\n|\r/g, ""); | ||
console.log(`Receipt load is below the limit: ${receiptLoadTraker}/${sanitizedLimit}`); | ||
} | ||
// Kill the extra workers from the end of the array |
The merge-base changed after approval.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think src/worker-process/index.ts should also have the flags around the ( console.log / console.error .. etc. ) .. right now i can see that only being done for src/primary-process/index.ts
As the other file was out of scope for what Jai thought we needed, I will in principle agree with you, but I think we should create a separate ticket for the additional flag wrapping. Will have a task created |
Persistent review updated to latest commit b79d692 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
marking it as approved since the requested changes moved to a new ticket.. https://linear.app/shm/issue/BLUE-275/additional-flag-wrapping-in-archiver-logs
No description provided.