Summary
WhatsApp MCP Server's whatsapp-bridge HTTP API exposes an unauthenticated local endpoint that accepts arbitrary absolute file paths for media attachments, without host header validation.
When the bridge is running, any local process—or a remote site via DNS rebinding—can send WhatsApp messages from the paired account and exfiltrate arbitrary readable files as document attachments.
Affected context
This vulnerability affects environments where the WhatsApp MCP Server bridge is running with its HTTP API bound to 127.0.0.1:8080 and accessible to other processes of the same user.
It is most relevant when the bridge process has access to sensitive local files (e.g., SSH keys, browser data, source code) and is used alongside other MCP servers, IDE extensions, or tools that can issue HTTP requests.
Risk increases when users browse untrusted websites while the bridge is active, due to the lack of Host header validation enabling DNS rebinding attacks.
Exploit preconditions
- Attack surface: Local loopback HTTP API (
127.0.0.1:8080) and browser-accessible origin for DNS rebinding. - Required access (local): Any process running as the same OS user, including sibling MCP servers, IDE plugins, or tool flows capable of making HTTP calls.
- Required access (remote): Ability to lure the user to a malicious webpage capable of DNS rebinding to the loopback address.
- Trigger points:
- Calling
/api/sendto send messages or attach documents. - Supplying an absolute
media_pathpointing to sensitive files on disk. - Why exploitation is possible: The bridge accepts unauthenticated requests, does not validate the Host header, and does not constrain
media_pathto a safe directory, allowing arbitrary file reads and unauthorized message sending.
Why this happens
The core issues fall under missing enforcement of access control and improper path handling:
- Missing authorization (CWE-306): The bridge HTTP API accepts any request from localhost without authentication, assuming that local callers are inherently trusted. This breaks the assumption once multiple tools, services, or browser contexts share the same user session.
- Improper path validation (CWE-22): The
/api/sendendpoint accepts absolutemedia_pathvalues and does not confine them to a dedicated media directory or guard against traversal, allowing callers to reference arbitrary files readable by the process. - Insufficient Host header validation (CWE-346): The service trusts incoming Host headers and does not enforce an allow-list, making it susceptible to DNS rebinding attacks where a browser-origin request is silently redirected to the local service.
Abstractly, the design assumed that "localhost equals trusted," did not narrow the file access scope, and relied on weak request origin signals, creating a composite access control failure.
Potential impact
- An attacker may send WhatsApp messages from the victim's paired account without their consent.
- Local or rebinding-based attackers could exfiltrate arbitrary files readable by the bridge process (e.g., SSH private keys, browser profiles, application secrets, dotfiles).
- Tools or extensions running in the user's MCP environment could unintentionally act as conduits for data leakage or unauthorized messaging.
- Compromise of other accounts or systems due to leaked credentials and keys taken from the victim's filesystem.
- Loss of privacy from exposure of personal documents, chat logs, or source code repositories.
General mitigation guidance
Effective mitigation focuses on tightening access control, constraining file access, and hardening origin validation:
- Introduce strong authentication on local HTTP APIs (e.g., bearer tokens, scoped credentials) and treat localhost callers as untrusted by default.
- Constrain file parameters like
media_pathto a specific root directory, rejecting absolute paths and path traversal sequences. - Enforce strict Host header allow-listing and origin expectations, reducing DNS rebinding risk for browser-mediated requests.
- Run bridge-like services with least privilege, in dedicated accounts or containers, limiting read access to only necessary files.
- Consider secure-by-default configurations where sensitive endpoints are disabled or tightly scoped unless explicitly configured.
How teams detect issues like this
Detection typically involves a mix of configuration review, code analysis, and runtime monitoring:
- Use static analysis or manual review to flag HTTP handlers that:
- Omit authentication and authorization checks.
- Accept filesystem paths from client input without normalization and confinement.
- Trust Host headers or origin information without allow-listing.
- Review service configuration for loopback-bound APIs that are implicitly trusted and lack explicit access controls.
- Implement logging of
/api/sendcalls, including caller context and requestedmedia_path, and monitor for suspicious patterns (e.g., access to.sshor browser profile directories). - Integrate security checks into CI pipelines to enforce policies such as "no unauthenticated write endpoints" and "no direct absolute path usage from HTTP parameters."

