Bug 2324540 (CVE-2024-52336)

Summary: CVE-2024-52336 tuned: `script_pre` and `script_post` options allow to pass arbitrary scripts executed by root
Product: [Other] Security Response Reporter: OSIDB Bzimport <bzimport>
Component: vulnerabilityAssignee: Product Security DevOps Team <prodsec-dev>
Status: NEW --- QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: echaudro, fleitner, jskarvad, ktraynor, rkhan, sbroz, security-response-team, trathi, usurse
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
A script injection vulnerability was identified in the Tuned package. The `instance_create()` D-Bus function can be called by locally logged-in users without authentication. This flaw allows a local non-privileged user to execute a D-Bus call with `script_pre` or `script_post` options that permit arbitrary scripts with their absolute paths to be passed. These user or attacker-controlled executable scripts or programs could then be executed by Tuned with root privileges that could allow attackers to local privilege escalation.
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Deadline: 2024-11-26   

Description OSIDB Bzimport 2024-11-08 13:07:00 UTC
The `script_pre` and `script_post` options allow to pass arbitrary scripts that will be executed by root. The parameters are extracted in "daemon/controller.py:459", stored unmodified in a new `Instance` object and the only verification of the script path is performed in "plugins/base.py:222":

```
    if not script.startswith("/"):
        log.error("Relative paths cannot be used in script_pre or script_post. " \
                + "Use ${i:PROFILE_DIR}.")
        return False
```

So the only requirement is that an absolute path is passed. Thus scripts under control of an unprivileged user can be passed here. This allows for a local root exploit.

Comment 12 errata-xmlrpc 2024-11-26 15:44:31 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9

Via RHSA-2024:10384 https://access.redhat.com/errata/RHSA-2024:10384