Executive brief
nanobot is a personal AI assistant that can integrate with messaging platforms like WhatsApp. A security flaw in its WhatsApp bridge allows an attacker to send a specially crafted document that forces the assistant to write files to any location on the host computer's storage. This could allow an attacker to gain full control over the system by overwriting sensitive files like security keys or configuration settings without any user interaction.
Technical details
A path traversal vulnerability exists in `bridge/src/whatsapp.ts` within nanobot versions up to 0.1.5.post3. The application fails to sanitize the `fileName` field from incoming WhatsApp document messages before passing it to `path.join()`. Because `path.join()` resolves `..` sequences, an attacker can provide a filename like `../../../../.ssh/authorized_keys` to escape the intended media directory. Since the attacker also controls the file content, this provides a 'write-anywhere' primitive. This can lead to Remote Code Execution (RCE) by overwriting SSH keys, crontabs, or configuration files. A fix is planned for version 0.1.5.post4.
Affected products
- HKUDS nanobot <= 0.1.5.post3
Timeline
- 2026-05-24: advisory: GitHub Security Advisory published
- 2026-06-18: disclosed: CVE published to NVD