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

Privilege escalation using cputime parameter and runguard #39

Closed
myyxl opened this issue Nov 18, 2020 · 2 comments
Closed

Privilege escalation using cputime parameter and runguard #39

myyxl opened this issue Nov 18, 2020 · 2 comments

Comments

@myyxl
Copy link
Contributor

myyxl commented Nov 18, 2020

Hello,
i have found a bug that can lead to a privilege escalation.
Most of the input which the user can control is escaped using escapeshellarg but using the cputime parameter which is not escaped you can create a command injection which leads to a privilege escalation.
Here you can see that cputime is not escaped and is directly set into the sandox command which is executed by the user www-data.
Once you have access to the webroot you can patch runguard to accept root as a valid user and execute commands as root.
I have also a proof-of-concept script but I won't upload it here for security reasons.
If there are any further questions, I'll be happy to help.

Sincerely,
Marlon

@trampgeek
Copy link
Owner

Hi Marlon.

Many thanks for finding and reporting the vulnerability. Thanks for the fix, too, though I've chosen to run with a slight variant on your code. I've modified getParam so that if a supplied parameter is non-numeric and the default parameter is numeric, the default is used. Change pushed to github. Please confirm that my change addresses that issue (and any similar ones).

Thanks again

Richard

@myyxl
Copy link
Contributor Author

myyxl commented Nov 20, 2020

Hi Richard,
the fix you made works. Command Injections aren't possible anymore using the cputime parameter.
Thanks for the quick response!

Sincerely,
Marlon

@myyxl myyxl closed this as completed Nov 20, 2020
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

No branches or pull requests

2 participants