fix: address 5 critical security audit findings (#88)#94
Open
JosephDoUrden wants to merge 1 commit intoKeygraphHQ:mainfrom
Open
fix: address 5 critical security audit findings (#88)#94JosephDoUrden wants to merge 1 commit intoKeygraphHQ:mainfrom
JosephDoUrden wants to merge 1 commit intoKeygraphHQ:mainfrom
Conversation
…Q#88) - Validate parsed tool call JSON structure before property access (command injection) - Add path traversal protection in saveDeliverableFile with resolve+prefix check - Enforce minimum 32-char TOTP secret length per RFC 4226 - Add redactSensitive() helper to prevent secret exposure in error logs - Add forbidden key detection to block prototype pollution via YAML configs Includes vitest setup and 38 tests covering all 5 fixes.
kundan175
approved these changes
Feb 8, 2026
| } | ||
|
|
||
| // Keys whose values should be redacted in log output | ||
| const SENSITIVE_KEY_PATTERN = /^(password|pass|passwd|secret|token|apikey|api_key|authorization|cookie|session|sessionid|session_id|privatekey|private_key|credentials|totp_secret|access_token|refresh_token)$/i; |
There was a problem hiding this comment.
This could be expanded but good start.
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
This PR addresses the 5 Critical findings from the Argus Security Audit report:
isValidToolCall) and defensive validation inhandleToolUseMessage, plussanitizeForDisplayto prevent control-character/log injection.saveDeliverableFilewith filename validation and a resolved-path prefix check to ensure writes stay within the deliverables directory.redactSensitive()and applied it toerror.contextlogging to prevent leaking tokens/passwords/keys.__proto__,constructor,prototype) and enabled safer YAML parsing options before any downstream use.Files changed
Test plan
npm testpasses in both root andmcp-server/Closes #88