CVE-2026-7235 Overview
A path traversal vulnerability has been identified in ErlichLiu claude-agent-sdk-master up to commit b185aa7ff0d864581257008077b4010fca1747bf. The vulnerability exists in the file app/api/agent-output/route.ts, where improper handling of the outputFile argument allows attackers to traverse directories and access files outside the intended directory structure. This vulnerability can be exploited remotely without authentication, potentially exposing sensitive files on the affected system.
Critical Impact
Unauthenticated remote attackers can read arbitrary files from the server by manipulating the outputFile parameter, potentially exposing sensitive configuration files, credentials, or other confidential data.
Affected Products
- ErlichLiu claude-agent-sdk-master (up to commit b185aa7ff0d864581257008077b4010fca1747bf)
- Versions using rolling release model prior to fix
Discovery Timeline
- 2026-04-28 - CVE-2026-7235 published to NVD
- 2026-04-28 - Last updated in NVD database
Technical Details for CVE-2026-7235
Vulnerability Analysis
This path traversal vulnerability (CWE-22) affects the app/api/agent-output/route.ts file in the claude-agent-sdk-master project. The vulnerability stems from insufficient validation of the outputFile parameter, which allows attackers to use directory traversal sequences (such as ../) to escape the intended file path and access arbitrary files on the server's file system.
The attack can be initiated remotely over the network without requiring any authentication or user interaction. While the vulnerability allows read access to confidential files, it does not appear to enable modification or deletion of files. The exploit has been publicly disclosed and documented in the GitHub Issue Tracker, increasing the risk of exploitation in the wild.
Root Cause
The root cause is improper input validation in the API route handler. The outputFile parameter is not properly sanitized before being used to construct file paths, allowing path traversal sequences to bypass intended directory restrictions. The application fails to implement proper canonicalization or path validation checks that would prevent directory escape attempts.
Attack Vector
The vulnerability is exploitable via network-based requests to the affected API endpoint. An attacker can craft malicious HTTP requests containing path traversal sequences in the outputFile parameter to access files outside the designated output directory. Since this is a TypeScript/Node.js API endpoint, the attacker would typically send HTTP requests with payloads like ../../../etc/passwd or similar traversal patterns to read sensitive system files.
The vulnerability mechanism works by accepting user-controlled input for file path construction without adequate validation. When the application processes a request containing traversal sequences, it resolves the path relative to the current directory, potentially navigating to parent directories and accessing unintended files. For detailed technical information, refer to the VulDB analysis.
Detection Methods for CVE-2026-7235
Indicators of Compromise
- HTTP requests to /api/agent-output endpoints containing path traversal sequences (../, ..%2f, %2e%2e/)
- Unusual file access patterns in application logs showing requests for files outside expected directories
- Web server access logs showing encoded traversal attempts targeting the route.ts endpoint
Detection Strategies
- Implement web application firewall (WAF) rules to detect and block path traversal patterns in request parameters
- Monitor API endpoint logs for suspicious outputFile parameter values containing directory traversal sequences
- Deploy file integrity monitoring on sensitive directories to detect unauthorized access attempts
- Review application logs for repeated requests to the agent-output API with varying file paths
Monitoring Recommendations
- Enable verbose logging on the affected API endpoint to capture all incoming outputFile parameter values
- Set up alerts for requests containing encoded characters or traversal patterns targeting the agent-output route
- Monitor for unusual file read operations originating from the Node.js application process
How to Mitigate CVE-2026-7235
Immediate Actions Required
- Restrict access to the /api/agent-output endpoint using network-level controls or authentication requirements
- Implement input validation to reject any outputFile parameter containing path traversal sequences
- Apply the principle of least privilege to the application's file system access permissions
- Consider disabling the affected endpoint until a patch is available from the maintainer
Patch Information
At the time of publication, no official patch has been released by the project maintainer. The project was informed of the vulnerability through an issue report but has not yet responded. Since this project uses a rolling release model, users should monitor the GitHub repository for updates and apply any commits that address this vulnerability once available.
Workarounds
- Implement a reverse proxy or WAF rule to filter path traversal patterns before requests reach the application
- Add middleware to validate and sanitize the outputFile parameter, ensuring it contains only allowed characters and does not escape the intended directory
- Use path canonicalization functions (such as path.resolve() combined with a base directory check) to ensure requested files remain within the allowed directory
- Restrict file system permissions for the application user to limit the impact of successful exploitation
# Example nginx configuration to block path traversal attempts
location /api/agent-output {
# Block requests containing path traversal patterns
if ($request_uri ~* "\.\.") {
return 403;
}
# Block encoded traversal attempts
if ($request_uri ~* "%2e%2e|%252e%252e") {
return 403;
}
proxy_pass http://localhost:3000;
}
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

