[packages/libtomcrypt] Rel 4. Fix an out-of-bounds read in der_decode_utf8_string.

arekm arekm at pld-linux.org
Thu Nov 26 09:24:44 CET 2026


commit 79b46605e80afa9ece1b04832df56b76a3606c23
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Thu Nov 26 00:32:01 2026 +0100

    Rel 4. Fix an out-of-bounds read in der_decode_utf8_string.
    
    Fixes CVE-2019-17362.

 libtomcrypt-CVE-2019-17362.patch | 14 ++++++++++++++
 libtomcrypt.spec                 |  4 +++-
 2 files changed, 17 insertions(+), 1 deletion(-)
---
diff --git a/libtomcrypt.spec b/libtomcrypt.spec
index 952a63c..5f95dd7 100644
--- a/libtomcrypt.spec
+++ b/libtomcrypt.spec
@@ -6,13 +6,14 @@ Summary:	LibTomCrypt - fairly comprehensive, modular and portable cryptographic
 Summary(pl.UTF-8):	LibTomCrypt - dość obszerna, modularna i przenośna biblioteka kryptograficzna
 Name:		libtomcrypt
 Version:	1.18.2
-Release:	3
+Release:	4
 License:	Public Domain or WTFPL v2
 Group:		Libraries
 #Source0Download: https://github.com/libtom/libtomcrypt/releases
 Source0:	https://github.com/libtom/libtomcrypt/releases/download/v%{version}/crypt-%{version}.tar.xz
 # Source0-md5:	e8d22351b7c95bef423c1cd02dcf836d
 Patch0:		%{name}-pc.patch
+Patch1:		%{name}-CVE-2019-17362.patch
 URL:		http://www.libtom.net/LibTomCrypt/
 %{?with_ltm:BuildRequires:	libtommath-devel >= 1.0.1}
 BuildRequires:	libtool >= 2:1.5
@@ -64,6 +65,7 @@ Statyczna biblioteka LibTomCrypt.
 %prep
 %setup -q
 %patch -P0 -p1
+%patch -P1 -p1
 
 %build
 # IGNORE_SPEED avoids overriding rpmcflags
diff --git a/libtomcrypt-CVE-2019-17362.patch b/libtomcrypt-CVE-2019-17362.patch
new file mode 100644
index 0000000..9d35aad
--- /dev/null
+++ b/libtomcrypt-CVE-2019-17362.patch
@@ -0,0 +1,14 @@
+# CVE-2019-17362: continuation byte as first UTF-8 byte reads out of bounds
+# https://github.com/libtom/libtomcrypt/commit/25c26a3b7a9ad8192ccc923e15cf62bf0108ef94
+diff --git a/src/pk/asn1/der/utf8/der_decode_utf8_string.c b/src/pk/asn1/der/utf8/der_decode_utf8_string.c
+index 94555b99f..d3ed82bea 100644
+--- a/src/pk/asn1/der/utf8/der_decode_utf8_string.c
++++ b/src/pk/asn1/der/utf8/der_decode_utf8_string.c
+@@ -65,7 +65,7 @@ int der_decode_utf8_string(const unsigned char *in,  unsigned long inlen,
+       /* count number of bytes */
+       for (z = 0; (tmp & 0x80) && (z <= 4); z++, tmp = (tmp << 1) & 0xFF);
+ 
+-      if (z > 4 || (x + (z - 1) > inlen)) {
++      if (z == 1 || z > 4 || (x + (z - 1) > inlen)) {
+          return CRYPT_INVALID_PACKET;
+       }
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/libtomcrypt.git/commitdiff/79b46605e80afa9ece1b04832df56b76a3606c23



More information about the pld-cvs-commit mailing list