CVE-2015-3315: Race Condition
Automatic Bug Reporting Tool (ABRT) allows local users to read, change the ownership of, or have other unspecified impact on arbitrary files via a symlink attack on (1) /var/tmp/abrt//maps, (2) /tmp/jvm-/hserror.log, (3) /proc//exe, (4) /etc/os-release in a chroot, or (5) an unspecified root directory related to librpm.
Other sources
The following flaws were reported by Tavis Oramandy:
Furthermore, Abrt suffers from numerous race conditions and symlink problems from trusting unprivileged programs. For example, the code below (and lots of similar code) is vulnerable to a filesystem race where a user unlinks the file after the copy but before the chown. https://github.com/abrt/abrt/blob/master/src/hooks/abrt-hook-ccpp.c#L634
strcpy(sourcefilename + sourcebaseofs, "maps"); strcpy(destbase, FILENAMEMAPS); copyfile(sourcefilename, destfilename, DEFAULTDUMPDIRMODE); IGNORERESULT(chown(destfilename, dd->dduid, dd->ddgid));
This code trusts various symlinks in /tmp without validation:
https://github.com/abrt/abrt/blob/master/src/hooks/abrt-hook-ccpp.c#L806
char javalog = xasprintf("/tmp/jvm-%lu/hserror.log", (long)pid); int srcfd = open(javalog, ORDONLY); free(javalog);
This code trusts the /proc/pid/exe symlink, even though it is possible to link it anywhere you want.
https://github.com/abrt/abrt/blob/master/src/hooks/abrt-hook-ccpp.c#L368
sprintf(buf, "/proc/%lu/exe", (long)pid); int srcfdbinary = open(buf, ORDONLY); / might fail and return -1, it's ok /
This code trusts the attacker controlled root symlink and copies files from it.
https://github.com/abrt/libreport/blob/master/src/lib/dumpdir.c#L671
if (chrootdir) copyfilefromchroot(dd, FILENAMEOSINFOINROOTDIR, chrootdir, "/etc/os-release");
This instructs librpm to trust an unprivileged root symlink:
https://github.com/abrt/abrt/blob/master/src/daemon/rpm.c#L184
if (rpmtsSetRootDir(ts, rootdirorNULL) != 0) { rpmtsFree(ts); return -1; }
And so on.
There are other automatic crash analysis scripts, I believe systemd also has one - I haven't looked at it all.
Mitigation:
It is recommended to disable abrt via the following command line, till the flaws have been resolved: sysctl -w kern.corepattern=core
Note: This will reset, if abrt is re-started.
— Red Hat
Affected Software
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2015-3315?
CVE-2015-3315 is classified as a moderate severity vulnerability.
How do I fix CVE-2015-3315?
To mitigate CVE-2015-3315, update the Automatic Bug Reporting Tool to the latest version that includes the security patch.
Who is affected by CVE-2015-3315?
CVE-2015-3315 affects local users on systems running vulnerable versions of Red Hat Automatic Bug Reporting Tool.
What risks are associated with CVE-2015-3315?
The risks associated with CVE-2015-3315 include unauthorized access to sensitive files and potential manipulation of important system data.
Is CVE-2015-3315 present in all Red Hat versions?
No, CVE-2015-3315 specifically affects certain older versions of Red Hat, such as the Automatic Bug Reporting Tool.