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 1188235 - (CVE-2015-1472) CVE-2015-1472 glibc: heap buffer overflow in glibc swscanf
CVE-2015-1472 glibc: heap buffer overflow in glibc swscanf
Status: CLOSED ERRATA
Product: Security Response
Classification: Other
Component: vulnerability (Show other bugs)
unspecified
All Linux
low Severity low
: ---
: ---
Assigned To: Red Hat Product Security
impact=low,public=20140221,reported=2...
: Reopened, Security
Depends On: 1188237 1209106 1209107 1242303
Blocks: 1188240 1210268 1262918
  Show dependency treegraph
 
Reported: 2015-02-02 06:45 EST by Vasyl Kaigorodov
Modified: 2016-06-13 07:56 EDT (History)
13 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
A heap-based buffer overflow flaw was found in glibc's swscanf() function. An attacker able to make an application call the swscanf() function could use this flaw to crash that application or, potentially, execute arbitrary code with the permissions of the user running the application.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-11-20 00:49:53 EST
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
Sourceware 16618 None None None Never
Red Hat Product Errata RHSA-2015:2199 normal SHIPPED_LIVE Moderate: glibc security, bug fix, and enhancement update 2015-11-19 03:04:22 EST
Red Hat Product Errata RHSA-2015:2589 normal SHIPPED_LIVE Important: glibc security update 2015-12-09 08:57:25 EST

  None (edit)
Description Vasyl Kaigorodov 2015-02-02 06:45:11 EST
Heap buffer overflow was reported [1] in glibc stdio-common/vfscanf.c.

stdio-common/vfscanf.c has an ADDW macro that tries to determine whether to use malloc or alloca for allocations.  But in the malloc case, it only allocates newsize bytes instead of the required newsize * sizeof (CHAR_T).  Thus the allocated buffer gets overrun in the wide-string case, as shown in the following testcase:

  int
  main (void)
  {
    wchar_t *s = malloc ((SIZE + 1) * sizeof (*s));
    if (s == NULL)
      abort ();
    for (size_t i = 0; i < SIZE; i++)
      s[i] = L'0';
    s[SIZE] = L'\0';
    int i;
    if (swscanf (s, L"%d", &i) != 1)
      abort ();
    if (i != 0)
      abort ();
    free (s);
    return 0;
  }

CVE request: http://www.openwall.com/lists/oss-security/2015/02/01/8

[1]: https://sourceware.org/bugzilla/show_bug.cgi?id=16618
Comment 1 Vasyl Kaigorodov 2015-02-02 06:45:40 EST
Created glibc tracking bugs for this issue:

Affects: fedora-all [bug 1188237]
Comment 2 Carlos O'Donell 2015-02-06 00:53:36 EST
Now fixed in upstream.

commit 5bd80bfe9ca0d955bfbbc002781bc7b01b6bcb06
Author: Paul Pluzhnikov <ppluzhnikov@google.com>
Date:   Fri Feb 6 00:30:42 2015 -0500

    CVE-2015-1472: wscanf allocates too little memory
    
    BZ #16618
    
    Under certain conditions wscanf can allocate too little memory for the
    to-be-scanned arguments and overflow the allocated buffer.  The
    implementation now correctly computes the required buffer size when
    using malloc.
    
    A regression test was added to tst-sscanf.
Comment 6 Fedora Update System 2015-03-04 05:26:52 EST
glibc-2.20-8.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 9 Vasyl Kaigorodov 2015-05-21 11:59:53 EDT
Statement:

This issue did not affect the versions of glibc as shipped with Red Hat Enterprise Linux 5 and 6 as they did use different memory allocation algorithm in swscanf() function.
Comment 11 errata-xmlrpc 2015-11-18 23:16:04 EST
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2015:2199 https://rhn.redhat.com/errata/RHSA-2015-2199.html
Comment 12 errata-xmlrpc 2015-12-09 03:58:14 EST
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7.1 EUS - Server and Compute Node Only
  Red Hat Enterprise Linux 7.1 EUS  - Server and Compute Node Only

Via RHSA-2015:2589 https://rhn.redhat.com/errata/RHSA-2015-2589.html

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