summaryrefslogtreecommitdiff
path: root/system
diff options
context:
space:
mode:
authorA. Wilcox <awilcox@wilcox-tech.com>2020-03-22 10:34:42 +0000
committerA. Wilcox <awilcox@wilcox-tech.com>2020-03-22 10:34:42 +0000
commit7a8eb9c1a4a9c2f3e3a3228266bcba74ab298c23 (patch)
tree7cb10f6bfae6c18be3f8b837840bdc060505fe65 /system
parent8e8bfad331752ef7dc605c9f7c65e8271f96ddeb (diff)
parent988d22dd710713d46c13c0b08f045aa2ce4f69d9 (diff)
downloadpackages-7a8eb9c1a4a9c2f3e3a3228266bcba74ab298c23.tar.gz
packages-7a8eb9c1a4a9c2f3e3a3228266bcba74ab298c23.tar.bz2
packages-7a8eb9c1a4a9c2f3e3a3228266bcba74ab298c23.tar.xz
packages-7a8eb9c1a4a9c2f3e3a3228266bcba74ab298c23.zip
Merge branch 'cves.2020.03.16' into 'master'
CVE patches for 2020.03.16 See merge request adelie/packages!411
Diffstat (limited to 'system')
-rw-r--r--system/icu/APKBUILD9
-rw-r--r--system/icu/CVE-2017-7867-7868.patch155
-rw-r--r--system/icu/CVE-2020-10531.patch118
-rw-r--r--system/pcre2/APKBUILD13
-rw-r--r--system/pcre2/CVE-2019-20454.patch50
-rw-r--r--system/python3/APKBUILD15
-rw-r--r--system/python3/CVE-2019-16056.patch131
-rw-r--r--system/python3/CVE-2019-16935.patch80
-rw-r--r--system/python3/CVE-2019-18348.patch147
-rw-r--r--system/sqlite/APKBUILD23
10 files changed, 361 insertions, 380 deletions
diff --git a/system/icu/APKBUILD b/system/icu/APKBUILD
index 4165246a3..046698316 100644
--- a/system/icu/APKBUILD
+++ b/system/icu/APKBUILD
@@ -6,7 +6,7 @@ pkgver=65.1
# convert x.y.z to x_y_z
_ver=$(printf '%s' "$pkgver" | tr . _)
-pkgrel=0
+pkgrel=1
pkgdesc="International Components for Unicode"
url="http://site.icu-project.org/"
arch="all"
@@ -17,6 +17,7 @@ makedepends=""
subpackages="$pkgname-static $pkgname-dev $pkgname-doc $pkgname-libs"
source="https://github.com/unicode-org/icu/releases/download/release-$(printf '%s' "$pkgver" | tr . -)/${pkgname}4c-$_ver-src.tgz
icu-60.2-always-use-utf8.patch
+ CVE-2020-10531.patch
"
# secfixes:
@@ -27,6 +28,9 @@ source="https://github.com/unicode-org/icu/releases/download/release-$(printf '%
# 58.2-r2:
# - CVE-2017-7867
# - CVE-2017-7868
+# 65.1-r1:
+# - CVE-2020-10531
+
builddir="$srcdir"/icu/source
prepare() {
@@ -73,4 +77,5 @@ static() {
}
sha512sums="8f1ef33e1f4abc9a8ee870331c59f01b473d6da1251a19ce403f822f3e3871096f0791855d39c8f20c612fc49cda2c62c06864aa32ddab2dbd186d2b21ce9139 icu4c-65_1-src.tgz
-f86c62422f38f6485c58d4766e629bab69e4b0e00fa910854e40e7db1ace299152eaefa99ae2fbab7465e65d3156cbea7124612defa60680db58ab5c34d6262f icu-60.2-always-use-utf8.patch"
+f86c62422f38f6485c58d4766e629bab69e4b0e00fa910854e40e7db1ace299152eaefa99ae2fbab7465e65d3156cbea7124612defa60680db58ab5c34d6262f icu-60.2-always-use-utf8.patch
+2901235a24b1973516e495473188b077eb0486714ac47f702f226a3406176e913672159978b67548a1316284ecc716e06158b05c190ddfa83ad576a7a3539d72 CVE-2020-10531.patch"
diff --git a/system/icu/CVE-2017-7867-7868.patch b/system/icu/CVE-2017-7867-7868.patch
deleted file mode 100644
index df18283c2..000000000
--- a/system/icu/CVE-2017-7867-7868.patch
+++ /dev/null
@@ -1,155 +0,0 @@
-Index: source/common/utext.cpp
-===================================================================
---- source/common/utext.cpp (revision 39670)
-+++ source/common/utext.cpp (revision 39671)
-@@ -848,7 +848,13 @@
-
- // Chunk size.
--// Must be less than 85, because of byte mapping from UChar indexes to native indexes.
--// Worst case is three native bytes to one UChar. (Supplemenaries are 4 native bytes
--// to two UChars.)
-+// Must be less than 42 (256/6), because of byte mapping from UChar indexes to native indexes.
-+// Worst case there are six UTF-8 bytes per UChar.
-+// obsolete 6 byte form fd + 5 trails maps to fffd
-+// obsolete 5 byte form fc + 4 trails maps to fffd
-+// non-shortest 4 byte forms maps to fffd
-+// normal supplementaries map to a pair of utf-16, two utf8 bytes per utf-16 unit
-+// mapToUChars array size must allow for the worst case, 6.
-+// This could be brought down to 4, by treating fd and fc as pure illegal,
-+// rather than obsolete lead bytes. But that is not compatible with the utf-8 access macros.
- //
- enum { UTF8_TEXT_CHUNK_SIZE=32 };
-@@ -890,5 +896,5 @@
- // one for a supplementary starting in the last normal position,
- // and one for an entry for the buffer limit position.
-- uint8_t mapToUChars[UTF8_TEXT_CHUNK_SIZE*3+6]; // Map native offset from bufNativeStart to
-+ uint8_t mapToUChars[UTF8_TEXT_CHUNK_SIZE*6+6]; // Map native offset from bufNativeStart to
- // correspoding offset in filled part of buf.
- int32_t align;
-@@ -1033,4 +1039,5 @@
- u8b = (UTF8Buf *)ut->p; // the current buffer
- mapIndex = ix - u8b->toUCharsMapStart;
-+ U_ASSERT(mapIndex < (int32_t)sizeof(UTF8Buf::mapToUChars));
- ut->chunkOffset = u8b->mapToUChars[mapIndex] - u8b->bufStartIdx;
- return TRUE;
-@@ -1299,4 +1306,8 @@
- // If index is at the end, there is no character there to look at.
- if (ix != ut->b) {
-+ // Note: this function will only move the index back if it is on a trail byte
-+ // and there is a preceding lead byte and the sequence from the lead
-+ // through this trail could be part of a valid UTF-8 sequence
-+ // Otherwise the index remains unchanged.
- U8_SET_CP_START(s8, 0, ix);
- }
-@@ -1312,5 +1323,8 @@
- uint8_t *mapToNative = u8b->mapToNative;
- uint8_t *mapToUChars = u8b->mapToUChars;
-- int32_t toUCharsMapStart = ix - (UTF8_TEXT_CHUNK_SIZE*3 + 1);
-+ int32_t toUCharsMapStart = ix - sizeof(UTF8Buf::mapToUChars) + 1;
-+ // Note that toUCharsMapStart can be negative. Happens when the remaining
-+ // text from current position to the beginning is less than the buffer size.
-+ // + 1 because mapToUChars must have a slot at the end for the bufNativeLimit entry.
- int32_t destIx = UTF8_TEXT_CHUNK_SIZE+2; // Start in the overflow region
- // at end of buffer to leave room
-@@ -1339,4 +1353,5 @@
- // Special case ASCII range for speed.
- buf[destIx] = (UChar)c;
-+ U_ASSERT(toUCharsMapStart <= srcIx);
- mapToUChars[srcIx - toUCharsMapStart] = (uint8_t)destIx;
- mapToNative[destIx] = (uint8_t)(srcIx - toUCharsMapStart);
-@@ -1368,4 +1383,5 @@
- mapToUChars[sIx-- - toUCharsMapStart] = (uint8_t)destIx;
- } while (sIx >= srcIx);
-+ U_ASSERT(toUCharsMapStart <= (srcIx+1));
-
- // Set native indexing limit to be the current position.
-@@ -1542,4 +1558,5 @@
- U_ASSERT(index<=ut->chunkNativeLimit);
- int32_t mapIndex = index - u8b->toUCharsMapStart;
-+ U_ASSERT(mapIndex < (int32_t)sizeof(UTF8Buf::mapToUChars));
- int32_t offset = u8b->mapToUChars[mapIndex] - u8b->bufStartIdx;
- U_ASSERT(offset>=0 && offset<=ut->chunkLength);
-Index: source/test/intltest/utxttest.cpp
-===================================================================
---- source/test/intltest/utxttest.cpp (revision 39670)
-+++ source/test/intltest/utxttest.cpp (revision 39671)
-@@ -68,4 +68,6 @@
- case 7: name = "Ticket12130";
- if (exec) Ticket12130(); break;
-+ case 8: name = "Ticket12888";
-+ if (exec) Ticket12888(); break;
- default: name = ""; break;
- }
-@@ -1584,2 +1586,62 @@
- utext_close(&ut);
- }
-+
-+// Ticket 12888: bad handling of illegal utf-8 containing many instances of the archaic, now illegal,
-+// six byte utf-8 forms. Original implementation had an assumption that
-+// there would be at most three utf-8 bytes per UTF-16 code unit.
-+// The five and six byte sequences map to a single replacement character.
-+
-+void UTextTest::Ticket12888() {
-+ const char *badString =
-+ "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
-+ "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
-+ "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
-+ "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
-+ "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
-+ "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
-+ "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
-+ "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
-+ "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
-+ "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
-+ "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
-+ "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
-+ "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
-+ "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
-+ "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
-+ "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
-+ "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
-+ "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
-+ "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
-+ "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80";
-+
-+ UErrorCode status = U_ZERO_ERROR;
-+ LocalUTextPointer ut(utext_openUTF8(NULL, badString, -1, &status));
-+ TEST_SUCCESS(status);
-+ for (;;) {
-+ UChar32 c = utext_next32(ut.getAlias());
-+ if (c == U_SENTINEL) {
-+ break;
-+ }
-+ }
-+ int32_t endIdx = utext_getNativeIndex(ut.getAlias());
-+ if (endIdx != (int32_t)strlen(badString)) {
-+ errln("%s:%d expected=%d, actual=%d", __FILE__, __LINE__, strlen(badString), endIdx);
-+ return;
-+ }
-+
-+ for (int32_t prevIndex = endIdx; prevIndex>0;) {
-+ UChar32 c = utext_previous32(ut.getAlias());
-+ int32_t currentIndex = utext_getNativeIndex(ut.getAlias());
-+ if (c != 0xfffd) {
-+ errln("%s:%d (expected, actual, index) = (%d, %d, %d)\n",
-+ __FILE__, __LINE__, 0xfffd, c, currentIndex);
-+ break;
-+ }
-+ if (currentIndex != prevIndex - 6) {
-+ errln("%s:%d: wrong index. Expected, actual = %d, %d",
-+ __FILE__, __LINE__, prevIndex - 6, currentIndex);
-+ break;
-+ }
-+ prevIndex = currentIndex;
-+ }
-+}
-Index: source/test/intltest/utxttest.h
-===================================================================
---- source/test/intltest/utxttest.h (revision 39670)
-+++ source/test/intltest/utxttest.h (revision 39671)
-@@ -39,4 +39,5 @@
- void Ticket10983();
- void Ticket12130();
-+ void Ticket12888();
-
- private:
diff --git a/system/icu/CVE-2020-10531.patch b/system/icu/CVE-2020-10531.patch
new file mode 100644
index 000000000..f456b06ec
--- /dev/null
+++ b/system/icu/CVE-2020-10531.patch
@@ -0,0 +1,118 @@
+From b7d08bc04a4296982fcef8b6b8a354a9e4e7afca Mon Sep 17 00:00:00 2001
+From: Frank Tang <ftang@chromium.org>
+Date: Sat, 1 Feb 2020 02:39:04 +0000
+Subject: [PATCH] ICU-20958 Prevent SEGV_MAPERR in append
+
+See #971
+---
+ source/common/unistr.cpp | 6 ++-
+ source/test/intltest/ustrtest.cpp | 62 +++++++++++++++++++++++++
+ source/test/intltest/ustrtest.h | 1 +
+ 3 files changed, 68 insertions(+), 1 deletion(-)
+
+diff --git source/common/unistr.cpp source/common/unistr.cpp
+index 901bb3358ba..077b4d6ef20 100644
+--- source/common/unistr.cpp
++++ source/common/unistr.cpp
+@@ -1563,7 +1563,11 @@ UnicodeString::doAppend(const UChar *srcChars, int32_t srcStart, int32_t srcLeng
+ }
+
+ int32_t oldLength = length();
+- int32_t newLength = oldLength + srcLength;
++ int32_t newLength;
++ if (uprv_add32_overflow(oldLength, srcLength, &newLength)) {
++ setToBogus();
++ return *this;
++ }
+
+ // Check for append onto ourself
+ const UChar* oldArray = getArrayStart();
+diff --git source/test/intltest/ustrtest.cpp source/test/intltest/ustrtest.cpp
+index b6515ea813c..ad38bdf53a3 100644
+--- source/test/intltest/ustrtest.cpp
++++ source/test/intltest/ustrtest.cpp
+@@ -67,6 +67,7 @@ void UnicodeStringTest::runIndexedTest( int32_t index, UBool exec, const char* &
+ TESTCASE_AUTO(TestWCharPointers);
+ TESTCASE_AUTO(TestNullPointers);
+ TESTCASE_AUTO(TestUnicodeStringInsertAppendToSelf);
++ TESTCASE_AUTO(TestLargeAppend);
+ TESTCASE_AUTO_END;
+ }
+
+@@ -2310,3 +2311,64 @@ void UnicodeStringTest::TestUnicodeStringInsertAppendToSelf() {
+ str.insert(2, sub);
+ assertEquals("", u"abbcdcde", str);
+ }
++
++void UnicodeStringTest::TestLargeAppend() {
++ if(quick) return;
++
++ IcuTestErrorCode status(*this, "TestLargeAppend");
++ // Make a large UnicodeString
++ int32_t len = 0xAFFFFFF;
++ UnicodeString str;
++ char16_t *buf = str.getBuffer(len);
++ // A fast way to set buffer to valid Unicode.
++ // 4E4E is a valid unicode character
++ uprv_memset(buf, 0x4e, len * 2);
++ str.releaseBuffer(len);
++ UnicodeString dest;
++ // Append it 16 times
++ // 0xAFFFFFF times 16 is 0xA4FFFFF1,
++ // which is greater than INT32_MAX, which is 0x7FFFFFFF.
++ int64_t total = 0;
++ for (int32_t i = 0; i < 16; i++) {
++ dest.append(str);
++ total += len;
++ if (total <= INT32_MAX) {
++ assertFalse("dest is not bogus", dest.isBogus());
++ } else {
++ assertTrue("dest should be bogus", dest.isBogus());
++ }
++ }
++ dest.remove();
++ total = 0;
++ for (int32_t i = 0; i < 16; i++) {
++ dest.append(str);
++ total += len;
++ if (total + len <= INT32_MAX) {
++ assertFalse("dest is not bogus", dest.isBogus());
++ } else if (total <= INT32_MAX) {
++ // Check that a string of exactly the maximum size works
++ UnicodeString str2;
++ int32_t remain = INT32_MAX - total;
++ char16_t *buf2 = str2.getBuffer(remain);
++ if (buf2 == nullptr) {
++ // if somehow memory allocation fail, return the test
++ return;
++ }
++ uprv_memset(buf2, 0x4e, remain * 2);
++ str2.releaseBuffer(remain);
++ dest.append(str2);
++ total += remain;
++ assertEquals("When a string of exactly the maximum size works", (int64_t)INT32_MAX, total);
++ assertEquals("When a string of exactly the maximum size works", INT32_MAX, dest.length());
++ assertFalse("dest is not bogus", dest.isBogus());
++
++ // Check that a string size+1 goes bogus
++ str2.truncate(1);
++ dest.append(str2);
++ total++;
++ assertTrue("dest should be bogus", dest.isBogus());
++ } else {
++ assertTrue("dest should be bogus", dest.isBogus());
++ }
++ }
++}
+diff --git source/test/intltest/ustrtest.h source/test/intltest/ustrtest.h
+index 218befdcc68..4a356a92c7a 100644
+--- source/test/intltest/ustrtest.h
++++ source/test/intltest/ustrtest.h
+@@ -97,6 +97,7 @@ class UnicodeStringTest: public IntlTest {
+ void TestWCharPointers();
+ void TestNullPointers();
+ void TestUnicodeStringInsertAppendToSelf();
++ void TestLargeAppend();
+ };
+
+ #endif
diff --git a/system/pcre2/APKBUILD b/system/pcre2/APKBUILD
index 7bca0e450..4120d0a7b 100644
--- a/system/pcre2/APKBUILD
+++ b/system/pcre2/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer:
pkgname=pcre2
pkgver=10.33
-pkgrel=0
+pkgrel=1
pkgdesc="Perl-compatible regular expression library"
url="https://pcre.org"
arch="all"
@@ -12,7 +12,13 @@ depends_dev="libedit-dev zlib-dev"
makedepends="$depends_dev"
subpackages="$pkgname-dev $pkgname-doc $pkgname-tools
libpcre2-16:_libpcre libpcre2-32:_libpcre"
-source="https://ftp.pcre.org/pub/pcre/$pkgname-$pkgver.tar.gz"
+source="https://ftp.pcre.org/pub/pcre/$pkgname-$pkgver.tar.gz
+ CVE-2019-20454.patch
+ "
+
+# secfixes:
+# 10.33-r1:
+# - CVE-2019-20454
case "$CARCH" in
s390x) _enable_jit="";;
@@ -62,4 +68,5 @@ tools() {
mv "$pkgdir"/usr/bin "$subpkgdir"/usr/
}
-sha512sums="649983c7725e2fd2451ba89243b4c08c408fc279b7be3b2d225045cced3b0667ff6da4c9dd37510eb9e5aed6478aff54c2dbd1d92f4d0f1174579df9ec2c1882 pcre2-10.33.tar.gz"
+sha512sums="649983c7725e2fd2451ba89243b4c08c408fc279b7be3b2d225045cced3b0667ff6da4c9dd37510eb9e5aed6478aff54c2dbd1d92f4d0f1174579df9ec2c1882 pcre2-10.33.tar.gz
+07c43ccf130c1ed2b4f97036671f92e9c1d0100fd32c053b448e5dbdf976543c12f74568e37b661db7fbd603e815f5683a59cb2a9f9c307505dca3cb36db8120 CVE-2019-20454.patch"
diff --git a/system/pcre2/CVE-2019-20454.patch b/system/pcre2/CVE-2019-20454.patch
new file mode 100644
index 000000000..bdec87294
--- /dev/null
+++ b/system/pcre2/CVE-2019-20454.patch
@@ -0,0 +1,50 @@
+Revision: 1091
+Author: ph10
+Date: Mon May 13 16:26:17 2019 UTC
+URL: https://vcs.pcre.org/pcre2?view=revision&revision=1091
+
+Fix crash when \X is used without UTF in JIT.
+
+--- a/testdata/testinput4 2019/05/11 11:43:39 1090
++++ b/testdata/testinput4 2019/05/13 16:26:17 1091
+@@ -2480,4 +2480,7 @@
+ /^(?'אABC'...)(?&אABC)/utf
+ 123123123456
+
++/\X*/
++ \xF3aaa\xE4\xEA\xEB\xFEa
++
+ # End of testinput4
+--- a/testdata/testoutput4 2019/05/11 11:43:39 1090
++++ b/testdata/testoutput4 2019/05/13 16:26:17 1091
+@@ -4012,4 +4012,8 @@
+ 0: 123123
+ 1: 123
+
++/\X*/
++ \xF3aaa\xE4\xEA\xEB\xFEa
++ 0: \xf3aaa\xe4\xea\xeb\xfea
++
+ # End of testinput4
+
+Revision: 1092
+Author: ph10
+Date: Mon May 13 16:38:18 2019 UTC
+URL: https://vcs.pcre.org/pcre2?view=revision&revision=1092
+
+Forgot this file in previous commit. Fixes JIT non-UTF bug.
+
+--- a/src/pcre2_jit_compile.c 2019/05/13 16:26:17 1091
++++ b/src/pcre2_jit_compile.c 2019/05/13 16:38:18 1092
+@@ -8571,7 +8571,10 @@
+ PCRE2_SPTR bptr;
+ uint32_t c;
+
+-GETCHARINC(c, cc);
++/* Patch by PH */
++/* GETCHARINC(c, cc); */
++
++c = *cc++;
+ #if PCRE2_CODE_UNIT_WIDTH == 32
+ if (c >= 0x110000)
+ return NULL;
diff --git a/system/python3/APKBUILD b/system/python3/APKBUILD
index b8c72f3a7..e875d3941 100644
--- a/system/python3/APKBUILD
+++ b/system/python3/APKBUILD
@@ -1,7 +1,7 @@
# Contributor: Kiyoshi Aman <adelie@aerdan.vulpine.house>
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=python3
-pkgver=3.6.9
+pkgver=3.6.10
_basever="${pkgver%.*}"
pkgrel=2
pkgdesc="A high-level scripting language"
@@ -40,8 +40,7 @@ makedepends="expat-dev openssl-dev zlib-dev ncurses-dev bzip2-dev xz-dev
source="https://www.python.org/ftp/python/$pkgver/Python-$pkgver.tar.xz
musl-find_library.patch
fix-xattrs-glibc.patch
- CVE-2019-16056.patch
- CVE-2019-16935.patch
+ CVE-2019-18348.patch
"
builddir="$srcdir/Python-$pkgver"
@@ -63,6 +62,8 @@ builddir="$srcdir/Python-$pkgver"
# - CVE-2019-16056
# 3.6.9-r2:
# - CVE-2019-16935
+# 3.6.10-r0:
+# - CVE-2019-18348
prepare() {
default_prepare
@@ -153,11 +154,14 @@ EOF
}
package() {
+ export XDG_CACHE_HOME="$(mktemp -d)"
make -j1 DESTDIR="$pkgdir" EXTRA_CFLAGS="$CFLAGS" install maninstall
install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
# those are provided by python3-tkinter
rm -r "$pkgdir"/usr/bin/idle* "$pkgdir"/usr/lib/python*/idlelib \
"$pkgdir"/usr/lib/python*/tkinter
+
+ rm -rf "$XDG_CACHE_HOME"
}
dev() {
@@ -189,8 +193,7 @@ wininst() {
"$subpkgdir"/usr/lib/python$_basever/distutils/command
}
-sha512sums="05de9c6f44d96a52bfce10ede4312de892573edaf8bece65926d19973a3a800d65eed7a857af945f69efcfb25efa3788e7a54016b03d80b611eb51c3ea074819 Python-3.6.9.tar.xz
+sha512sums="26147099e1f1a0ffc85febad26e18e991f019599a150887ea0b925e34663fad8e03b3c2a941e2770c1a63960695e173ef32709572c9361e7f2cb862ccf75b28a Python-3.6.10.tar.xz
ab8eaa2858d5109049b1f9f553198d40e0ef8d78211ad6455f7b491af525bffb16738fed60fc84e960c4889568d25753b9e4a1494834fea48291b33f07000ec2 musl-find_library.patch
37b6ee5d0d5de43799316aa111423ba5a666c17dc7f81b04c330f59c1d1565540eac4c585abe2199bbed52ebe7426001edb1c53bd0a17486a2a8e052d0f494ad fix-xattrs-glibc.patch
-1f1eb61355eb7832bef8e9c3915895cc3b2966a30c809371430b4416260452cd39c48ba593b2259574867bd1e8fea98efbc45c4b0bd95aeb0690c8514b380ea0 CVE-2019-16056.patch
-7f94d887c81f79d90afd4a9621547c13cbdd0232250f62a686b26a63160a4d286a6db9b342d06b9b63af64f994835b489c37bab499a2093c3c2585dc7a04d8a1 CVE-2019-16935.patch"
+7a15409165feb60358455b711f978b7b1c4dea9ad53aa7b5be07c1f70262988e592e7a630f83125f37051bbed14d14b66d2acd775234a163ff5b048621b9a59c CVE-2019-18348.patch"
diff --git a/system/python3/CVE-2019-16056.patch b/system/python3/CVE-2019-16056.patch
deleted file mode 100644
index b2f5ce826..000000000
--- a/system/python3/CVE-2019-16056.patch
+++ /dev/null
@@ -1,131 +0,0 @@
-From 13a19139b5e76175bc95294d54afc9425e4f36c9 Mon Sep 17 00:00:00 2001
-From: "Miss Islington (bot)"
- <31488909+miss-islington@users.noreply.github.com>
-Date: Fri, 9 Aug 2019 08:22:19 -0700
-Subject: [PATCH] bpo-34155: Dont parse domains containing @ (GH-13079)
- (GH-14826)
-
-Before:
-
- >>> email.message_from_string('From: a@malicious.org@important.com', policy=email.policy.default)['from'].addresses
- (Address(display_name='', username='a', domain='malicious.org'),)
-
- >>> parseaddr('a@malicious.org@important.com')
- ('', 'a@malicious.org')
-
- After:
-
- >>> email.message_from_string('From: a@malicious.org@important.com', policy=email.policy.default)['from'].addresses
- (Address(display_name='', username='', domain=''),)
-
- >>> parseaddr('a@malicious.org@important.com')
- ('', 'a@')
-
-https://bugs.python.org/issue34155
-(cherry picked from commit 8cb65d1381b027f0b09ee36bfed7f35bb4dec9a9)
-
-Co-authored-by: jpic <jpic@users.noreply.github.com>
----
- Lib/email/_header_value_parser.py | 2 ++
- Lib/email/_parseaddr.py | 11 ++++++++++-
- Lib/test/test_email/test__header_value_parser.py | 10 ++++++++++
- Lib/test/test_email/test_email.py | 14 ++++++++++++++
- .../2019-05-04-13-33-37.bpo-34155.MJll68.rst | 1 +
- 5 files changed, 37 insertions(+), 1 deletion(-)
- create mode 100644 Misc/NEWS.d/next/Security/2019-05-04-13-33-37.bpo-34155.MJll68.rst
-
-diff --git a/Lib/email/_header_value_parser.py b/Lib/email/_header_value_parser.py
-index 737951e4b1b1..bc9c9b6241d4 100644
---- a/Lib/email/_header_value_parser.py
-+++ b/Lib/email/_header_value_parser.py
-@@ -1561,6 +1561,8 @@ def get_domain(value):
- token, value = get_dot_atom(value)
- except errors.HeaderParseError:
- token, value = get_atom(value)
-+ if value and value[0] == '@':
-+ raise errors.HeaderParseError('Invalid Domain')
- if leader is not None:
- token[:0] = [leader]
- domain.append(token)
-diff --git a/Lib/email/_parseaddr.py b/Lib/email/_parseaddr.py
-index cdfa3729adc7..41ff6f8c000d 100644
---- a/Lib/email/_parseaddr.py
-+++ b/Lib/email/_parseaddr.py
-@@ -379,7 +379,12 @@ def getaddrspec(self):
- aslist.append('@')
- self.pos += 1
- self.gotonext()
-- return EMPTYSTRING.join(aslist) + self.getdomain()
-+ domain = self.getdomain()
-+ if not domain:
-+ # Invalid domain, return an empty address instead of returning a
-+ # local part to denote failed parsing.
-+ return EMPTYSTRING
-+ return EMPTYSTRING.join(aslist) + domain
-
- def getdomain(self):
- """Get the complete domain name from an address."""
-@@ -394,6 +399,10 @@ def getdomain(self):
- elif self.field[self.pos] == '.':
- self.pos += 1
- sdlist.append('.')
-+ elif self.field[self.pos] == '@':
-+ # bpo-34155: Don't parse domains with two `@` like
-+ # `a@malicious.org@important.com`.
-+ return EMPTYSTRING
- elif self.field[self.pos] in self.atomends:
- break
- else:
-diff --git a/Lib/test/test_email/test__header_value_parser.py b/Lib/test/test_email/test__header_value_parser.py
-index a2c900fa7fd2..02ef3e1006c6 100644
---- a/Lib/test/test_email/test__header_value_parser.py
-+++ b/Lib/test/test_email/test__header_value_parser.py
-@@ -1418,6 +1418,16 @@ def test_get_addr_spec_dot_atom(self):
- self.assertEqual(addr_spec.domain, 'example.com')
- self.assertEqual(addr_spec.addr_spec, 'star.a.star@example.com')
-
-+ def test_get_addr_spec_multiple_domains(self):
-+ with self.assertRaises(errors.HeaderParseError):
-+ parser.get_addr_spec('star@a.star@example.com')
-+
-+ with self.assertRaises(errors.HeaderParseError):
-+ parser.get_addr_spec('star@a@example.com')
-+
-+ with self.assertRaises(errors.HeaderParseError):
-+ parser.get_addr_spec('star@172.17.0.1@example.com')
-+
- # get_obs_route
-
- def test_get_obs_route_simple(self):
-diff --git a/Lib/test/test_email/test_email.py b/Lib/test/test_email/test_email.py
-index f97ccc6711cc..68d052279987 100644
---- a/Lib/test/test_email/test_email.py
-+++ b/Lib/test/test_email/test_email.py
-@@ -3035,6 +3035,20 @@ def test_parseaddr_empty(self):
- self.assertEqual(utils.parseaddr('<>'), ('', ''))
- self.assertEqual(utils.formataddr(utils.parseaddr('<>')), '')
-
-+ def test_parseaddr_multiple_domains(self):
-+ self.assertEqual(
-+ utils.parseaddr('a@b@c'),
-+ ('', '')
-+ )
-+ self.assertEqual(
-+ utils.parseaddr('a@b.c@c'),
-+ ('', '')
-+ )
-+ self.assertEqual(
-+ utils.parseaddr('a@172.17.0.1@c'),
-+ ('', '')
-+ )
-+
- def test_noquote_dump(self):
- self.assertEqual(
- utils.formataddr(('A Silly Person', 'person@dom.ain')),
-diff --git a/Misc/NEWS.d/next/Security/2019-05-04-13-33-37.bpo-34155.MJll68.rst b/Misc/NEWS.d/next/Security/2019-05-04-13-33-37.bpo-34155.MJll68.rst
-new file mode 100644
-index 000000000000..50292e29ed1d
---- /dev/null
-+++ b/Misc/NEWS.d/next/Security/2019-05-04-13-33-37.bpo-34155.MJll68.rst
-@@ -0,0 +1 @@
-+Fix parsing of invalid email addresses with more than one ``@`` (e.g. a@b@c.com.) to not return the part before 2nd ``@`` as valid email address. Patch by maxking & jpic.
diff --git a/system/python3/CVE-2019-16935.patch b/system/python3/CVE-2019-16935.patch
deleted file mode 100644
index 567eb90fc..000000000
--- a/system/python3/CVE-2019-16935.patch
+++ /dev/null
@@ -1,80 +0,0 @@
-From 1698cacfb924d1df452e78d11a4bf81ae7777389 Mon Sep 17 00:00:00 2001
-From: Victor Stinner <vstinner@redhat.com>
-Date: Sat, 28 Sep 2019 09:33:00 +0200
-Subject: [PATCH] bpo-38243, xmlrpc.server: Escape the server_title (GH-16373)
- (GH-16441)
-
-Escape the server title of xmlrpc.server.DocXMLRPCServer
-when rendering the document page as HTML.
-
-(cherry picked from commit e8650a4f8c7fb76f570d4ca9c1fbe44e91c8dfaa)
----
- Lib/test/test_docxmlrpc.py | 16 ++++++++++++++++
- Lib/xmlrpc/server.py | 3 ++-
- .../2019-09-25-13-21-09.bpo-38243.1pfz24.rst | 3 +++
- 3 files changed, 21 insertions(+), 1 deletion(-)
- create mode 100644 Misc/NEWS.d/next/Security/2019-09-25-13-21-09.bpo-38243.1pfz24.rst
-
-diff --git a/Lib/test/test_docxmlrpc.py b/Lib/test/test_docxmlrpc.py
-index 00903337c07c2..d2adb21af0fb3 100644
---- a/Lib/test/test_docxmlrpc.py
-+++ b/Lib/test/test_docxmlrpc.py
-@@ -1,5 +1,6 @@
- from xmlrpc.server import DocXMLRPCServer
- import http.client
-+import re
- import sys
- from test import support
- threading = support.import_module('threading')
-@@ -193,6 +194,21 @@ def test_annotations(self):
- b'method_annotation</strong></a>(x: bytes)</dt></dl>'),
- response.read())
-
-+ def test_server_title_escape(self):
-+ # bpo-38243: Ensure that the server title and documentation
-+ # are escaped for HTML.
-+ self.serv.set_server_title('test_title<script>')
-+ self.serv.set_server_documentation('test_documentation<script>')
-+ self.assertEqual('test_title<script>', self.serv.server_title)
-+ self.assertEqual('test_documentation<script>',
-+ self.serv.server_documentation)
-+
-+ generated = self.serv.generate_html_documentation()
-+ title = re.search(r'<title>(.+?)</title>', generated).group()
-+ documentation = re.search(r'<p><tt>(.+?)</tt></p>', generated).group()
-+ self.assertEqual('<title>Python: test_title&lt;script&gt;</title>', title)
-+ self.assertEqual('<p><tt>test_documentation&lt;script&gt;</tt></p>', documentation)
-+
-
- if __name__ == '__main__':
- unittest.main()
-diff --git a/Lib/xmlrpc/server.py b/Lib/xmlrpc/server.py
-index 3e0dca027f068..efe593748968c 100644
---- a/Lib/xmlrpc/server.py
-+++ b/Lib/xmlrpc/server.py
-@@ -106,6 +106,7 @@ def export_add(self, x, y):
-
- from xmlrpc.client import Fault, dumps, loads, gzip_encode, gzip_decode
- from http.server import BaseHTTPRequestHandler
-+import html
- import http.server
- import socketserver
- import sys
-@@ -904,7 +905,7 @@ def generate_html_documentation(self):
- methods
- )
-
-- return documenter.page(self.server_title, documentation)
-+ return documenter.page(html.escape(self.server_title), documentation)
-
- class DocXMLRPCRequestHandler(SimpleXMLRPCRequestHandler):
- """XML-RPC and documentation request handler class.
-diff --git a/Misc/NEWS.d/next/Security/2019-09-25-13-21-09.bpo-38243.1pfz24.rst b/Misc/NEWS.d/next/Security/2019-09-25-13-21-09.bpo-38243.1pfz24.rst
-new file mode 100644
-index 0000000000000..98d7be129573a
---- /dev/null
-+++ b/Misc/NEWS.d/next/Security/2019-09-25-13-21-09.bpo-38243.1pfz24.rst
-@@ -0,0 +1,3 @@
-+Escape the server title of :class:`xmlrpc.server.DocXMLRPCServer`
-+when rendering the document page as HTML.
-+(Contributed by Dong-hee Na in :issue:`38243`.)
diff --git a/system/python3/CVE-2019-18348.patch b/system/python3/CVE-2019-18348.patch
new file mode 100644
index 000000000..9ebb963a8
--- /dev/null
+++ b/system/python3/CVE-2019-18348.patch
@@ -0,0 +1,147 @@
+From 83fc70159b24f5b11a5ef87c9b05c2cf4c7faeba Mon Sep 17 00:00:00 2001
+From: "Miss Islington (bot)"
+ <31488909+miss-islington@users.noreply.github.com>
+Date: Sat, 14 Mar 2020 15:35:52 -0700
+Subject: [PATCH] bpo-38576: Disallow control characters in hostnames in
+ http.client (GH-18995) (GH-19002)
+
+Add host validation for control characters for more CVE-2019-18348 protection.
+(cherry picked from commit 9165addc22d05e776a54319a8531ebd0b2fe01ef)
+
+Co-authored-by: Ashwin Ramaswami <aramaswamis@gmail.com>
+---
+ Lib/http/client.py | 10 ++++++
+ Lib/test/test_httplib.py | 13 ++++++-
+ Lib/test/test_urllib.py | 36 +++++++++++++++++--
+ .../2020-03-14-14-57-44.bpo-38576.OowwQn.rst | 1 +
+ 4 files changed, 57 insertions(+), 3 deletions(-)
+ create mode 100644 Misc/NEWS.d/next/Security/2020-03-14-14-57-44.bpo-38576.OowwQn.rst
+
+diff --git a/Lib/http/client.py b/Lib/http/client.py
+index d4821f1a96e07..c0ac7db6f40a0 100644
+--- a/Lib/http/client.py
++++ b/Lib/http/client.py
+@@ -858,6 +858,8 @@ def __init__(self, host, port=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
+
+ (self.host, self.port) = self._get_hostport(host, port)
+
++ self._validate_host(self.host)
++
+ # This is stored as an instance variable to allow unit
+ # tests to replace it with a suitable mockup
+ self._create_connection = socket.create_connection
+@@ -1215,6 +1217,14 @@ def _validate_path(self, url):
+ raise InvalidURL(f"URL can't contain control characters. {url!r} "
+ f"(found at least {match.group()!r})")
+
++ def _validate_host(self, host):
++ """Validate a host so it doesn't contain control characters."""
++ # Prevent CVE-2019-18348.
++ match = _contains_disallowed_url_pchar_re.search(host)
++ if match:
++ raise InvalidURL(f"URL can't contain control characters. {host!r} "
++ f"(found at least {match.group()!r})")
++
+ def putheader(self, header, *values):
+ """Send a request header line to the server.
+
+diff --git a/Lib/test/test_httplib.py b/Lib/test/test_httplib.py
+index 14d42d483773c..fcd9231666ede 100644
+--- a/Lib/test/test_httplib.py
++++ b/Lib/test/test_httplib.py
+@@ -1132,7 +1132,7 @@ def run_server():
+ thread.join()
+ self.assertEqual(result, b"proxied data\n")
+
+- def test_putrequest_override_validation(self):
++ def test_putrequest_override_domain_validation(self):
+ """
+ It should be possible to override the default validation
+ behavior in putrequest (bpo-38216).
+@@ -1145,6 +1145,17 @@ def _validate_path(self, url):
+ conn.sock = FakeSocket('')
+ conn.putrequest('GET', '/\x00')
+
++ def test_putrequest_override_host_validation(self):
++ class UnsafeHTTPConnection(client.HTTPConnection):
++ def _validate_host(self, url):
++ pass
++
++ conn = UnsafeHTTPConnection('example.com\r\n')
++ conn.sock = FakeSocket('')
++ # set skip_host so a ValueError is not raised upon adding the
++ # invalid URL as the value of the "Host:" header
++ conn.putrequest('GET', '/', skip_host=1)
++
+ def test_putrequest_override_encoding(self):
+ """
+ It should be possible to override the default encoding
+diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py
+index 0061a5297cb35..ddf425fd8d4b5 100644
+--- a/Lib/test/test_urllib.py
++++ b/Lib/test/test_urllib.py
+@@ -331,7 +331,7 @@ def test_willclose(self):
+ self.unfakehttp()
+
+ @unittest.skipUnless(ssl, "ssl module required")
+- def test_url_with_control_char_rejected(self):
++ def test_url_path_with_control_char_rejected(self):
+ for char_no in list(range(0, 0x21)) + [0x7f]:
+ char = chr(char_no)
+ schemeless_url = f"//localhost:7777/test{char}/"
+@@ -358,7 +358,7 @@ def test_url_with_control_char_rejected(self):
+ self.unfakehttp()
+
+ @unittest.skipUnless(ssl, "ssl module required")
+- def test_url_with_newline_header_injection_rejected(self):
++ def test_url_path_with_newline_header_injection_rejected(self):
+ self.fakehttp(b"HTTP/1.1 200 OK\r\n\r\nHello.")
+ host = "localhost:7777?a=1 HTTP/1.1\r\nX-injected: header\r\nTEST: 123"
+ schemeless_url = "//" + host + ":8080/test/?test=a"
+@@ -383,6 +383,38 @@ def test_url_with_newline_header_injection_rejected(self):
+ finally:
+ self.unfakehttp()
+
++ @unittest.skipUnless(ssl, "ssl module required")
++ def test_url_host_with_control_char_rejected(self):
++ for char_no in list(range(0, 0x21)) + [0x7f]:
++ char = chr(char_no)
++ schemeless_url = f"//localhost{char}/test/"
++ self.fakehttp(b"HTTP/1.1 200 OK\r\n\r\nHello.")
++ try:
++ escaped_char_repr = repr(char).replace('\\', r'\\')
++ InvalidURL = http.client.InvalidURL
++ with self.assertRaisesRegex(
++ InvalidURL, f"contain control.*{escaped_char_repr}"):
++ urlopen(f"http:{schemeless_url}")
++ with self.assertRaisesRegex(InvalidURL, f"contain control.*{escaped_char_repr}"):
++ urlopen(f"https:{schemeless_url}")
++ finally:
++ self.unfakehttp()
++
++ @unittest.skipUnless(ssl, "ssl module required")
++ def test_url_host_with_newline_header_injection_rejected(self):
++ self.fakehttp(b"HTTP/1.1 200 OK\r\n\r\nHello.")
++ host = "localhost\r\nX-injected: header\r\n"
++ schemeless_url = "//" + host + ":8080/test/?test=a"
++ try:
++ InvalidURL = http.client.InvalidURL
++ with self.assertRaisesRegex(
++ InvalidURL, r"contain control.*\\r"):
++ urlopen(f"http:{schemeless_url}")
++ with self.assertRaisesRegex(InvalidURL, r"contain control.*\\n"):
++ urlopen(f"https:{schemeless_url}")
++ finally:
++ self.unfakehttp()
++
+ def test_read_0_9(self):
+ # "0.9" response accepted (but not "simple responses" without
+ # a status line)
+diff --git a/Misc/NEWS.d/next/Security/2020-03-14-14-57-44.bpo-38576.OowwQn.rst b/Misc/NEWS.d/next/Security/2020-03-14-14-57-44.bpo-38576.OowwQn.rst
+new file mode 100644
+index 0000000000000..34b8af28988fa
+--- /dev/null
++++ b/Misc/NEWS.d/next/Security/2020-03-14-14-57-44.bpo-38576.OowwQn.rst
+@@ -0,0 +1 @@
++Disallow control characters in hostnames in http.client, addressing CVE-2019-18348. Such potentially malicious header injection URLs now cause a InvalidURL to be raised.
+\ No newline at end of file
diff --git a/system/sqlite/APKBUILD b/system/sqlite/APKBUILD
index 0a3e367c1..e8db13ba0 100644
--- a/system/sqlite/APKBUILD
+++ b/system/sqlite/APKBUILD
@@ -1,20 +1,37 @@
# Contributor: Łukasz Jendrysik <scadu@yandex.com>
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=sqlite
-pkgver=3.30.1
+pkgver=3.31.1
_pkgver=${pkgver%.*}0${pkgver#*.*.}00
_pkgver=${_pkgver%.*}${_pkgver#*.}
pkgrel=0
pkgdesc="C library that implements an SQL database engine"
url="https://sqlite.org/"
arch="all"
+options="!check" # Test suite requires tcl - circular dependency
license="Public-Domain"
depends=""
makedepends="libedit-dev zlib-dev"
-source="https://sqlite.org/2019/$pkgname-autoconf-$_pkgver.tar.gz"
+source="https://sqlite.org/2020/$pkgname-autoconf-$_pkgver.tar.gz"
subpackages="$pkgname-doc $pkgname-dev $pkgname-libs"
builddir="$srcdir/$pkgname-autoconf-$_pkgver"
+# secfixes:
+# 3.31.1-r0:
+# - CVE-2019-19242
+# - CVE-2019-19244
+# - CVE-2019-19317
+# - CVE-2019-19603
+# - CVE-2019-19645
+# - CVE-2019-19646
+# - CVE-2019-19880
+# - CVE-2019-19923
+# - CVE-2019-19924
+# - CVE-2019-19925
+# - CVE-2019-19926
+# - CVE-2019-19959
+# - CVE-2019-20218
+
build() {
local _amalgamation="-DSQLITE_ENABLE_FTS4 \
-DSQLITE_ENABLE_FTS3 \
@@ -61,4 +78,4 @@ libs() {
mv "$pkgdir"/usr/lib "$subpkgdir"/usr/
}
-sha512sums="9ec0283c417fb0323b0e43550af2a49e9a63988e4212c27ea62cc9da3534caa6faf5bdc7e051b6772c4ce61560a433b3d3288b68e05e9ba8495f61a3bcebda3e sqlite-autoconf-3300100.tar.gz"
+sha512sums="d85250ba5f78f0c918880f663741709aba662192f04888b2324a0df17affdf5b8540e8428c6c7315119806e7adad758ea281c9b403c0ad94ac6a9bd1b93fd617 sqlite-autoconf-3310100.tar.gz"