CVE-2019-10787:
OS Command Injection in im-resize
9.8
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.86815%
CWE
Published
4/13/2021
Updated
2/1/2023
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
im-resize | npm | <= 2.3.2 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from the main exported function in index.js that:
- Takes user-controlled 'image' input
- Builds a command string (cmd) using this input
- Passes it directly to exec() without sanitization
- The commit diff shows they later added input validation regex checks for special characters, confirming the original lack of sanitization
- CWE-78 classification directly matches unsanitized OS command execution patterns
- Multiple sources confirm the 'cmd' argument was user-controlled and unsanitized