Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in ZMarkdownGHSA-2c83-wfv3-q25f
GHSA-2c83-wfv3-q25f is a security vulnerability in rebber. A fix is available for rebber — see the affected versions and patch details below.
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
rebbernpmDescription
Impact
A Remote Command Execution vulnerability was found in the rebber module, which allowed execution of arbitrary commands. The reported problem came from CodeBlocks, which could be escaped to insert malicious LaTeX.
Anyone using rebber without sanitation of code content or a custom
macro is impacted by this vulnerability. Here is an example of a Markdown
content that will exploit the vulnerability:
```
\end{CodeBlock}
\immediate\write18{COMMAND > outputrce}
\input{outputrce}
\begin{CodeBlock}{text}
```
Will insert into the generated LaTeX the result of executing
COMMAND on the system.
Patches
The vulnerability has been patched in version 5.2.1. If impacted, you should update to this version as soon as possible.
Workarounds
It is possible to mitigate the vulnerability without upgrading by using a custom code macro. Please make sure this custom macro escapes your closing LaTeX sequence. For the example above, use:
const escaped = content.replace(new RegExp('\\\\end\\s*{CodeBlock}', 'g'), '')
For more information
If you have any questions or comments about this advisory, open an issue in ZMarkdown.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | rebber | all versions | 5.2.1npm install rebber@5.2.1 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for rebber, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update rebber to 5.2.1 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-2c83-wfv3-q25f is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
Frequently Asked Questions
Is GHSA-2c83-wfv3-q25f in your dependencies?
Find it across npm, including transitive dependencies.