{"url":"http://public2.vulnerablecode.io/api/packages/502335?format=json","purl":"pkg:npm/rebber@0.0.13","type":"npm","namespace":"","name":"rebber","version":"0.0.13","qualifiers":{},"subpath":"","is_vulnerable":true,"next_non_vulnerable_version":"5.2.1","latest_non_vulnerable_version":"5.2.1","affected_by_vulnerabilities":[{"url":"http://public2.vulnerablecode.io/api/vulnerabilities/42473?format=json","vulnerability_id":"VCID-2ets-6ffc-rfh5","summary":"Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in ZMarkdown\n### Impact\n\nA Remote Command Execution vulnerability was found in the rebber module,\nwhich allowed execution of arbitrary commands. The reported problem came\nfrom CodeBlocks, which could be escaped to insert malicious LaTeX.\n\nAnyone using `rebber` without sanitation of code content or a custom\nmacro is impacted by this vulnerability. Here is an example of a Markdown\ncontent that will exploit the vulnerability:\n\n````markdown\n```\n\\end{CodeBlock}\n\n\\immediate\\write18{COMMAND > outputrce}\n\\input{outputrce}\n\n\\begin{CodeBlock}{text}\n```\n````\n\nWill insert into the generated LaTeX the result of executing\n`COMMAND` on the system.\n\n### Patches\n\nThe vulnerability has been patched in version 5.2.1.\nIf impacted, you should update to this version as soon as possible.\n\n### Workarounds\n\nIt is possible to mitigate the vulnerability without upgrading by using a\ncustom code macro. Please make sure this custom macro escapes your\nclosing LaTeX sequence. For the example above, use:\n\n```javascript\nconst escaped = content.replace(new RegExp('\\\\\\\\end\\\\s*{CodeBlock}', 'g'), '')\n```\n\n### For more information\n\nIf you have any questions or comments about this advisory, open an issue in [ZMarkdown](https://github.com/zestedesavoir/zmarkdown/issues).","references":[{"reference_url":"https://github.com/zestedesavoir/zmarkdown","reference_id":"","reference_type":"","scores":[{"value":"CRITICAL","scoring_system":"generic_textual","scoring_elements":""}],"url":"https://github.com/zestedesavoir/zmarkdown"},{"reference_url":"https://github.com/zestedesavoir/zmarkdown/security/advisories/GHSA-2c83-wfv3-q25f","reference_id":"","reference_type":"","scores":[{"value":"CRITICAL","scoring_system":"generic_textual","scoring_elements":""}],"url":"https://github.com/zestedesavoir/zmarkdown/security/advisories/GHSA-2c83-wfv3-q25f"},{"reference_url":"https://github.com/advisories/GHSA-2c83-wfv3-q25f","reference_id":"GHSA-2c83-wfv3-q25f","reference_type":"","scores":[],"url":"https://github.com/advisories/GHSA-2c83-wfv3-q25f"}],"fixed_packages":[{"url":"http://public2.vulnerablecode.io/api/packages/76622?format=json","purl":"pkg:npm/rebber@5.2.1","is_vulnerable":false,"affected_by_vulnerabilities":[],"resource_url":"http://public2.vulnerablecode.io/packages/pkg:npm/rebber@5.2.1"}],"aliases":["GHSA-2c83-wfv3-q25f","GMS-2021-41"],"risk_score":null,"exploitability":null,"weighted_severity":null,"resource_url":"http://public2.vulnerablecode.io/vulnerabilities/VCID-2ets-6ffc-rfh5"}],"fixing_vulnerabilities":[],"risk_score":null,"resource_url":"http://public2.vulnerablecode.io/packages/pkg:npm/rebber@0.0.13"}