CVE-2015-1815
published 2015-03-30CVE-2015-1815: The get_rpm_nvr_by_file_path_temporary function in util.py in setroubleshoot before 3.2.22 allows remote attackers to execute arbitrary commands via shell…
PriorityP272critical10CVSS 2.0
AVNACLAuNCCICAC
EXPLOIT
EPSS
16.45%
96.6th percentile
The get_rpm_nvr_by_file_path_temporary function in util.py in setroubleshoot before 3.2.22 allows remote attackers to execute arbitrary commands via shell metacharacters in a file name.
Affected
2 ranges
| Vendor | Product | Version range | Fixed in |
|---|---|---|---|
| fedoraproject | fedora | — | — |
| selinux | setroubleshoot | <= 3.2.21 | — |
Detection & IOCsextracted from sources · hover to see the quote
- →Monitor for shell metacharacters (single quotes, backticks, semicolons) appearing in filenames passed to setroubleshootd, particularly in SELinux AVC denial reports. The vulnerable sink is `commands.getstatusoutput("rpm -qf '%s'" % name)` in util.py, which passes attacker-controlled filenames to `sh -c`. ↗
- →Watch journalctl/syslog for unexpected `logger` output showing uid=0(root) context of `setroubleshootd_t`, which is the indicator used in the PoC to confirm successful exploitation. ↗
- →Detect exploitation attempts via NetworkManager/openvpn plugin: look for nmcli commands adding VPN connections of type openvpn with CA certificate paths containing shell metacharacters (single quotes, backticks). ↗
- →Flag any process spawned by setroubleshootd (running in setroubleshootd_t SELinux domain) that is not `rpm`. Legitimate behaviour is only `rpm -qf <path>`; any other child process indicates command injection. ↗
- →Remote attack surface exists wherever attackers can influence filenames visible to SELinux AVC reports (web uploads, git, scp, ftp). Monitor for AVC denials referencing filenames with shell metacharacters in those directories. ↗
- ·The vulnerability only affects setroubleshoot versions before 3.2.22. Systems running setroubleshoot >= 3.2.22 (or patched 3.2.17-2 on Fedora 20) are not vulnerable, as the fix replaces `commands.getstatusoutput` with `subprocess.check_output` (no shell) and normalises paths with `os.path.abspath()`. ↗
- ·Systems running in SELinux permissive mode are fully exposed (effective root), whereas enforcing mode limits the attacker to the setroubleshootd_t domain's allowed rules and transitions — though this domain has significant privileges. ↗
CVSS provenance
nvdv2.010.0CRITICALAV:N/AC:L/Au:N/C:C/I:C/A:C
vendor_redhat10.0CRITICAL
CVEs like this are exactly what “Exploited This Week” covers.
Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.
Red Hat
setroubleshoot: command injection via crafted file name
vendor_redhat·2015-03-26·CVSS 10.0
CVE-2015-1815 [CRITICAL] CWE-77 setroubleshoot: command injection via crafted file name
setroubleshoot: command injection via crafted file name
The get_rpm_nvr_by_file_path_temporary function in util.py in setroubleshoot before 3.2.22 allows remote attackers to execute arbitrary commands via shell metacharacters in a file name.
It was found that setroubleshoot did not sanitize file names supplied in a shell command look-up for RPMs associated with access violation reports. An attacker could use this flaw to escalate their privileges on the system by supplying a specially crafted file to the underlying shell command.
GHSA
GHSA-6hj4-3cj5-hqm9: The get_rpm_nvr_by_file_path_temporary function in util
ghsa_unreviewed·2022-05-17
CVE-2015-1815 [HIGH] CWE-77 GHSA-6hj4-3cj5-hqm9: The get_rpm_nvr_by_file_path_temporary function in util
The get_rpm_nvr_by_file_path_temporary function in util.py in setroubleshoot before 3.2.22 allows remote attackers to execute arbitrary commands via shell metacharacters in a file name.
No detection rules found.
Bugzilla
CVE-2015-1815 setroubleshoot: command injection via crafted file name [fedora-all]
bugzilla·2015-03-26·CVSS 10.0
CVE-2015-1815 [CRITICAL] CVE-2015-1815 setroubleshoot: command injection via crafted file name [fedora-all]
CVE-2015-1815 setroubleshoot: command injection via crafted file name [fedora-all]
This is an automatically created tracking bug! It was created to ensure
that one or more security vulnerabilities are fixed in affected versions
of Fedora.
For comments that are specific to the vulnerability please use bugs filed
against the "Security Response" product referenced in the "Blocks" field.
For more information see:
http://fedoraproject.org/wiki/Security/TrackingBugs
When submitting as an update, use the fedpkg template provided in the next
comment(s). This will include the bug IDs of this tracking bug as well as
the relevant top-level CVE bugs.
Please also mention the CVE IDs being fixed in the RPM changelog and the
fedpkg commit message.
NOTE: this issue affects multiple supported version
Bugzilla
CVE-2015-1815 setroubleshoot: command injection via crafted file name
bugzilla·2015-03-18·CVSS 10.0
CVE-2015-1815 [CRITICAL] CVE-2015-1815 setroubleshoot: command injection via crafted file name
CVE-2015-1815 setroubleshoot: command injection via crafted file name
It was found that setroubleshoot did not sanitize file names supplied in a shell command look-up for RPMs associated with access violation reports. An attacker could use this flaw to escalate their privileges on the system by supplying a specially crafted file to the underlying shell command.
The vulnerable code in util.py:
266 def get_rpm_nvr_by_file_path_temporary(name):
267 if name is None or not os.path.exists(name):
268 return None
269
270 nvr = None
271 try:
272 import commands
273 rc, output = commands.getstatusoutput("rpm -qf '%s'" % name)
274 if rc == 0:
275 nvr = output
276 except:
277 syslog.syslog(syslog.LOG_ERR, "failed to retrieve rpm info for %s" % name)
278 return nvr
Acknowledgements:
Red Hat would
http://lists.fedoraproject.org/pipermail/package-announce/2015-April/154427.htmlhttp://lists.fedoraproject.org/pipermail/package-announce/2015-April/154444.htmlhttp://lists.fedoraproject.org/pipermail/package-announce/2015-March/154147.htmlhttp://rhn.redhat.com/errata/RHSA-2015-0729.htmlhttp://www.openwall.com/lists/oss-security/2015/03/26/1http://www.osvdb.org/119966http://www.securityfocus.com/bid/73374https://bugzilla.redhat.com/show_bug.cgi?id=1203352https://bugzilla.redhat.com/show_bug.cgi?id=1206050https://github.com/stealth/troubleshooterhttps://www.exploit-db.com/exploits/36564/http://lists.fedoraproject.org/pipermail/package-announce/2015-April/154427.htmlhttp://lists.fedoraproject.org/pipermail/package-announce/2015-April/154444.htmlhttp://lists.fedoraproject.org/pipermail/package-announce/2015-March/154147.htmlhttp://rhn.redhat.com/errata/RHSA-2015-0729.htmlhttp://www.openwall.com/lists/oss-security/2015/03/26/1http://www.osvdb.org/119966http://www.securityfocus.com/bid/73374https://bugzilla.redhat.com/show_bug.cgi?id=1203352https://bugzilla.redhat.com/show_bug.cgi?id=1206050https://github.com/stealth/troubleshooterhttps://www.exploit-db.com/exploits/36564/
2015-03-30
Published