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

Remote Code Execution due to input validation failure in Performance Boost Debug Log (CVE-2020-7237) #3201

Closed
0xfatty opened this issue Jan 19, 2020 · 2 comments
Labels
bug Undesired behaviour resolved A fixed issue SECURITY A security issue reported through CVE

Comments

@0xfatty
Copy link

0xfatty commented Jan 19, 2020

Describe the bug
An input validation error found in Boost Debug Log field leads to Remote Code Execution.

To Reproduce
Steps to reproduce the behavior:

  1. Navigate to Console -> Configuration -> Settings -> Performance
  2. In Boost Debug Log field, type in the payload:
    --verbose; cat /etc/passwd > rce.txt
  3. Save. Even the $input_whitelisting in config.php is ON, it would still accept this payload.
  4. Wait a little bit until new polling cycle gets fetched. Navigate to http://cacti/rce.txt to see /etc/passwd content.

Screenshots

  • Payload
    image

  • Successfully saved the payload
    image

  • /etc/passwd content
    image

Root cause

  • Not like other fields in Configuration tab, Boost Debug Log would still be saved even if the input contains special characters.
  • Tracing back to server log, I observed that this is being handled by poller_automation.php where it gets fetched by the poller process.
  • Taking a look at the poller_automation.php, I observed that there are 5 different arguments that can be used to passed into its command. Hence, we can use either --debug, --force, --verbose, --version, or --help to pass into Boost Debug Log field.
  • After crafting a payload, the script will look like:
    /bin/php <path>/poller_automation.php --verbose; cat /etc/passswd > rce.txt where it gets fetched by the new poller process and create rce.txt in webroot.

Remediation

  • Apply a check on this field (i.e: input length, input characters)
  • If this field is supposed to take these mentioned arguments, create a drop-down menu instead of string field if possible.

Please let me know if you need any further information.

Chi Tran

cigamit added a commit that referenced this issue Jan 19, 2020
Vulnerability Report: Remote Code Execution due to input validation in Performance Boost Debug Log
@cigamit cigamit added bug Undesired behaviour resolved A fixed issue SECURITY A security issue reported through CVE labels Jan 19, 2020
@cigamit
Copy link
Member

cigamit commented Jan 19, 2020

Should be all set now.

@0xfatty
Copy link
Author

0xfatty commented Jan 20, 2020

A CVE has been assigned for this issue.

CVE-2020-7237.

I have also committed to CHANGELOG.

0xfatty pushed a commit to 0xfatty/cacti that referenced this issue Jan 20, 2020
TheWitness pushed a commit that referenced this issue Jan 20, 2020
@netniV netniV changed the title Vulnerability Report: Remote Code Execution due to input validation in Performance Boost Debug Log Remote Code Execution due to input validation failure in Performance Boost Debug Log (CVE-2020-7237) Feb 10, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Jun 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Undesired behaviour resolved A fixed issue SECURITY A security issue reported through CVE
Projects
None yet
Development

No branches or pull requests

3 participants