network-ai

GHSA-48X2-6PR9-2JJF

GHSA-48X2-6PR9-2JJF is a medium-severity path traversal vulnerability in network-ai (npm), affecting versions <= 5.12.1. It is fixed in 5.12.2.

Key facts
CVSS score
6.1
Medium
Attack vector
Local
Issuing authority
GitHub Advisory Database
Affected package
network-ai
Fixed in
5.12.2
Disclosed
Not available

Summary

Summary 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. Confirmed in Network-AI 5.12.1. Details restore() builds backupPath directly from caller-controlled backupId: There is no resolved containment check that ensures backupPath remains under backupsDir. Default CLI reachability exists through network-ai env backup restore --env <env> --backup <id>. Affected source evidence: lib/env-manager.ts:474-499, vulnerable restore path construction and copy. bin/cli.ts:441-458, default CLI exposes restore with caller-controlled --backup. PoC This PoC uses only temporary directories and restores trust_levels.json from an external directory into data/dev: Observed result includes backupId: "../../../outside/secret-src", filesRestored: 1, and restored content {"leaked":true}. Impact A caller that can invoke backup restore can copy arbitrary readable directories into data/<env>, subject to process filesystem permissions. This can stage sensitive files into environment data/backup locations, overwrite environment configuration files if matching filenames exist, and break environment isolation. No RCE chain was confirmed. Resolution (maintainer) Fixed in v5.12.2 (commit a59c13a). Install: npm install [email protected], published to npm with provenance. 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. All 3,269 tests pass against the patched build. Thanks to @sondt99 for the responsible disclosure.

Impact

What is path traversal?

Input manipulates file paths to reach files outside the intended directory, such as configuration or credential files. Typical impact: unauthorized file read or write outside the intended directory.

Severity and exposure

GHSA-48X2-6PR9-2JJF has a CVSS score of 6.1 (Medium). The vector is requires local access, low privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment.

A fixed version is available (5.12.2). Upgrading removes the vulnerable code path.

Affected versions

npm

  • network-ai (<= 5.12.1)

Security releases

  • network-ai → 5.12.2 (npm)
Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter instead of chasing every advisory.

Kodem's runtime-powered SCA identifies whether GHSA-48X2-6PR9-2JJF is reachable in your applications. Explore open-source security for your team.

See if GHSA-48X2-6PR9-2JJF is reachable in your applications. Get a demo

Already deployed Kodem? See GHSA-48X2-6PR9-2JJF in your environment

Remediation advice

Upgrade network-ai to 5.12.2 or later to resolve this vulnerability.

Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.

Frequently asked questions about GHSA-48X2-6PR9-2JJF

What is GHSA-48X2-6PR9-2JJF?

GHSA-48X2-6PR9-2JJF is a medium-severity path traversal vulnerability in network-ai (npm), affecting versions <= 5.12.1. It is fixed in 5.12.2. Input manipulates file paths to reach files outside the intended directory, such as configuration or credential files.

How severe is GHSA-48X2-6PR9-2JJF?

GHSA-48X2-6PR9-2JJF has a CVSS score of 6.1 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.

Which versions of network-ai are affected by GHSA-48X2-6PR9-2JJF?

network-ai (npm) versions <= 5.12.1 is affected.

Is there a fix for GHSA-48X2-6PR9-2JJF?

Yes. GHSA-48X2-6PR9-2JJF is fixed in 5.12.2. Upgrade to this version or later.

Is GHSA-48X2-6PR9-2JJF exploitable, and should I be worried?

Whether GHSA-48X2-6PR9-2JJF is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo

What actually determines whether GHSA-48X2-6PR9-2JJF is exploitable, and how bad it is?

Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.

How do I fix GHSA-48X2-6PR9-2JJF?

Upgrade network-ai to 5.12.2 or later.

Stop the waste.
Protect your environment with Kodem.