fix(security): sanitize log values (CWE-117) and remove committed node_modules#548
Merged
Merged
Conversation
…nd remove committed node_modules - Add SanitizeLogValue helper in OpenClawAgentRegistrar that strips CR/LF before values are passed to ILogger (addresses 4 cs/log-forging CodeQL alerts on alerts #9, #10, #11, #12) - Apply sanitization to all four affected LogInformation/LogError/LogDebug call-sites logging agent.Id and agent.Name - Remove 588 committed node_modules files (playwright + playwright-core) from version control via git rm --cached; add node_modules/ to .gitignore so it cannot be re-committed Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
Contributor
Test Results7 641 tests 7 622 ✅ 2m 26s ⏱️ Results for commit 20bed0a. ♻️ This comment has been updated with latest results. |
…trar The SanitizeLogValue helper insertion consumed the class-level closing brace via regex. Re-insert the ` }` that closes OpenClawAgentRegistrar before the new helper method. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Satisfies FINALNEWLINE editorconfig rule (end_of_line = crlf, insert_final_newline = true). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Code Coverage |
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
SanitizeLogValuehelper toOpenClawAgentRegistrarthat strips CR/LF/newline characters from user-supplied values (agent.Id,agent.Name) before they reach the logger. This addresses all 4 opencs/log-forgingCodeQL security alerts (Redacted PR #9 #9, Feature: Deterministic Workflow Capture, Registry, and Replay (WorkflowFramework Integration) #10, feat: Deterministic Workflow Capture, Registry, and Replay (JD.AI.Workflows) #11, feat(tui): configurable spinner styles with input dimming #12). The sanitizer uses chainedString.Replacewhich is recognized by CodeQL's log-injection sanitizer model.node_modules/to.gitignore. CI already installs playwright via the .NET build output (playwright.ps1), so no workflow changes needed.Test plan
cs/log-forgingfindingsdotnet build --configuration Release) succeeds🤖 Generated with Claude Code