Skip to content

When guest users have access to realtime graphs, remote code could be executed (CVE-2020-8813) #3285

Closed

Description

@netniV

Describe the bug
Mohammad Askar of iSecurity has reported that graph_realtime.php prior to 1.2.10 allows remote attackers to execute arbitrary OS commands via shell metacharacters in a cookie if a guest user has the graph real-time privilege.

To Reproduce
Steps to reproduce the behavior:

  1. Enable the guest account
  2. Ensure the guest account has full access to realtime graphs
  3. Change the 'Cacti' cookie to have malformed characters which could run a script.

Expected behavior
The raw output of the cookie should be treated as insecure and as such, a validated version of the value utilised.

Additional context
This was reported as CVE-2020-8813

Activity

  1. added
    bugUndesired behaviour
    SECURITYA security issue reported through CVE
    on Feb 23, 2020
  2. added this to the 1.2.10 milestone on Feb 23, 2020
  3. self-assigned this
    on Feb 23, 2020
  4. netniV commented on Feb 23, 2020

    @netniV
    MemberAuthor

    This is a low risk exploit as the default Cacti configuration is set such that the Guest account is disabled, the Guest account has no access to realtime graphs under permissions and the guest template user is not set.

    It should also be noted, that this issue only seems to affect PHP versions before 7.2 and as such that again mitigates the likelihood of this being exploited.

    However, should someone running PHP 7.1 or before, enable access to realtime graphs for guest users (which is against the recommendations of the group), it would be possible to craft a malicious packet that could be executed unwittingly.

    The main reason for this is a lack of escaping around the session_id() when assigned to the poller id whilst building on the command to run poller_realtime.php. The simple fix was to hash the value so that it generated a reasonable unique poller id, that couldn't execute code.

    This fix has already been verified by @mhasker before posting his findings.

  5. added a commit that references this issue on Feb 23, 2020
    fea919e
  6. atluxity commented on Feb 23, 2020

    @atluxity

    Exploit for this vulnerability is now public.

  7. netniV commented on Feb 23, 2020

    @netniV
    MemberAuthor

    Yes it is. I was hoping they were going to create the issue but as they hadn't and the exploit is out there I thought it best to do so myself. The fortunate thing is most people would never have real time access enabled for guests, nor the guest account active. Failing that, you'd have to be a malicious admin to make use of the exploit as you need to be able to adjust the realm permissions for the guest user.

  8. locked and limited conversation to collaborators on Jun 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

SECURITYA security issue reported through CVEbugUndesired behaviourresolvedA fixed issue

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions