mirror of
https://github.com/GerbilSoft/zlib-ng.git
synced 2025-06-18 11:35:35 -04:00
Add test for CVE-2002-0059
CVE-2002-0059 was a double free in inflation. [0] This makes sure we don't accidentally reintroduce it. zlib-1.1.3 was download and fuzz tested using AFL[1]. This crashing case (test.gz) was discovered, and using gdb it was confirmed to be a double free in the expected place. The test script looks for a normal error exit (status code 1), and fails if any other code is returned. [0] http://www.cvedetails.com/cve/CVE-2002-0059/ [1] http://lcamtuf.coredump.cx/afl/ Signed-off-by: Daniel Axtens <dja@axtens.net>
This commit is contained in:
parent
d7fdc511e1
commit
821dd3d85d
BIN
test/CVE-2002-0059/test.gz
Normal file
BIN
test/CVE-2002-0059/test.gz
Normal file
Binary file not shown.
@ -45,7 +45,10 @@ test64:
|
||||
fi; \
|
||||
rm -f $$TMP64
|
||||
|
||||
cvetests: testCVE-2003-0107
|
||||
cvetests: testCVE-2003-0107 testCVEinputs
|
||||
|
||||
testCVEinputs:
|
||||
@$(SRCDIR)/testCVEinputs.sh
|
||||
|
||||
testCVE-2003-0107: CVE-2003-0107$(EXE)
|
||||
@if ./CVE-2003-0107$(EXE); then \
|
||||
|
22
test/testCVEinputs.sh
Executable file
22
test/testCVEinputs.sh
Executable file
@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
TESTDIR="$(dirname "$0")"
|
||||
|
||||
CVEs="CVE-2002-0059"
|
||||
|
||||
for CVE in $CVEs; do
|
||||
fail=0
|
||||
for testcase in ${TESTDIR}/${CVE}/*.gz; do
|
||||
../minigzip -d < "$testcase"
|
||||
# we expect that a 1 error code is OK
|
||||
# for a vulnerable failure we'd expect 134 or similar
|
||||
if [ $? -ne 1 ]; then
|
||||
fail=1
|
||||
fi
|
||||
done
|
||||
if [ $fail -eq 0 ]; then
|
||||
echo " --- zlib not vulnerable to $CVE ---";
|
||||
else
|
||||
echo " --- zlib VULNERABLE to $CVE ---"; exit 1;
|
||||
fi
|
||||
done
|
||||
|
Loading…
Reference in New Issue
Block a user