CVE-2025-59956
Unknown Unknown - Not Provided
BaseFortify

Publication date: 2025-09-30

Last updated on: 2025-10-08

Assigner: GitHub, Inc.

Description
AgentAPI is an HTTP API for Claude Code, Goose, Aider, Gemini, Amp, and Codex. Versions 0.3.3 and below are susceptible to a client-side DNS rebinding attack when hosted over plain HTTP on localhost. An attacker can gain access to the /messages endpoint served by the Agent API. This allows for the unauthorized exfiltration of sensitive user data, specifically local message history, which can include secret keys, file system contents, and intellectual property the user was working on locally. This issue is fixed in version 0.4.0.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2025-09-30
Last Modified
2025-10-08
Generated
2026-05-07
AI Q&A
2025-09-30
EPSS Evaluated
2026-05-05
NVD
Affected Vendors & Products
Showing 1 associated CPE
Vendor Product Version / Range
coder agentapi to 0.4.0 (exc)
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-290 This attack-focused weakness is caused by incorrectly implemented authentication schemes that are subject to spoofing attacks.
CWE-350 The product performs reverse DNS resolution on an IP address to obtain the hostname and make a security decision, but it does not properly ensure that the IP address is truly associated with the hostname.
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?

CVE-2025-59956 is a client-side DNS rebinding vulnerability in AgentAPI versions 0.3.3 and below when hosted over plain HTTP on localhost. An attacker can exploit this by tricking a user into visiting a malicious website that uses DNS rebinding to bypass same-origin policies and send requests to the local AgentAPI's /messages endpoint. This allows the attacker to access and exfiltrate sensitive local data such as message history, secret keys, file system contents, and intellectual property that the user is working on locally. The root cause is improper origin validation, which fails to verify the legitimacy of the data source. The vulnerability requires no privileges but does require user interaction (visiting a malicious site). It is fixed in version 0.4.0 by implementing strict Host and Origin header validation and secure defaults. [4, 5]


How can this vulnerability impact me? :

This vulnerability can lead to unauthorized access and exfiltration of sensitive user data stored or processed locally by the AgentAPI, including chat history, secret keys, local filesystem contents, and intellectual property. An attacker can remotely exploit this by luring a user to a malicious website that performs a DNS rebinding attack, allowing the attacker to fetch and steal this sensitive information from the /messages endpoint of the local AgentAPI. This can result in significant privacy breaches and loss of confidential data. The attack is relatively easy to perform and can be completed within seconds after the victim visits the malicious site. [4, 5]


How can this vulnerability be detected on my network or system? Can you suggest some commands?

Detection of this vulnerability involves identifying if an AgentAPI server version 0.3.3 or below is running and accessible over plain HTTP on localhost, especially if the /messages endpoint is exposed. Since the vulnerability is a client-side DNS rebinding attack exploiting improper Host and Origin header validation, monitoring HTTP requests to localhost on port 3284 (default) for suspicious or unexpected Host or Origin headers can help detect exploitation attempts. Network monitoring tools or HTTP proxies can be used to inspect such traffic. Additionally, checking the running AgentAPI version can be done by querying the service or inspecting the installed package version. Specific commands are not provided in the resources, but general approaches include using tools like curl to test the /messages endpoint locally (e.g., `curl http://localhost:3284/messages`) and network packet capture tools (e.g., tcpdump or Wireshark) to monitor HTTP traffic for unusual Host or Origin headers. Also, verifying if the server is running with the `--allowed-hosts` and `--allowed-origins` flags configured properly can indicate mitigation status. [4, 5, 6]


What immediate steps should I take to mitigate this vulnerability?

Immediate mitigation steps include upgrading AgentAPI to version 0.4.0 or later, which contains the patch for this vulnerability. The patch implements strict validation of the Host and Origin HTTP headers to prevent DNS rebinding attacks. Additionally, configuring the server with the new command-line flags `--allowed-hosts` and `--allowed-origins` to restrict accepted Host and Origin headers to trusted values (e.g., localhost and specific origins) further mitigates the risk. Running the AgentAPI behind a reverse proxy with proper host restrictions is also recommended. Users should avoid running vulnerable versions exposed over plain HTTP on localhost without these protections. Applying these mitigations will prevent unauthorized access to the /messages endpoint and protect sensitive local data from exfiltration. [4, 5, 6, 2]


Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart