CVE-2026-7235
Path Traversal in ErlichLiu claude-agent-sdk Remote Exploit
Publication date: 2026-04-28
Last updated on: 2026-04-28
Assigner: VulDB
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| erlichliu | claude-agent-sdk | to b185aa7 (exc) |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-22 | The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. |
Attack-Flow Graph
AI Powered Q&A
How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:
The vulnerability allows an attacker to read arbitrary local files on the server, including potentially sensitive configuration files, credentials, or source code. This unauthorized disclosure of sensitive information can lead to violations of data protection regulations such as GDPR and HIPAA, which require strict controls over the confidentiality and security of personal and sensitive data.
Since the vulnerability compromises confidentiality by exposing sensitive files without authorization, it may result in non-compliance with standards that mandate protection of data confidentiality and integrity.
Mitigations such as restricting file access, implementing authentication and authorization, and validating file paths are necessary to reduce the risk of regulatory non-compliance.
Can you explain this vulnerability to me?
CVE-2026-7235 is a path traversal vulnerability in the claude-agent-sdk-master project, specifically in the Next.js API endpoint `/api/agent-output` located in the file `app/api/agent-output/route.ts`.
The vulnerability arises because the API accepts a user-supplied parameter `outputFile` which is normalized but not properly validated to ensure it stays within a trusted directory.
This allows an attacker to manipulate the `outputFile` argument to read arbitrary local files on the server that the application has permission to access.
The attack can be performed remotely by sending crafted HTTP requests to the vulnerable endpoint, potentially exposing sensitive files such as configuration files, credentials, or source code.
How can this vulnerability impact me? :
This vulnerability can impact you by allowing attackers to read arbitrary local files on the server hosting the vulnerable application.
- Confidentiality breach: Sensitive information such as configuration files, credentials, or source code can be disclosed.
- No impact on integrity or availability, as the vulnerability only allows reading files, not modifying or deleting them.
- If exploited, attackers could gain information that facilitates further attacks or unauthorized access.
How can this vulnerability be detected on my network or system? Can you suggest some commands?
This vulnerability can be detected by sending crafted HTTP POST requests to the vulnerable Next.js API endpoint `/api/agent-output` with a JSON body containing the `outputFile` parameter set to sensitive file paths. If the server responds with the contents of those files, the vulnerability is present.
A simple detection command using curl would be:
- curl -X POST -H "Content-Type: application/json" -d '{"outputFile":"/etc/hosts"}' http://<target-host>/api/agent-output
If the response contains the contents of `/etc/hosts` or other sensitive files, it confirms the presence of the path traversal vulnerability.
What immediate steps should I take to mitigate this vulnerability?
Immediate mitigation steps include restricting the `outputFile` parameter to a server-controlled directory and validating the file path to prevent path traversal.
- Implement path normalization and boundary checks using `path.resolve` to ensure the requested file is within an allowed directory.
- Reject absolute paths or any paths that attempt to traverse outside the allowed directory.
- Add authentication and authorization controls on the `/api/agent-output` endpoint to restrict access.
- Avoid returning raw file contents directly; instead, use server-generated opaque file IDs mapped internally to safe paths.
These steps help prevent unauthorized file reads and reduce the risk of exploitation until a proper patch is released.