Skip to content
RCE Disclosed report Intermediate CVE-2020-7613

Clamscan vulnerable to command injection

The clamscan npm package passes a folder name into a shell command without sanitising it, so a crafted folder name can run extra commands. An attacker who can create a folder with a specific name could execute arbitrary commands on the host.

kylefarris/clamscan

Originally disclosed on huntr

clamscan through 1.2.0 is vulnerable to Command Injection. It is possible to inject arbitrary commands as part of the _is_clamav_binary function located within Index.js. It should be noted that this vulnerability requires a pre-requisite that a folder should be created with the same command that will be chained to execute. This lowers the risk of this issue.

From the GitHub Advisory Database (GHSA-5v25-xr56-phph, CC BY 4.0).

The original report as published on the GitHub Advisory Database. Images and videos are our own copies; raw HTML is shown as text. View it on GitHub Advisory Database.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Impact

An attacker who can create a folder with a crafted name could run arbitrary commands, though the advisory says the need for that folder lowers the risk.

What the attacker needed

Ability to create a folder with a crafted name

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

This is a command injection bug. The program builds a shell command using a folder name, and if that name contains special shell characters, the shell runs extra commands. The attacker needs to be able to create a folder with a carefully chosen name first.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.