Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate pid before calling #1

Merged
merged 1 commit into from May 9, 2022

Conversation

EvanHahn
Copy link
Contributor

@EvanHahn EvanHahn commented May 5, 2021

getProcessLimits calls child_process.exec with the pid. Here's the relevant line:

cp.exec("cat /proc/" + pid + "/limits", function (err, stdout, stderr) {

A malicious argument could cause trouble. For example, passing an argument of '; rm -rf / #' would run the following command:

cat /proc/; rm -rf / #/limits

This minimal change validates the pid argument before continuing.

`getProcessLimits` calls `child_process.exec` with the pid. Here's the
relevant line:

    cp.exec("cat /proc/" + pid + "/limits", function (err, stdout, stderr) {

A malicious argument could cause trouble. For example, passing an
argument of `'; rm -rf / #'` would run the following command:

    cat /proc/; rm -rf / #/limits

This minimal change validates the pid argument before continuing.
@timjrobinson timjrobinson merged commit 60c6aa3 into timjrobinson:master May 9, 2022
@EvanHahn EvanHahn deleted the validate-args branch May 9, 2022 12:04
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.

None yet

2 participants