HIGH 8.7

CVE-2026-48716: nanobot WhatsApp Bridge Path Traversal Arbitrary File Write Vulnerability

A vulnerability exists in nanobot versions 0.1.5.post3 and earlier that allows an attacker to write files anywhere on a system where the WhatsApp bridge is running. When a user receives a document via WhatsApp through nanobot's bridge, the application downloads the file and saves it to disk. An attacker can craft a malicious filename containing path traversal sequences (like `../../../`) to escape the intended media directory and write to sensitive locations, such as SSH configuration directories or system files. Since the attacker controls both the filename and file content, they can potentially overwrite critical system or user files. This requires network access and some knowledge of the target system's directory structure, but does not require user interaction beyond receiving a WhatsApp message.

Source data · NVD / CISA · public domain

CVSS
3.1 · 8.7 HIGH · CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:N/I:H/A:H
Weaknesses (CWE)
CWE-22
Affected products
0 configuration(s)
Published / Modified
2026-06-18 / 2026-06-23

NVD description (verbatim)

nanobot is a personal AI assistant. In versions 0.1.5.post3 and prior, the WhatsApp bridge in bridge/src/whatsapp.ts constructs a filesystem path using the fileName field from an incoming WhatsApp document message without sanitization. The WhatsApp bridge downloads media attachments and writes them to disk using a filename derived from the sender's message via documentMessage.fileName, which is concatenated with a prefix and its raw value is passed directly to path.join(mediaDir, outFilename). Node.js path.join resolves .. components, allowing an attacker to escape the intended media/ directory by sending a document with a crafted fileName such as ../../../.ssh/authorized_keys. Because the attacker also controls the file content (the downloaded buffer), this is a write-anywhere primitive — both path and content are attacker-controlled. A fix for this issue is planned for version 0.1.5.post4.

2 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

The vulnerability stems from unsanitized path construction in bridge/src/whatsapp.ts. The WhatsApp bridge accepts incoming document messages, extracts the fileName field, and passes it directly to Node.js path.join() without validation. The vulnerable code concatenates a media directory prefix with the user-supplied fileName and writes the downloaded buffer to that path. Node.js path.join() resolves `..` path components, enabling directory traversal. An attacker sending a document with a crafted fileName such as `../../../.ssh/authorized_keys` can write outside the intended media/ directory. Because the attacker controls both the file path and its contents (via the downloaded media buffer), this constitutes a write-anywhere vulnerability. The issue is classified as CWE-22 (Improper Limitation of a Pathname to a Restricted Directory).

Business impact

Successful exploitation could allow an attacker to modify or create files in arbitrary locations on the host system, potentially enabling privilege escalation, system compromise, or lateral movement. If the nanobot process runs with elevated privileges or has access to sensitive configuration files, an attacker could modify SSH keys, application credentials, or system binaries. For organizations using nanobot as a company AI assistant integrated with WhatsApp, this creates a supply-chain-like risk: any external WhatsApp contact can potentially compromise the host system. The impact extends beyond the application itself to the entire host environment.

Affected systems

nanobot versions 0.1.5.post3 and prior are affected. The vulnerability is specific to deployments using the WhatsApp bridge component. Systems running nanobot without the WhatsApp bridge enabled, or systems running version 0.1.5.post4 or later, are not vulnerable. The impact scope depends on the privilege level of the process running nanobot and the sensitivity of files accessible from the process's working directory.

Exploitability

The vulnerability is network-accessible and requires no prior authentication or user interaction beyond the normal operation of receiving a WhatsApp message. However, the attacker must know or guess plausible filesystem paths on the target system to write files successfully. The attack vector has medium operational complexity (AC:H in CVSS terms), as it requires some reconnaissance or knowledge of the target environment. The CVSS 3.1 score of 8.7 (HIGH) reflects the high impact to integrity and availability, combined with network accessibility and no authentication requirement.

Remediation

Upgrade nanobot to version 0.1.5.post4 or later, which includes a fix for path traversal in the WhatsApp bridge. Organizations unable to upgrade immediately should consider disabling the WhatsApp bridge or restricting WhatsApp message sources to trusted contacts only. Implement file system monitoring and access controls to limit the directories writable by the nanobot process. Run the nanobot process with minimal necessary privileges (principle of least privilege).

Patch guidance

A fix is planned for version 0.1.5.post4. Apply this update as soon as it becomes available. Verify with the nanobot project's release notes or security advisories that the update addresses CVE-2026-48716. Test in a non-production environment before deploying to production to ensure compatibility with your deployment. If you are currently on version 0.1.5.post3 or earlier, prioritize this update.

Detection guidance

Monitor the host system for unexpected file creation or modification in sensitive directories, particularly .ssh/, /etc/, or configuration directories. Log WhatsApp messages received by nanobot's bridge and look for fileName fields containing path traversal sequences such as `../`, `..\`, or percent-encoded equivalents like `%2e%2e`. Implement file integrity monitoring on critical system files to detect unauthorized modifications. Check system logs and process audit trails for file write operations originating from the nanobot process to unexpected locations.

Why prioritize this

This vulnerability merits immediate attention because it enables arbitrary file writes on the host system without authentication, affecting both integrity and availability. The lack of exploitation complexity and network accessibility make it a practical risk for any organization deploying nanobot with WhatsApp bridge enabled. The potential for privilege escalation or system compromise justifies treating this as a high-priority patch. The planned fix in version 0.1.5.post4 is available, making remediation straightforward.

Risk score, explained

The CVSS 3.1 score of 8.7 (HIGH) is driven by: (1) Network vector (AV:N) — the attack is remotely exploitable via WhatsApp; (2) No authentication requirement (PR:N); (3) High impact to integrity (I:H) and availability (A:H) — arbitrary file writes can corrupt or disable system functionality; (4) Changed scope (S:C) — the vulnerability can affect resources beyond the vulnerable component itself; (5) Medium attack complexity (AC:H) — successful exploitation requires some knowledge of the target filesystem. The combination of remote exploitability, no user interaction, and high impact justifies the HIGH severity rating.

Frequently asked questions

Does nanobot with WhatsApp bridge enabled automatically expose this vulnerability to all WhatsApp users?

Yes, if the WhatsApp bridge is active, any WhatsApp contact who knows the person using nanobot can send a crafted document to potentially exploit this vulnerability. No special permissions or prior relationship is required on WhatsApp itself; the attacker simply needs to send a message with a malicious filename.

What files are most at risk if an attacker exploits this vulnerability?

Files in sensitive locations are at highest risk, including SSH keys (.ssh/authorized_keys), application configuration files, credentials, system binaries, or any file in a directory where the nanobot process has write access. The exact risk depends on the process's privilege level and the directory permissions of the host system.

Is there a workaround if I cannot upgrade to version 0.1.5.post4 immediately?

Temporarily disable the WhatsApp bridge until you can upgrade. Alternatively, restrict the nanobot process to a dedicated, unprivileged system user with minimal filesystem permissions, and implement strict firewall or network rules limiting WhatsApp access. However, disabling the feature is the safest interim measure.

How can I verify if my nanobot installation is vulnerable?

Check the installed version using the nanobot version command or checking package metadata. If you are running version 0.1.5.post3 or earlier and the WhatsApp bridge is enabled (check your configuration files for bridge/whatsapp settings), your system is vulnerable. Review your deployment logs for any suspicious WhatsApp document messages with path traversal characters.

This analysis is provided for informational purposes and reflects the vulnerability details as of the publication date. Organizations must verify all patch version numbers, availability dates, and compatibility against official vendor advisories and release notes. The severity and exploitability of this vulnerability may vary depending on deployment configuration, privilege levels, and network isolation. No exploit code or detailed weaponization instructions are provided. Always test patches in non-production environments before deployment. This information does not constitute professional security advice; consult with your security team and the nanobot project maintainers for your specific deployment context. Source: NVD (public-domain), retrieved 2026-07-27. Analysis generated by SEC.co (claude-haiku-4-5).