summaryrefslogtreecommitdiff
path: root/test/integration/test-cve-2020-27350
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2020-10-19 13:22:33 +0200
committerJulian Andres Klode <julian.klode@canonical.com>2020-12-07 12:29:49 +0100
commit66962a66970a1f816375620c89de7117a470a6af (patch)
tree6c6daf308a98015ddf86903535ddb35f4de5cc2f /test/integration/test-cve-2020-27350
parentbb8d03f29d9738fe9a2c16da30343aae3888a362 (diff)
CVE-2020-27350: arfile: Integer overflow in parsing
GHSL-2020-169: This first hunk adds a check that we have more files left to read in the file than the size of the member, ensuring that (a) the number is not negative, which caused the crash here and (b) ensures that we similarly avoid other issues with trying to read too much data. GHSL-2020-168: Long file names are encoded by a special marker in the filename and then the real filename is part of what is normally the data. We did not check that the length of the file name is within the length of the member, which means that we got a overflow later when subtracting the length from the member size to get the remaining member size. The file createdeb-lp1899193.cc was provided by GitHub Security Lab and reformatted using apt coding style for inclusion in the test case, both of these issues have an automated test case in test/integration/test-ubuntu-bug-1899193-security-issues. LP: #1899193
Diffstat (limited to 'test/integration/test-cve-2020-27350')
-rwxr-xr-xtest/integration/test-cve-2020-2735013
1 files changed, 13 insertions, 0 deletions
diff --git a/test/integration/test-cve-2020-27350 b/test/integration/test-cve-2020-27350
new file mode 100755
index 000000000..6ee867bb3
--- /dev/null
+++ b/test/integration/test-cve-2020-27350
@@ -0,0 +1,13 @@
+#!/bin/sh
+set -e
+
+TESTDIR="$(readlink -f "$(dirname "$0")")"
+. "$TESTDIR/framework"
+setupenvironment
+configarchitecture "amd64"
+
+${APTTESTHELPERSBINDIR}/createdeb-cve-2020-27350 crash crash.deb
+testequal "E: Invalid archive member header" runapt ${APTTESTHELPERSBINDIR}/testdeb ./crash.deb
+
+${APTTESTHELPERSBINDIR}/createdeb-cve-2020-27350 loop loop.deb
+testequal "E: Invalid archive member header" runapt ${APTTESTHELPERSBINDIR}/testdeb ./loop.deb