CVE-2026-139887: nanocoai NanoClaw improper condition check in readEnvFile

CVE-2026-139887 · Severity: medium · CVSS 5.3 · Published 2026-12-01

NanoClaw is a self-hosted AI assistant that can be configured with egress lockdown to restrict network access. A flaw in the readEnvFile function fails to properly handle unreadable configuration files, causing the system to silently disable network restrictions and allow agents unrestricted internet access, potentially leading to data exfiltration and bypass of security controls.

Quick answers

Is CVE-2026-139887 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-139887 being exploited in the wild.
How severe is CVE-2026-139887?
Medium severity, with a CVSS score of 5.3, published 1 December 2026.
Which products and versions are affected?
Nanocoai NanoClaw up to 2026.11.0.
Is there a fix for CVE-2026-139887?
No fixed version is recorded yet. Monitor for unreadable .env files and restart the NanoClaw service when file permissions are changed unexpectedly. Restrict write access to the .env file and its parent directory to authorized users only. If you run it, Junglewise drafts a mitigation that fits your setup and applies it once you approve, with senior security engineers behind it.
How is CVE-2026-139887 attacked?
It is attacked with local access.
Am I affected by CVE-2026-139887?
Check whether you run Nanocoai NanoClaw at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

Monitor for unreadable .env files and restart the NanoClaw service when file permissions are changed unexpectedly. Restrict write access to the .env file and its parent directory to authorized users only.

Technical details

The readEnvFile() function in src/env.ts catches all file read errors and returns an empty object, treating an unreadable existing .env file the same as a missing one. When NANOCLAW_EGRESS_LOCKDOWN is configured, this causes the egress policy to evaluate as false, bypassing the intended network confinement and allowing agents to reach arbitrary internet hosts. A local attacker with write or permission-change access to the .env file can trigger this condition to escape the credential gateway.

Affected products

  • nanocoai NanoClaw up to 2026.11.0

Timeline

  • 2026-12-01: disclosed
  • 2026-11-09: other: Fix pull request submitted

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.