fix: log-forging security fix, command validation, and query optimization#213
Merged
Conversation
CodeQL flagged log forging (CWE-117): the raw, user-supplied username was written into the failed-login log line, letting an attacker inject CR/LF to forge fake log entries. Strip newlines before logging. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The scheduled-charging command accepted any non-empty string with no upper bound before forwarding it to MQTT. Cap it at 500 characters. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
GetAggregateStatsAsync ran two separate COUNT queries against TelemetrySnapshots. Combine them into one grouped query with conditional aggregates. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Merging main into this branch silently dropped the internal modifier back to private, since only main's side had touched that line and git didn't flag it as a conflict. WidgetEndpoints (added on main) calls FixedTimeEquals for its API-key check, so the build failed with CS0122 and two cascading CS8031 errors on unrelated lambdas in the same file. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Summary
scheduled-chargingcommand value at 500 characters before it's forwarded to MQTT.GetAggregateStatsAsync's two separate COUNT queries into a single grouped query.Test plan
dotnet test src/GarageStack.Tests— 265/265 passing🤖 Generated with Claude Code