Repository navigation
Remove line breaks outright in logSafe - #109
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Bug fix, no spec. Closes code-scanning alert #27 (log injection,
src/server.ts), which stayed open after #108.CodeQL's log-injection rule only treats a
replaceas sanitising when it swaps line breaks for an empty string (StringReplaceSanitizerinLogInjectionQuery.qll). #108 swapped them for a space, so the rule never counted it.Changes
logSafenow removes\rand\noutright. Other control characters still become spaces, and the 200-character cap is unchanged.a\nbasabrather thana b.Checks
bun run typecheck && bun run test:coveragepass (100% lines and functions)bun run web:typecheck && bun run web:testpass (no web change)docs/guide/) updated for anything people will notice, andbun run docs:buildpasses (nothing to update)site/) updated if a feature it describes changed, andbun run site:buildpasses (nothing to update)