CVE-2019-10791: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') (CWE-78)
value: promise-probe before 0.10.0 allows remote attackers to perform a command injection attack. The file, outputFile and options functions can be controlled by users without any sanitization.
CWE description: The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.
CVSS v3 base score: 9.8
Published: 2020-02-18T17:15Z
Repository: https://github.com/dottgonzo/node-promise-probe
Language: JavaScript
Files changed: index.js, index.js.map, index.ts
Commit date: 2020-02-05 23:09:27 +0100
Commit message: resolve vulnerability

Diff: diff --git a/index.js b/index.js
index 25234f9..75ca412 100644
--- a/index.js
+++ b/index.js
@@ -5,11 +5,11 @@ function ffprobe(file) {
     return new Promise((resolve, reject) => {
         if (!file)
             throw new Error('no file provided');
         fs_1.stat(file, (err, stats) => {
             if (err)
-                throw err;
+                return reject(new Error('wrong file provided'));
             child_process_1.exec('ffprobe -v quiet -print_format json -show_format -show_streams ' + file, (error, stdout, stderr) => {
                 if (error)
                     return reject(error);
                 if (!stdout)
                     return reject(new Error("can't probe file " + file));
@@ -32,10 +32,16 @@ function ffprobe(file) {
     });
 }
 exports.ffprobe = ffprobe;
 function createMuteOgg(outputFile, options) {
     return new Promise((resolve, reject) => {
+        if (!outputFile || !options || !options.seconds || !options.sampleRate || !options.numOfChannels)
+            return reject(new Error('malformed props to createMuteOgg'));
+        if (!Number.isInteger(options.seconds) ||
+            !Number.isInteger(options.sampleRate) ||
+            !Number.isInteger(options.numOfChannels))
+            return reject(new Error('malformed numerico options prop for createMuteOgg'));
         const ch = options.numOfChannels === 1 ? 'mono' : 'stereo';
         child_process_1.exec('ffmpeg -f lavfi -i anullsrc=r=' +
             options.sampleRate +
             ':cl=' +
             ch +
diff --git a/index.js.map b/index.js.map
index 7fe478d..06eabf1 100644
--- a/index.js.map
+++ b/index.js.map
@@ -1 +1 @@
-{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":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exec } from 'child_process'
 import { stat } from 'fs'
+import { reject } from 'bluebird'
 
 export interface IFFFormat {
   filename: string
   nb_streams: number
   nb_programs: number
@@ -114,11 +115,11 @@ export interface IFfprobe {
 export function ffprobe(file: string): Promise<IFfprobe> {
   return new Promise<IFfprobe>((resolve, reject) => {
     if (!file) throw new Error('no file provided')
 
     stat(file, (err, stats) => {
-      if (err) throw err
+      if (err) return reject(new Error('wrong file provided'))
 
       exec('ffprobe -v quiet -print_format json -show_format -show_streams ' + file, (error, stdout, stderr) => {
         if (error) return reject(error)
         if (!stdout) return reject(new Error("can't probe file " + file))
 
@@ -144,10 +145,20 @@ export function ffprobe(file: string): Promise<IFfprobe> {
 export function createMuteOgg(
   outputFile: string,
   options: { seconds: number; sampleRate: number; numOfChannels: number }
 ) {
   return new Promise<true>((resolve, reject) => {
+    if (!outputFile || !options || !options.seconds || !options.sampleRate || !options.numOfChannels)
+      return reject(new Error('malformed props to createMuteOgg'))
+
+    if (
+      !Number.isInteger(options.seconds) ||
+      !Number.isInteger(options.sampleRate) ||
+      !Number.isInteger(options.numOfChannels)
+    )
+      return reject(new Error('malformed numerico options prop for createMuteOgg'))
+
     const ch = options.numOfChannels === 1 ? 'mono' : 'stereo'
 
     exec(
       'ffmpeg -f lavfi -i anullsrc=r=' +
         options.sampleRate +

Vulnerable code:                 throw err;
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA,iDAAoC;AACpC,2BAAyB;AAgHzB,iBAAwB,IAAY;IAClC,OAAO,IAAI,OAAO,CAAW,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC/C,IAAI,CAAC,IAAI;YAAE,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAA;QAE9C,SAAI,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;YACxB,IAAI,GAAG;gBAAE,MAAM,GAAG,CAAA;YAElB,oBAAI,CAAC,iEAAiE,GAAG,IAAI,EAAE,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AE1D,oBAAI,CACF,gCAAgC;YAC9B,OAAO,CAAC,UAAU;YAClB,MAAM;YACN,EAAE;YACF,MAAM;YACN,OAAO,CAAC,OAAO;YACf,kBAAkB;YAClB,UAAU,EACZ,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;YACxB,IAAI,KAAK;gBAAE,OAAO,MAAM,CAAC,KAAK,CAAC,CAAA;YAG/B,OAAO,CAAC,IAAI,CAAC,CAAA;QACf,CAAC,CACF,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC;AAxBD,sCAwBC;AAED,yBAAgC,SAAiB,EAAE,UAAkB,EAAE,OAAgB;IACrF,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC3C,OAAO,CAAC,SAAS,CAAC;aACf,IAAI,CAAC,MAAM,CAAC,EAAE;YACb,IAAI,CAAC,OAAO;gBAAE,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;YACxD,aAAa,CAAC,UAAU,EAAE;gBACxB,OAAO,EAAE,OAAO;gBAChB,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC;gBAC9C,aAAa,EAAE,MAAM,CAAC,KAAK,CAAC,QAAQ;aACrC,CAAC;iBACC,IAAI,CAAC,GAAG,EAAE;gBACT,OAAO,CAAC,IAAI,CAAC,CAAA;YACf,CAAC,CAAC;iBACD,KAAK,CAAC,GAAG,CAAC,EAAE;gBACX,MAAM,CAAC,GAAG,CAAC,CAAA;YACb,CAAC,CAAC,CAAA;QACN,CAAC,CAAC;aACD,KAAK,CAAC,GAAG,CAAC,EAAE;YACX,MAAM,CAAC,GAAG,CAAC,CAAA;QACb,CAAC,CAAC,CAAA;IACN,CAAC,CAAC,CAAA;AACJ,CAAC;AArBD,0CAqBC"}
      if (err) throw err
Fixed code:                 return reject(new Error('wrong file provided'));
        if (!outputFile || !options || !options.seconds || !options.sampleRate || !options.numOfChannels)
            return reject(new Error('malformed props to createMuteOgg'));
        if (!Number.isInteger(options.seconds) ||
            !Number.isInteger(options.sampleRate) ||
            !Number.isInteger(options.numOfChannels))
            return reject(new Error('malformed numerico options prop for createMuteOgg'));
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA,iDAAoC;AACpC,2BAAyB;AAiHzB,iBAAwB,IAAY;IAClC,OAAO,IAAI,OAAO,CAAW,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC/C,IAAI,CAAC,IAAI;YAAE,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAA;QAE9C,SAAI,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;YACxB,IAAI,GAAG;gBAAE,OAAO,MAAM,CAAC,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC,CAAA;YAExD,oBAAI,CAAC,iEAAiE,GAAG,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;gBACvG,IAAI,KAAK;oBAAE,OAAO,MAAM,CAAC,KAAK,CAAC,CAAA;gBAC/B,IAAI,CAAC,MAAM;oBAAE,OAAO,MAAM,CAAC,IAAI,KAAK,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAAC,CAAA;gBAEjE,IAAI,QAAkB,CAAA;gBAEtB,IAAI;oBACF,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;iBAC9B;gBAAC,OAAO,GAAG,EAAE;oBACZ,OAAO,MAAM,CAAC,GAAG,CAAC,CAAA;iBACnB;gBAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;oBAChD,IAAI,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,UAAU,KAAK,OAAO;wBAAE,QAAQ,CAAC,KAAK,GAAG,QAA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,MAAM,EAAE,EAAE;YACxB,IAAI,KAAK;gBAAE,OAAO,MAAM,CAAC,KAAK,CAAC,CAAA;YAG/B,OAAO,CAAC,IAAI,CAAC,CAAA;QACf,CAAC,CACF,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC;AAlCD,sCAkCC;AAED,yBAAgC,SAAiB,EAAE,UAAkB,EAAE,OAAgB;IACrF,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC3C,OAAO,CAAC,SAAS,CAAC;aACf,IAAI,CAAC,MAAM,CAAC,EAAE;YACb,IAAI,CAAC,OAAO;gBAAE,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;YACxD,aAAa,CAAC,UAAU,EAAE;gBACxB,OAAO,EAAE,OAAO;gBAChB,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC;gBAC9C,aAAa,EAAE,MAAM,CAAC,KAAK,CAAC,QAAQ;aACrC,CAAC;iBACC,IAAI,CAAC,GAAG,EAAE;gBACT,OAAO,CAAC,IAAI,CAAC,CAAA;YACf,CAAC,CAAC;iBACD,KAAK,CAAC,GAAG,CAAC,EAAE;gBACX,MAAM,CAAC,GAAG,CAAC,CAAA;YACb,CAAC,CAAC,CAAA;QACN,CAAC,CAAC;aACD,KAAK,CAAC,GAAG,CAAC,EAAE;YACX,MAAM,CAAC,GAAG,CAAC,CAAA;QACb,CAAC,CAAC,CAAA;IACN,CAAC,CAAC,CAAA;AACJ,CAAC;AArBD,0CAqBC"}
import { reject } from 'bluebird'
      if (err) return reject(new Error('wrong file provided'))
    if (!outputFile || !options || !options.seconds || !options.sampleRate || !options.numOfChannels)
      return reject(new Error('malformed props to createMuteOgg'))

    if (
      !Number.isInteger(options.seconds) ||
      !Number.isInteger(options.sampleRate) ||
      !Number.isInteger(options.numOfChannels)
    )
      return reject(new Error('malformed numerico options prop for createMuteOgg'))