CVE-2023-40582
JSON

9.8critical

Command Injection Vulnerability in find-exec

Severity
9.8critical CVSS:3.1 by GitHub_M
Exploit likelihood
1.80% (higher than 79% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-95rp-6gqp-6622

Description

find-exec is a utility to discover available shell commands. Versions prior to 1.0.3 did not properly escape user input and are vulnerable to Command Injection via an attacker controlled parameter. As a result, attackers may run malicious shell commands in the context of the running process. This issue has been addressed in version 1.0.3. users are advised to upgrade. Users unable to upgrade should ensure that all input passed to find-exec comes from a trusted source.

Affected

Product or packageVersionsReported by
shime find-exec< 1.0.3CVE List
find-exec (npm)before 1.0.3GitHub Advisory Database
find-exec_project find-execbefore 1.0.3NVD

All scores

GitHub_M9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
GitHub9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
NVD9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Classification

CWE-78

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact total.

What each source says

CVE List

find-exec is a utility to discover available shell commands. Versions prior to 1.0.3 did not properly escape user input and are vulnerable to Command Injection via an attacker controlled parameter. As a result, attackers may run malicious shell commands in the context of the running process. This issue has been addressed in version 1.0.3. users are advised to upgrade. Users unable to upgrade should ensure that all input passed to find-exec comes from a trusted source.

GitHub Advisory Database

Older versions of the package are vulnerable to Command Injection as an attacker controlled parameter. As a result, attackers may run malicious commands.

For example:

const find = require("find-exec");
find("mplayer; touch hacked")

This creates a file named "hacked" on the filesystem.

You should never allow users to control commands to find, since this package attempts to run every command provided.

Thanks to @miguelafmonteiro for reporting.

NVD (es)

find-exec es una utilidad para descubrir comandos de shell disponibles. Las versiones anteriores a la 1.0.3 no escapaban correctamente la entrada del usuario y son vulnerables a la inyección de comandos a través de un parámetro controlado por un atacante. Como resultado, los atacantes pueden ejecutar comandos de shell maliciosos en el contexto del proceso en ejecución. Este problema ha sido abordado en la versión 1.0.3. Se aconseja a los usuarios actualizar. Los usuarios que no puedan actualizar deben asegurarse de que toda la entrada pasada a find-exec provenga de una fuente confiable.

References

Sources

SourceRecordLicence
CVE ListCVE-2023-40582 changed 2024-10-01CVE Terms of Use
GitHub Advisory DatabaseGHSA-95rp-6gqp-6622 changed 2023-11-08CC-BY-4.0
NVDCVE-2023-40582 changed 2026-06-17Public domain