Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 1218297 - (CVE-2010-5325) CVE-2010-5325 foomatic: potential remote arbitrary code execution
CVE-2010-5325 foomatic: potential remote arbitrary code execution
Status: CLOSED ERRATA
Product: Security Response
Classification: Other
Component: vulnerability (Show other bugs)
unspecified
All Linux
medium Severity medium
: ---
: ---
Assigned To: Red Hat Product Security
impact=moderate,public=20150505,repor...
: Reopened, Security
Depends On: 1214534 1296499 1296500
Blocks: 1218306
  Show dependency treegraph
 
Reported: 2015-05-04 10:13 EDT by Fabio Olive Leite
Modified: 2016-03-22 17:29 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
It was discovered that the unhtmlify() function of foomatic-rip did not correctly calculate buffer sizes, possibly leading to a heap-based memory corruption. A malicious attacker could exploit this flaw to cause foomatic-rip to crash or, possibly, execute arbitrary code.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-03-22 17:29:17 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:0491 normal SHIPPED_LIVE Moderate: foomatic security update 2016-03-22 21:02:15 EDT

  None (edit)
Description Fabio Olive Leite 2015-05-04 10:13:08 EDT
This flaw was fixed upstream back in 2010, without much attention being
given to the possible security implications of it. It is a remote buffer
overflow with possibility of executing arbitrary code, with only a few
restrictions, such as having the cups service open to the network and a
particular kind of filter in use.

Analysis by Engineering shows that only RHEL-6 contains the affected code,
so RHEL-5, RHEL-7 and Fedora are not affected. Giving this flaw a Moderate
rating, despite the 7.7 CVSSv2 score, as cups is not usually configured
widely open to the network or internet at large, and because it depends on
a particular kind of filter being used.

References:
https://bugs.linuxfoundation.org/show_bug.cgi?id=515
Comment 2 Stefan Cornelius 2015-05-05 14:25:43 EDT
The simplified code looks a bit like:
>static void unhtmlify(char *dest, size_t size, const char *src)
>{
>   char *pdest = dest;
>   const char *psrc = src;
>   const char *repl;
>
>   while (*psrc && pdest - dest < size) {
>     if (repl) {
>           strncpy(pdest, repl, size - (pdest - dest));
>           pdest += strlen(repl);
>           psrc = strchr(psrc, ';') +1;
>           }
>   }
>*pdest = '\0';
>}

The size calculation and the loop condition seem to have an off-by-one-ish problem, but I didn't investigate that; the patch would fix it and there's a bigger problem than a potential off-by-one:
>           strncpy(pdest, repl, size - (pdest - dest));
>           pdest += strlen(repl);

We increase pdest by the length of the source string, not taking the remaining space of pdest/dest into account. This could catapult pdest beyond the "dest" boundaries, leading to an out of bounds write when reaching the *pdest = '\0'; part.

So, the mechanic at hand is essentially "write a 0 byte at a semi-controlled OOB location on the heap". That's fairly limited but might just be crazy enough to gain code execution.
Comment 5 Stefan Cornelius 2016-02-15 04:45:50 EST
CVE request:
http://www.openwall.com/lists/oss-security/2016/02/15/1
Comment 6 Stefan Cornelius 2016-02-15 16:41:05 EST
This was assigned CVE-2010-5325 via http://www.openwall.com/lists/oss-security/2016/02/15/7
Comment 7 errata-xmlrpc 2016-03-22 17:03:55 EDT
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 6

Via RHSA-2016:0491 https://rhn.redhat.com/errata/RHSA-2016-0491.html

Note You need to log in before you can comment on or make changes to this bug.