public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/proftpd] epel9: Fix buffer overflow in mod_rewrite "utf8trans" RewriteMap (CVE-2026-119146)
@ 2026-11-10 13:05 Paul Howarth
  0 siblings, 0 replies; only message in thread
From: Paul Howarth @ 2026-11-10 13:05 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/proftpd
            Branch : epel9
            Commit : b7e91802807cf52b9e0532d3c45edfd0a231d453
            Author : Paul Howarth <paul@city-fan.org>
            Date   : 2026-11-10T10:34:44+00:00
            Stats  : +65/-0 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/proftpd/c/b7e91802807cf52b9e0532d3c45edfd0a231d453?branch=epel9

            Log:
            Fix buffer overflow in mod_rewrite "utf8trans" RewriteMap (CVE-2026-119146)

Guard against overly-long keys overflowing buffers when the "utf8trans"
builtin RewriteMap type is used.

---
diff --git a/proftpd-1.3.8d-cve-2026-119146.patch b/proftpd-1.3.8d-cve-2026-119146.patch
new file mode 100644
index 0000000..072abfd
--- /dev/null
+++ b/proftpd-1.3.8d-cve-2026-119146.patch
@@ -0,0 +1,57 @@
+From 502d280b8d0ef72e44c6dd0a35a9405af0a1e301 Mon Sep 17 00:00:00 2001
+From: TJ Saunders <tj@castaglia.org>
+Date: Sun, 6 Sep 2026 14:51:15 -0700
+Subject: [PATCH] Guard against overly-long keys overflowing buffers when the
+ "utf8trans" builtin `RewriteMap` type is used.
+
+Thanks to Bruno Henc for reporting this issue.
+---
+ contrib/mod_rewrite.c | 21 ++++++++++++++++++---
+ 1 file changed, 18 insertions(+), 3 deletions(-)
+
+diff --git a/contrib/mod_rewrite.c b/contrib/mod_rewrite.c
+index 2d205f2eba..2afb4b9d07 100644
+--- a/contrib/mod_rewrite.c
++++ b/contrib/mod_rewrite.c
+@@ -1686,9 +1686,10 @@ static char rewrite_hex_to_char(const char *what) {
+  */
+ static int rewrite_utf8_to_ucs4(unsigned long *ucs4_buf,
+     size_t utf8_len, unsigned char *utf8_buf) {
+-  const unsigned char *utf8_endbuf = utf8_buf + utf8_len;
++  const unsigned char *utf8_endbuf;
+   int ucs_len = 0;
+ 
++  utf8_endbuf = utf8_buf + utf8_len;
+   while (utf8_buf != utf8_endbuf) {
+     pr_signals_handle();
+ 
+@@ -2075,13 +2076,27 @@ static int rewrite_write_fifo(int fd, char *buf, size_t buflen) {
+ }
+ 
+ static char *rewrite_map_int_utf8trans(pool *map_pool, char *key) {
+-  int ucs4strlen = 0;
+   static unsigned char utf8_val[PR_TUNABLE_BUFFER_SIZE] = {'\0'};
+   static unsigned long ucs4_longs[PR_TUNABLE_BUFFER_SIZE] = {0L};
++  int ucs4strlen = 0;
++  size_t key_len = 0;
+ 
+   /* If the key is NULL or empty, do nothing. */
++  if (key != NULL) {
++    key_len = strlen(key);
++  }
++
+   if (key == NULL ||
+-      strlen(key) == 0) {
++      key_len == 0) {
++    return NULL;
++  }
++
++  /* If the key length exceeds our buffers, reject it. */
++  if (key_len >= sizeof(utf8_val)) {
++    rewrite_log("utf8trans: key '%.100s...' length (%lu bytes) exceeds "
++      "maximum allowed length (%lu bytes), rejecting", key,
++      (unsigned long) key_len, (unsigned long) sizeof(utf8_val));
++    errno = EPERM;
+     return NULL;
+   }
+ 

diff --git a/proftpd.spec b/proftpd.spec
index 3d07539..d1e181a 100644
--- a/proftpd.spec
+++ b/proftpd.spec
@@ -81,6 +81,7 @@ Patch28:		https://github.com/user-attachments/files/30205541/mod_sftp-1.3.8d-iss
 Patch29:		mod_sftp-1.3.8d-issue1959.patch
 Patch30:		proftpd-1.3.9e-gh2095.patch
 Patch31:		proftpd-1.3.9e-gh2374.patch
+Patch32:		proftpd-1.3.8d-cve-2026-119146.patch
 
 BuildRequires:		coreutils
 BuildRequires:		gcc
@@ -346,6 +347,11 @@ sed -i -e '/^[[:space:]]*TLSCipherSuite[[:space:]]*PROFILE=SYSTEM$/d' mod_tls.co
 # https://github.com/proftpd/proftpd/issues/2374
 %patch -P 31 -p1 -b .gh2374
 
+# Guard against overly-long keys overflowing buffers when the "utf8trans" builtin
+# RewriteMap type is used (CVE-2026-119146)
+# https://github.com/proftpd/proftpd/commit/502d280b8d0ef72e44c6dd0a35a9405af0a1e301
+%patch -P 32 -p1 -b .cve-2026-119146
+
 # Tweak logrotate script for systemd compatibility (#802178)
 %if (0%{?rhel} && 0%{?rhel} <= 7) || (0%{?fedora} && 0%{?fedora} <= 23)
 sed -i -e '/killall/s/test.*/systemctl reload proftpd.service/' \
@@ -601,6 +607,8 @@ fi
     (GH#2095)
   - Fix write restriction bypass via symlink following in mod_copy (GH#2374,
     CVE-2026-119364)
+- Guard against overly-long keys overflowing buffers when the "utf8trans"
+  builtin RewriteMap type is used (CVE-2026-119146)
 
 * Wed Jul 22 2026 Paul Howarth <paul@city-fan.org> - 1.3.8d-4
 - Address another avenue for SQL injection, via custom SQLUserInfo queries

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-10 13:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-10 13:05 [rpms/proftpd] epel9: Fix buffer overflow in mod_rewrite "utf8trans" RewriteMap (CVE-2026-119146) Paul Howarth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox