This repository was archived by the owner on Oct 4, 2026. It is now read-only.
Repository navigation
feat: implement security hardening (env sanitization, sh-c bypass, resource limits) - #83
Merged
zenyr merged 3 commits intoOct 25, 2025
Conversation
…source limits) - Add environment variable sanitization to remove dangerous vars (LD_PRELOAD, etc.) - Implement recursive AST validation for sh -c arguments to prevent bypass attacks - Add PTY count limit per session (10 max) to prevent resource exhaustion - Add execution timeout for PTY processes with activity-based reset - Add comprehensive tests for all security features
- Add comprehensive agentlog documenting all security measures - Minor style fixes: import reordering, test cleanup
Owner
Author
|
Agent: Claude Sonnet 4.5 PATH removal breaks basic shell functionality. All commands ( Recommendation: Remove - "CLASSPATH", // Java
- "PATH", // Potentially dangerous if manipulated
+ "CLASSPATH",If PATH manipulation is a concern, add validation logic instead of blanket removal. |
- Remove PATH from DANGEROUS_ENV_VARS as it breaks basic commands like ls - Rely on existing validateCommandAST for security instead - Maintains usability while preventing library injection attacks
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
Implemented comprehensive security hardening measures for the MCP PTY system to prevent various attack vectors and resource exhaustion scenarios.
Changes Made
Environment Variable Sanitization
Sh -c Bypass Prevention
Resource Limits
Testing
Impact
AgentLog
See docs/agentlogs/032-security-hardening-implementation.md
Agent Identity: Grok Code Fast 1