Skip to content
MediumVulnerability

GHSA-48x2-6pr9-2jjf: Network-AI: EnvironmentManager.restore() backup ID path traversal copies arbitrary directories into environment data

Published
Record updated
View JSON
Affected
  • network-ai <= 5.12.1
Fixed in
5.12.2
  • released June 18, 2026, 1 day before disclosure

Summary

Network-AI's EnvironmentManager.restore(env, backupId) builds the backup path from the caller-supplied backupId and checks only that the path exists, with no resolved containment check. A traversal ID such as ../../../outside/source-dir copies files from an arbitrary directory into data/<env>, reachable by default through network-ai env backup restore --env <env> --backup <id>. Confirmed in Network-AI 5.12.1; no RCE chain was confirmed.

Mitigation

Fixed in v5.12.2 (commit a59c13a). restore() now validates backupId against /^[\w\-]+$/ and asserts that dirname(resolve(join(backupsDir, backupId))) equals resolve(backupsDir) before touching the filesystem, so IDs containing path separators or .. are rejected. Install with npm install network-ai@5.12.2.