public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Michal Ruprich <mruprich@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/wget1] f45: Fix for CVE-2026-16599, Use gnutls for NTLM crypto
Date: Mon, 14 Sep 2026 18:30:28 GMT [thread overview]
Message-ID: <178941062825.1.15941511695889829148.rpms-wget1-092ee65c63c2@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/wget1
Branch : f45
Commit : 092ee65c63c2baa1f67c3e0fb5aab1e510ce2462
Author : Michal Ruprich <mruprich@redhat.com>
Date : 2026-09-14T16:17:53+02:00
Stats : +222/-1 in 3 file(s)
URL : https://src.fedoraproject.org/rpms/wget1/c/092ee65c63c2baa1f67c3e0fb5aab1e510ce2462?branch=f45
Log:
Fix for CVE-2026-16599, Use gnutls for NTLM crypto
---
diff --git a/wget-1.24.5-no-nettle.patch b/wget-1.24.5-no-nettle.patch
new file mode 100644
index 0000000..8d25624
--- /dev/null
+++ b/wget-1.24.5-no-nettle.patch
@@ -0,0 +1,153 @@
+From 9476ce232a3dcadc205e963eb69a567f478fde95 Mon Sep 17 00:00:00 2001
+From: rpm-build <rpm-build>
+Date: Wed, 11 Dec 2024 17:14:58 +0900
+Subject: [PATCH] wget-1.24.5-no-nettle.patch
+
+---
+ src/http-ntlm.c | 91 ++++++++++++++++++++++++++++++++++++-------------
+ 1 file changed, 68 insertions(+), 23 deletions(-)
+
+diff --git a/src/http-ntlm.c b/src/http-ntlm.c
+index ee054e0..9f5b50e 100644
+--- a/src/http-ntlm.c
++++ b/src/http-ntlm.c
+@@ -44,13 +44,14 @@ as that of the covered work. */
+
+ #include "utils.h"
+ #include "http-ntlm.h"
++#include "md4.h"
+
+-#ifdef HAVE_NETTLE
+-# include <nettle/md4.h>
++#ifdef HAVE_LIBGNUTLS
++# include <gnutls/crypto.h>
++#elif defined HAVE_NETTLE
+ # include <nettle/des.h>
+ #else
+ # include <openssl/des.h>
+-# include <openssl/md4.h>
+ # include <openssl/opensslv.h>
+
+ # if OPENSSL_VERSION_NUMBER < 0x00907001L
+@@ -164,7 +165,31 @@ ntlm_input (struct ntlmdata *ntlm, const char *header)
+ * Turns a 56 bit key into the 64 bit, odd parity key and sets the key. The
+ * key schedule ks is also set.
+ */
+-#ifdef HAVE_NETTLE
++#ifdef HAVE_LIBGNUTLS
++static void
++setup_des_key(unsigned char *key_56,
++ gnutls_cipher_hd_t *des)
++{
++ unsigned char key[8];
++ gnutls_datum_t _key;
++ int ret;
++
++ key[0] = key_56[0];
++ key[1] = ((key_56[0] << 7) & 0xFF) | (key_56[1] >> 1);
++ key[2] = ((key_56[1] << 6) & 0xFF) | (key_56[2] >> 2);
++ key[3] = ((key_56[2] << 5) & 0xFF) | (key_56[3] >> 3);
++ key[4] = ((key_56[3] << 4) & 0xFF) | (key_56[4] >> 4);
++ key[5] = ((key_56[4] << 3) & 0xFF) | (key_56[5] >> 5);
++ key[6] = ((key_56[5] << 2) & 0xFF) | (key_56[6] >> 6);
++ key[7] = (key_56[6] << 1) & 0xFF;
++
++ _key.data = key;
++ _key.size = sizeof(key);
++ ret = gnutls_cipher_init(des, GNUTLS_CIPHER_DES_CBC, &_key, NULL);
++ if (ret < 0)
++ abort ();
++}
++#elif defined HAVE_NETTLE
+ static void
+ setup_des_key(unsigned char *key_56,
+ struct des_ctx *des)
+@@ -211,7 +236,28 @@ setup_des_key(unsigned char *key_56,
+ static void
+ calc_resp(unsigned char *keys, unsigned char *plaintext, unsigned char *results)
+ {
+-#ifdef HAVE_NETTLE
++#ifdef HAVE_LIBGNUTLS
++ gnutls_cipher_hd_t des;
++ int ret;
++
++ setup_des_key(keys, &des);
++ ret = gnutls_cipher_encrypt2(des, plaintext, 8, results, 8);
++ if (ret < 0)
++ abort ();
++ gnutls_cipher_deinit(des);
++
++ setup_des_key(keys + 7, &des);
++ ret = gnutls_cipher_encrypt2(des, plaintext, 8, results + 8, 8);
++ if (ret < 0)
++ abort ();
++ gnutls_cipher_deinit(des);
++
++ setup_des_key(keys + 14, &des);
++ ret = gnutls_cipher_encrypt2(des, plaintext, 8, results + 16, 8);
++ if (ret < 0)
++ abort ();
++ gnutls_cipher_deinit(des);
++#elif defined HAVE_NETTLE
+ struct des_ctx des;
+
+ setup_des_key(keys, &des);
+@@ -274,7 +320,22 @@ mkhash(const char *password,
+
+ {
+ /* create LanManager hashed password */
+-#ifdef HAVE_NETTLE
++#ifdef HAVE_LIBGNUTLS
++ gnutls_cipher_hd_t des;
++ int ret;
++
++ setup_des_key(pw, &des);
++ ret = gnutls_cipher_encrypt2(des, magic, 8, lmbuffer, 8);
++ if (ret < 0)
++ abort ();
++ gnutls_cipher_deinit(des);
++
++ setup_des_key(pw + 7, &des);
++ ret = gnutls_cipher_encrypt2(des, magic, 8, lmbuffer + 8, 8);
++ if (ret < 0)
++ abort ();
++ gnutls_cipher_deinit(des);
++#elif defined HAVE_NETTLE
+ struct des_ctx des;
+
+ setup_des_key(pw, &des);
+@@ -301,12 +362,6 @@ mkhash(const char *password,
+
+ #ifdef USE_NTRESPONSES
+ {
+-#ifdef HAVE_NETTLE
+- struct md4_ctx MD4;
+-#else
+- MD4_CTX MD4;
+-#endif
+-
+ unsigned char pw4[64];
+
+ len = strlen (password);
+@@ -319,17 +374,7 @@ mkhash(const char *password,
+ pw4[2 * i + 1] = 0;
+ }
+
+-#ifdef HAVE_NETTLE
+- nettle_md4_init(&MD4);
+- nettle_md4_update(&MD4, (unsigned) (2 * len), pw4);
+- nettle_md4_digest(&MD4, MD4_DIGEST_SIZE, ntbuffer);
+-#else
+- /* create NT hashed password */
+- MD4_Init(&MD4);
+- MD4_Update(&MD4, pw4, 2 * len);
+- MD4_Final(ntbuffer, &MD4);
+-#endif
+-
++ md4_buffer((const char *) pw4, (unsigned) (2 * len), ntbuffer);
+ memset(ntbuffer + 16, 0, 5);
+ }
+
+--
+2.47.0
+
diff --git a/wget-1.25-fix-cve-2026-16599.patch b/wget-1.25-fix-cve-2026-16599.patch
new file mode 100644
index 0000000..14acbb0
--- /dev/null
+++ b/wget-1.25-fix-cve-2026-16599.patch
@@ -0,0 +1,62 @@
+From e9697d98e7249b0f68a6be040a4f3dcc5bc101fa Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Tim=20R=C3=BChsen?= <tim.ruehsen@gmx.de>
+Date: Sat, 20 Jun 2026 14:39:54 +0200
+Subject: [PATCH] Fix server-controlled unbounded MD5 loop in FTP OPIE
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+* src/ftp-basic.c (ftp_login): Limit the skey sequence to 9999.
+
+Report:
+wget accepts an unbounded server-controlled integer as the iteration
+count for its OPIE/S-KEY MD5 key-derivation loop. No upper bound is
+enforced on the sequence number supplied by the server in the FTP
+challenge line. The value is passed directly to skey_response() as a
+loop counter, causing wget to perform up to ~2.1 billion full MD5
+computations before responding to the authentication challenge.
+
+Reported-by: Michał Majchrowicz and Marcin Wyczechowski
+---
+ src/ftp-basic.c | 15 +++++++++++----
+ 1 file changed, 11 insertions(+), 4 deletions(-)
+
+diff --git a/src/ftp-basic.c b/src/ftp-basic.c
+index 0f4bb821..af38a69a 100644
+--- a/src/ftp-basic.c
++++ b/src/ftp-basic.c
+@@ -204,12 +204,11 @@ ftp_login (int csock, const char *acc, const char *pass)
+ "331 s/key ",
+ "331 opiekey "
+ };
+- size_t i;
+ const char *seed = NULL;
+
+- for (i = 0; i < countof (skey_head); i++)
++ for (size_t i = 0; i < countof (skey_head); i++)
+ {
+- int l = strlen (skey_head[i]);
++ size_t l = strlen (skey_head[i]);
+ if (0 == c_strncasecmp (skey_head[i], respline, l))
+ {
+ seed = respline + l;
+@@ -222,7 +221,15 @@ ftp_login (int csock, const char *acc, const char *pass)
+
+ /* Extract the sequence from SEED. */
+ for (; c_isdigit (*seed); seed++)
+- skey_sequence = 10 * skey_sequence + *seed - '0';
++ {
++ skey_sequence = 10 * skey_sequence + *seed - '0';
++ if (skey_sequence > 9999)
++ {
++ xfree (respline);
++ return FTPLOGREFUSED;
++ }
++ }
++
+ if (*seed == ' ')
+ ++seed;
+ else
+--
+GitLab
+
diff --git a/wget1.spec b/wget1.spec
index 812a6a1..e2cc436 100644
--- a/wget1.spec
+++ b/wget1.spec
@@ -1,7 +1,7 @@
Summary: A utility for retrieving files using the HTTP or FTP protocols
Name: wget1
Version: 1.25.0
-Release: 4%{?dist}
+Release: 5%{?dist}
# Generally wget is distributed under GPLv3 or later but there are files in lib/ directory
# which are under LGPLv2.1 or later and are actually built into the resulting rpm.
# This version of wget is built with gnutls so I believe that the 'with openssl'
@@ -15,6 +15,9 @@ Patch2: wget-1.25-fix-cve-2026-15146.patch
Patch3: wget-1.25-fix-cve-2026-58470.patch
Patch4: wget-1.25-fix-cve-2026-58471.patch
Patch5: wget-1.25-fix-cve-2026-58472.patch
+Patch6: wget-1.24.5-no-nettle.patch
+# https://gitlab.com/gnuwget/wget/-/commit/e9697d98
+Patch7: wget-1.25-fix-cve-2026-16599.patch
Provides: bundled(gnulib)
# needed for test suite
@@ -116,6 +119,9 @@ echo ".so man1/%{name}.1" > %{buildroot}%{_mandir}/man1/wget.1
%config(noreplace) %{_sysconfdir}/wgetrc
%changelog
+* Mon Sep 14 2026 Michal Ruprich <mruprich@redhat.com> - 1.25.0-5
+- Fix for CVE-2026-16599, Use gnutls for NTLM crypto
+
* Wed Jul 15 2026 Michal Ruprich <mruprich@redhat.com> - 1.25.0-4
- Fix for CVE-2026-15146, CVE-2026-58470, CVE-2026-58471, CVE-2026-58472
reply other threads:[~2026-09-14 18:30 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=178941062825.1.15941511695889829148.rpms-wget1-092ee65c63c2@fedoraproject.org \
--to=mruprich@redhat.com \
--cc=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox