From e82c98abe93c749296c831691c7c67c736f0807f Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Wed, 9 Jan 2019 15:37:44 -0500 Subject: gnu: aria2: Fix CVE-2019-3500. * gnu/packages/patches/aria2-CVE-2019-3500.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/bittorrent.scm (aria2)[source]: Use it. --- gnu/local.mk | 1 + gnu/packages/bittorrent.scm | 1 + gnu/packages/patches/aria2-CVE-2019-3500.patch | 55 ++++++++++++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 gnu/packages/patches/aria2-CVE-2019-3500.patch (limited to 'gnu') diff --git a/gnu/local.mk b/gnu/local.mk index bc54b61c21..6344144f08 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -586,6 +586,7 @@ dist_patch_DATA = \ %D%/packages/patches/antlr3-3_3-fix-java8-compilation.patch \ %D%/packages/patches/ao-cad-aarch64-support.patch \ %D%/packages/patches/apr-skip-getservbyname-test.patch \ + %D%/packages/patches/aria2-CVE-2019-3500.patch \ %D%/packages/patches/aspell-default-dict-dir.patch \ %D%/packages/patches/ath9k-htc-firmware-binutils.patch \ %D%/packages/patches/ath9k-htc-firmware-gcc.patch \ diff --git a/gnu/packages/bittorrent.scm b/gnu/packages/bittorrent.scm index e834ba3d2a..ee094a4814 100644 --- a/gnu/packages/bittorrent.scm +++ b/gnu/packages/bittorrent.scm @@ -264,6 +264,7 @@ maintained upstream.") (uri (string-append "https://github.com/tatsuhiro-t/aria2/" "releases/download/release-" version "/" name "-" version ".tar.xz")) + (patches (search-patches "aria2-CVE-2019-3500.patch")) (sha256 (base32 "18vpgr430vxlwbcc3598rr1srfmwypls6wp1m4wf21hncc1ahi1s")))) diff --git a/gnu/packages/patches/aria2-CVE-2019-3500.patch b/gnu/packages/patches/aria2-CVE-2019-3500.patch new file mode 100644 index 0000000000..891c9047ba --- /dev/null +++ b/gnu/packages/patches/aria2-CVE-2019-3500.patch @@ -0,0 +1,55 @@ +Fix CVE-2019-3500: + +https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-3500 +https://github.com/aria2/aria2/issues/1329 + +Patch copied from upstream source repository: + +https://github.com/aria2/aria2/commit/37368130ca7de5491a75fd18a20c5c5cc641824a + +From 37368130ca7de5491a75fd18a20c5c5cc641824a Mon Sep 17 00:00:00 2001 +From: Tatsuhiro Tsujikawa +Date: Sat, 5 Jan 2019 09:32:40 +0900 +Subject: [PATCH] Mask headers + +--- + src/HttpConnection.cc | 18 ++++++++++++------ + 1 file changed, 12 insertions(+), 6 deletions(-) + +diff --git a/src/HttpConnection.cc b/src/HttpConnection.cc +index 77cb9d27a..be5b97723 100644 +--- a/src/HttpConnection.cc ++++ b/src/HttpConnection.cc +@@ -102,11 +102,17 @@ std::string HttpConnection::eraseConfidentialInfo(const std::string& request) + std::string result; + std::string line; + while (getline(istr, line)) { +- if (util::startsWith(line, "Authorization: Basic")) { +- result += "Authorization: Basic ********\n"; ++ if (util::istartsWith(line, "Authorization: ")) { ++ result += "Authorization: \n"; + } +- else if (util::startsWith(line, "Proxy-Authorization: Basic")) { +- result += "Proxy-Authorization: Basic ********\n"; ++ else if (util::istartsWith(line, "Proxy-Authorization: ")) { ++ result += "Proxy-Authorization: \n"; ++ } ++ else if (util::istartsWith(line, "Cookie: ")) { ++ result += "Cookie: \n"; ++ } ++ else if (util::istartsWith(line, "Set-Cookie: ")) { ++ result += "Set-Cookie: \n"; + } + else { + result += line; +@@ -154,8 +160,8 @@ std::unique_ptr HttpConnection::receiveResponse() + const auto& proc = outstandingHttpRequests_.front()->getHttpHeaderProcessor(); + if (proc->parse(socketRecvBuffer_->getBuffer(), + socketRecvBuffer_->getBufferLength())) { +- A2_LOG_INFO( +- fmt(MSG_RECEIVE_RESPONSE, cuid_, proc->getHeaderString().c_str())); ++ A2_LOG_INFO(fmt(MSG_RECEIVE_RESPONSE, cuid_, ++ eraseConfidentialInfo(proc->getHeaderString()).c_str())); + auto result = proc->getResult(); + if (result->getStatusCode() / 100 == 1) { + socketRecvBuffer_->drain(proc->getLastBytesProcessed()); -- cgit v1.2.3