/

CVE-2026-120313

Severity:

HIGH RISK

(7.5)

Path Traversal (CWE-22) in Network-AI InputSanitizer

CVE-2026-120313

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Unauthorized file access outside the intended directory

Severity:

HIGH RISK

(7.5)

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 InputSanitizer.sanitizePath() can incorrectly accept paths that share a string prefix with the intended base directory. If an attacker can provide a path to this check, they may be able to read, list, or write files outside the sandbox.

Affected context

The issue occurs in path validation performed by InputSanitizer.sanitizePath(). It becomes risky when attacker-controlled paths are checked against a sandbox directory using an unanchored string-prefix test, rather than verifying that the normalized path is actually contained within the base directory. The available description identifies Network-AI versions before 5.15.5 as affected.

Exploit preconditions

  • Attack surface: A Network-AI feature or interface that accepts paths and passes them to InputSanitizer.sanitizePath()
  • Required access: Ability to submit or influence a path; authentication requirements depend on the interface and deployment
  • Trigger point: Path validation before a file is read, listed, or written
  • Why exploitation is possible: A sibling-directory path can share the base directory's string prefix and pass an unanchored startsWith check despite being outside the intended directory

Why this happens

The underlying bug is improper path containment validation, mapped to CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'). A string-prefix comparison does not establish directory ancestry: a path in a sibling directory may begin with the same characters as the permitted base path. Validation should account for normalized path components and confirm containment using path-aware operations.

Potential impact

  • An attacker may read files outside the sandbox, subject to the process's permissions.
  • An attacker could list directory contents beyond the intended boundary.
  • An attacker may write or modify files outside the sandbox if the process has write access.
  • Exposure or alteration of accessible files could affect application confidentiality or integrity.

General mitigation guidance

Defensive patterns focus on enforcing directory containment with filesystem-aware checks rather than raw string-prefix comparisons.

  • Normalize and resolve candidate paths, then verify they remain within the intended base using component-aware path operations.
  • Prefer APIs that accept a trusted directory handle or otherwise constrain file access to an approved root.
  • Apply allowlists for expected paths where practical, and treat user-supplied path components as untrusted.
  • Account for symbolic links and filesystem changes when designing containment checks.
  • Run the application with least-privilege filesystem permissions so a path-validation failure has limited impact.

How teams detect issues like this

  • Use static analysis to flag path validation based on raw startsWith or similar string-prefix comparisons.
  • Review file-access flows for user-controlled paths and check whether validation occurs before reads, listings, and writes.
  • Add tests for sibling directories with names sharing a prefix with the permitted base, as well as normalized paths and symbolic-link cases.
  • Enforce code-review or CI policies requiring path-aware containment checks for sandboxed file operations.

Sources

SourceLink
github.comgithub.com/Jovancoding/Network-AI/security/advisories/GHSA-5mm5-4mh4-6gm6
vulncheck.comvulncheck.com/advisories/network-ai-before-5.15.5-path-traversal-via-inputsanitizer-sanitizepath

Frequently asked

questions

It may let a user-supplied path reach files outside the intended sandbox, enabling reads, listings, or writes depending on the operation and process permissions.

The description does not establish a specific authentication requirement. Exploitation requires access to a feature or interface that accepts a path processed by the vulnerable sanitizer.

Use normalized, filesystem-aware path containment checks that verify directory-component boundaries, rather than relying on a string-prefix comparison.

Treat supplied paths as untrusted, test sibling-prefix and symbolic-link cases, review file-access code for unsafe string checks, and limit the process's filesystem privileges.

Find out what's already
exploitable in your codebase.