Coder AgentAPI exposed user chat history via a DNS rebinding attack in github.com/coder/agentapi
Coder AgentAPI exposed user chat history via a DNS rebinding attack in github.com/coder/agentapi
02 / AFFECTED SOFTWARE
Affected packages
12 explicit affected versions
03 / CONNECTIONS
Connected vulnerabilities
04 / EVIDENCE
Source records
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.
Coder AgentAPI exposed user chat history via a DNS rebinding attack in github.com/coder/agentapi
### Summary AgentAPI prior to version [0.4.0](https://github.com/coder/agentapi/releases/tag/v0.4.0) was susceptible to a client-side DNS rebinding attack when hosted over plain HTTP on localhost. ### Impact An attacker could have gained access to the `/messages` endpoint served by the Agent API. This allowed for the unauthorized exfiltration of sensitive user data, specifically local message history, which could've included secret keys, file system contents, and intellectual property the user was working on locally. ### Remediation We've [implemented](https://github.com/coder/agentapi/pull/49) an `Origin` and `Host` header validating middleware and set a secure by default configuration. Please upgrade to version [0.4.0](https://github.com/coder/agentapi/releases/tag/v0.4.0) or later. ### Credits We'd like to thank [Evan Harris](https://github.com/eharris128) from [mcpsec.dev](https://mcpsec.dev/) for reporting this issue and following the coordinated disclosure [policy](https://coder.com/security/policy).
05 / REFERENCES
Further evidence
- https://github.blog/security/application-security/localhost-dangers-cors-and-dns-rebinding
- https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/59xxx/CVE-2025-59956.json
- https://github.com/coder/agentapi/commit/5c425c62447b8a9eac19e9fc5a2eae7f0803f149
- https://github.com/coder/agentapi/pull/49
- https://github.com/coder/agentapi/releases/tag/v0.4.0
- https://github.com/coder/agentapi/security/advisories/GHSA-w64r-2g3w-w8w4
- https://mcpsec.dev/advisories/2025-09-19-coder-chat-exfiltration
- https://mcpsec.dev/advisories/2025-09-19-coder-chat-exfiltration/
- https://nvd.nist.gov/vuln/detail/CVE-2025-59956
- https://github.com/coder/agentapi
- https://pkg.go.dev/vuln/GO-2025-3991