{"id":"GHSA-h746-qpxh-ph7g","summary":"laradocs  Command injection via unescaped Node.js binary path in KaTeX SSR","details":"### Summary\nLocal command injection (CWE-78) in server-side KaTeX rendering via an unescaped Node.js binary path in a `proc_open()` command string.\n\n### Affected versions\n\u003e= 0.4.0, \u003c 1.0.0\n\n### Patched versions\n\u003e= 1.0.0 (fixed in commit `100cb1e`)\n\n### Impact\nWhen rendering KaTeX math **server-side**, Laradocs invoked Node via `proc_open()` with a command string in which the Node binary argument was not passed through `escapeshellarg()`.\n\n`MarkdownPipelineFactory` constructs `KatexExtension` with the configured binary, which the render path resolved as:\n\n```php\n$node = $this-\u003enodeBin ?? 'node';\n$cmd = $node . ' ' . escapeshellarg($tmpFile) . ' ' . escapeshellarg($input);\n```\n\n`$this-\u003enodeBin` comes from `Config::nullableString('laradocs.parser.katex.node_bin')`. Both possible sources — the configured `node_bin` value, or the `'node'` default resolved from `PATH` — are operator-controlled. Neither is derived from untrusted request data or documentation content.\n\nThe vulnerable branch is reached only when server-side rendering is enabled. The default KaTeX path is client-side (browser-rendered via the configured `js`/`css` assets) and never calls `proc_open()`. SSR is opt-in via `laradocs.parser.katex.ssr`, which ships **disabled**.\n\n### Exploit scenario\nExploitation requires SSR to be turned on **and** an untrusted party to control `laradocs.parser.katex.node_bin` or the process `PATH` — a precondition that on its own already implies code execution on the host.\n\n### Severity\n**Low.** This is best treated as a hardening / defence-in-depth fix rather than a remotely exploitable RCE, since no untrusted input (request data, documentation content, or network input) reaches the vulnerable code path under normal operation.\n\n### Patch\nThe Node binary argument is now passed through `escapeshellarg()` like the other command components:\n\n```php\n$cmd = escapeshellarg($node) . ' ' . escapeshellarg($tmpFile) . ' ' . escapeshellarg($input);\n```\n\n### Credit\nReported via automated security scanning (Aikido).","aliases":["CVE-2026-65973"],"modified":"2026-11-25T19:45:03.992081221Z","published":"2026-11-25T19:41:53Z","database_specific":{"github_reviewed_at":"2026-11-25T19:41:53Z","nvd_published_at":"2026-11-11T21:16:46Z","cwe_ids":["CWE-78"],"severity":"MODERATE","github_reviewed":true},"references":[{"type":"WEB","url":"https://github.com/PeteBishwhip/laradocs/security/advisories/GHSA-h746-qpxh-ph7g"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-65973"},{"type":"WEB","url":"https://github.com/PeteBishwhip/laradocs/commit/100cb1e83920b8d3c9d8d53f98712df80df99435"},{"type":"PACKAGE","url":"https://github.com/PeteBishwhip/laradocs"},{"type":"WEB","url":"https://github.com/PeteBishwhip/laradocs/releases/tag/v1.0.0"}],"affected":[{"package":{"name":"petebishwhip/laradocs","ecosystem":"Packagist","purl":"pkg:composer/petebishwhip/laradocs"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0.4.0"},{"fixed":"1.0.0"}]}],"versions":["V0.5.1","v0.4.0","v0.5.0","v0.5.2","v0.5.3","v0.6.0","v0.6.1"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/11/GHSA-h746-qpxh-ph7g/GHSA-h746-qpxh-ph7g.json"}}],"schema_version":"1.9.2","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H"}]}