Skip to content

Fix arbitrary code execution vulnerability#33

Open
le2ni wants to merge 2 commits intoartiebits:masterfrom
le2ni:master
Open

Fix arbitrary code execution vulnerability#33
le2ni wants to merge 2 commits intoartiebits:masterfrom
le2ni:master

Conversation

@le2ni
Copy link
Copy Markdown

@le2ni le2ni commented Aug 31, 2024

Internally unix-print uses exec calls which are very easy to exploit.

e.g.

const file = "assets/file.pdf";
const userProvidedPrinterName = "&& user_provided_evil_command";
print(file, userProvidedPrinterName);

This was fixed by using execFile instead.

see https://nodejs.org/api/child_process.html#child_processexecfilefile-args-options-callback

le2ni added 2 commits August 31, 2024 12:03
`exec` is prone to command injection.
It was replaced by `execFile` which is more secure.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant