/

CVE-2026-58484

Severity:

HIGH RISK

(7.1)

Path Traversal (CWE-22) in Network-AI Backup Pruning

CVE-2026-58484

Analyzed

Vulnerability type

Category:

Path Traversal / Insecure File Path Handling

CWE:

CWE-22, CWE-73

Impact:

Arbitrary File and Directory Deletion

Severity:

HIGH RISK

(7.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Network-AI's backup pruning logic previously trusted a path field from on-disk backup manifests and passed it directly to a recursive delete operation.

If an attacker can create or modify _manifest.json files within the backups directory, they can cause env backup prune to recursively delete arbitrary files and directories accessible to the Network-AI process.

Affected context

This vulnerability appears in Network-AI deployments where backup metadata is stored on disk under data/<env>/.backups/<name>/_manifest.json, and those manifests are later consumed by EnvironmentManager.listBackups() and EnvironmentManager.pruneBackups().

It is relevant in environments where backups may be accessible to other processes, plugins, or users that can write or modify manifest files.

The risk increases when Network-AI runs with broad filesystem permissions, especially on shared or multi-tenant systems.

Exploit preconditions

  • Attack surface: Backup manifest files located under data/<env>/.backups/<name>/_manifest.json
  • Required access: Ability to create, replace, or modify _manifest.json for one or more backups (local user, compromised plugin, or misconfigured permissions)
  • Trigger point: Execution of network-ai env backup prune --env <env> --keep <n> or any code path that calls EnvironmentManager.pruneBackups()
  • Why exploitation is possible: The path field from the manifest is treated as trusted and passed directly into rmSync(entry.path, { recursive: true, force: true }) without validation or containment checks, enabling deletion outside the intended backup directory.

Why this happens

The core issue is blind trust in file system metadata sourced from on-disk JSON manifests.

EnvironmentManager.listBackups() reads _manifest.json and treats the manifest's path as authoritative, passing it unchanged to EnvironmentManager.pruneBackups(), which invokes rmSync() with recursive and force options.

This behavior exemplifies CWE-22: Improper Limitation of a Path to a Restricted Directory, combined with CWE-73: External Control of File Name or Path, because an attacker can control the path string in the manifest and cause operations intended for a restricted backup directory to target arbitrary locations on the filesystem.

Potential impact

  • Recursive deletion of arbitrary directories accessible to the Network-AI process user
  • Loss of application data, configuration, or logs stored outside the backup directory
  • Destruction of other services' data on shared hosts, depending on filesystem layout and permissions
  • Potential denial-of-service by deleting critical runtime files or directories

General mitigation guidance

Effective mitigation focuses on constraining file operations to trusted directories and deriving paths from validated identifiers rather than untrusted metadata.

Pattern-based defenses include:

  • Recomputing filesystem paths from canonical, validated IDs (such as backupId) rather than trusting serialized path fields.
  • Enforcing strict containment checks (e.g., verifying that target paths are direct descendants of the expected backups root and rejecting any that escape via absolute paths or .. segments).
  • Applying normalization to paths before use and comparing against a known-safe base directory to detect traversal attempts.
  • Running the Network-AI service under an account with least privilege, limiting its ability to delete or modify directories outside its own data hierarchy.
  • Avoiding force and broad recursive deletion of paths derived from external or user-controlled inputs unless guardrails and validation are in place.

How teams detect issues like this

Organizations can detect similar path-based vulnerabilities by:

  • Using static analysis rules to flag uses of file APIs like rmSync, fs.rm, or fs.unlink where the path originates from configuration files, manifests, or other external inputs without validation.
  • Employing code review checklists that highlight any use of user-controlled paths in recursive delete or move operations, and verifying containment logic around base directories.
  • Implementing application-level assertions or logging that record deletion targets, then monitoring for anomalies such as deletions outside the backups directory.
  • Incorporating automated security testing tools that exercise backup and restore flows with crafted manifests to validate that access is confined to expected directories.

Sources

SourceLink
github.comgithub.com/Jovancoding/Network-AI/commit/a59c13a1f0ce0e8a0779a90343eef92fac5ab4c3
github.comgithub.com/Jovancoding/Network-AI/releases/tag/v5.12.2
github.comgithub.com/Jovancoding/Network-AI/security/advisories/GHSA-2fmp-9rvw-hc96

Frequently asked

questions

It can be, depending on how backup manifests are managed. If remote users, plugins, or services can write to data/<env>/.backups/<name>/_manifest.json, they may remotely trigger arbitrary deletions once pruneBackups() is invoked.

An attacker must be able to create or modify backup manifest files in the backups directory. This may correspond to local OS access, a compromised integration that writes manifests, or misconfigured filesystem permissions that allow unintended writes.

Derive deletion targets from trusted, validated identifiers (such as an internal backupId) and recompute the path server-side, then enforce strict containment checks to ensure operations occur only within a designated backups directory. Avoid using path values directly from on-disk or user-controlled metadata.

Treat all file paths originating from external sources as untrusted, normalize and validate them against known-safe base directories, and incorporate path validation patterns into coding standards and review processes. Combine this with least-privilege runtime accounts so that, even if a path validation bug exists, the blast radius of unintended file operations remains limited.

Find out what's already
exploitable in your codebase.