whatsapp-mcp
- Type
- MCP server
- Scanned
- Nov 12, 2026
- Version
- 7d6a06dcdce1
- Files read
- 11
This project connects an AI agent to your personal WhatsApp account through a local Go bridge and a Python MCP server so it can read chats, search contacts, download attachments, and send messages or local files. Its biggest risk is that the local Go bridge opens an unauthenticated HTTP server on port 8080 across all network interfaces, letting anyone on your local network or any website open in your browser send WhatsApp messages as you and steal files from your computer, while malicious attachment filenames can also write files outside the download folder.
What it can reach
- Files
- Reads and writes local SQLite databases and downloaded media in whatsapp-bridge/store/, creates temporary .ogg audio files, and can read and send any local file path passed to send_file or send_audio_message.
- Network
- Connects to WhatsApp servers to sync messages, download attachments, and send messages or files from your personal WhatsApp account, and runs a local HTTP server on port 8080.
- Secrets
- Stores and uses persistent WhatsApp multidevice session keys in whatsapp-bridge/store/whatsapp.db and message media decryption keys in whatsapp-bridge/store/messages.db.
- Shell commands
- Runs the ffmpeg command-line tool via subprocess when converting non-Opus audio files for voice messages.
Findings
-
CriticalUnauthenticated local HTTP API allows file theft and WhatsApp account abuse from the network or browser
The Go WhatsApp bridge starts an HTTP server on :8080 (all network interfaces) with no password, API token, Origin check, or Content-Type check. Its /api/send endpoint reads any local file path given in media_path and sends that file over WhatsApp to any recipient phone number. Anyone on the same Wi-Fi or local network, or any malicious website open in your browser sending a background POST request to http://localhost:8080/api/send, can send WhatsApp messages as you and silently exfiltrate any readable file on your computer (including SSH keys or store/whatsapp.db WhatsApp session keys) to the attacker's WhatsApp account.
Fix: Bind the HTTP server strictly to 127.0.0.1:8080, require a random shared secret token in an Authorization header between the Python MCP server and the Go bridge, enforce Content-Type: application/json, and reject requests carrying a browser Origin header.
-
CriticalPath traversal in attachment downloads lets received documents write files outside the store folder
When a WhatsApp document message arrives, extractMediaInfo stores the sender-supplied doc.GetFileName() value directly in the database without stripping ../ path segments, and the MCP message list hides that filename. When you or the AI agent later call download_media using only the message ID and chat ID, downloadMedia joins that untrusted filename onto chatDir and writes the downloaded bytes to disk with os.WriteFile. A stranger who sends a document named with ../ segments (such as ../../../../Users/you/.zshenv or a login startup item) can write arbitrary files outside store/ to run code on your computer, or point the returned file_path at an existing sensitive file.
Fix: Sanitize filename with filepath.Base(filename) while rejecting empty, dot, or dot-dot names, sanitize chatJID directory names, and verify that the cleaned destination path stays strictly inside the store directory before checking or writing the file.
-
LowWhatsApp session keys, message database, and downloaded media are created with world-readable permissions
The Go bridge creates the store and per-chat directories with 0755 permissions, writes downloaded media files with 0644 permissions, and creates store/whatsapp.db and store/messages.db with default SQLite permissions (typically 0644). Because whatsapp.db holds unencrypted WhatsApp session keys and messages.db holds your full message history and media keys, other user accounts or unprivileged local processes on the same machine can read your private chats and hijack your WhatsApp session.
Fix: Create the store and chat directories with 0700 permissions and restrict whatsapp.db, messages.db, and downloaded media files to 0600 permissions.
