Skip to content

miniupnpd: backport CVE-2026-5720 fix to 2.3.9 - #31069

Merged
commodo merged 1 commit into
openwrt:openwrt-25.12from
tillo:miniupnpd-cve-2026-5720
Nov 1, 2026
Merged

commodo merged 1 commit into
openwrt:openwrt-25.12from
tillo:miniupnpd-cve-2026-5720

Conversation

@tillo

@tillo tillo commented Oct 31, 2026 •

Copy link
Copy Markdown

📦 Package Details

Maintainer: none named in net/miniupnpd (adopting the package for this fix)

Description:

Backport of the CVE-2026-5720 fix to the openwrt-25.12 branch.

ParseHttpHeaders() removes the enclosing quotes of a header value without first checking that the value is at least 2 bytes long. A SOAPAction header carrying a single quote therefore underflows the length (CWE-191) and the following memchr() scans far past the request buffer (CWE-125); one request is enough to take the daemon down, and OpenWrt's init script sets no respawn, so it stays down until it is restarted by hand.

The fix is upstream commit f56bd09bd (upnphttp.c: fix removal of quotes in ParseHttpHeaders()), first released in 2.3.10. openwrt-25.12 still packages the pristine 2.3.9 tarball with no patches/ directory, so the branch is affected; master moved the package to 2.3.11 in #30701, which is more than a release branch wants — 2.3.10 broke port forwarding and needed 2.3.11 to repair it (bbdd738), so taking the whole-point bump would drag that regression pair along with a security fix.

On the cherry-pick line

The commit carries (cherry picked from commit 983e2638…) — the master commit that brought 2.3.11 into the tree, and with it the f56bd09 fix. It is not a verbatim copy: the backport keeps 2.3.9 as PKG_VERSION, keeps the existing PKG_HASH, and takes only the upnphttp.c hunk, with PKG_RELEASE bumped to 2 so the rebuilt package supersedes 2.3.9-r1. The formality check therefore reports the diff as deviating from the upstream commit; that deviation is the point of the patch.

🧪 Run Testing Details

  • OpenWrt Version: 25.12-SNAPSHOT
  • OpenWrt Target/Subtarget: mediatek/filogic (aarch64_cortex-a53)
  • OpenWrt Device: Banana Pi BPI-R4 (router; nftables variant)
  • The patch was applied with patch -p1 against a freshly extracted miniupnpd-2.3.9.tar.gz (sha256 66cb3c3d…, i.e. the PKG_HASH the branch already uses) and applies without fuzz. The compiled daemon is what CI builds here; I have not run a crash reproducer against a live router.

✅ Formalities

  • I have reviewed the CONTRIBUTING.md file to the best of my ability.
  • The patch is in git am format and applies cleanly to the 2.3.9 tarball.
  • It is a backport of an upstream commit, not a divergent local change.

@openwrt openwrt Bot added not following guidelines release/25.12 Issues/PR on branch 25.12 labels Oct 31, 2026
@tillo
tillo force-pushed the miniupnpd-cve-2026-5720 branch from 9fd291b to ba341a6 Compare October 31, 2026 11:30
ParseHttpHeaders() removes the enclosing quotes of a header value
without checking first that the value is long enough. A single quote
underflows the length to SIZE_MAX - 1 and the memchr() that follows
reads past the end of the request buffer, so a malformed SOAP request
crashes the daemon.

The fix is upstream commit f56bd09, first released in 2.3.10, and it
reached master as part of the 2.3.11 update. The version bump itself is
not taken here: 2.3.10 broke port forwarding and 2.3.11 repaired it, and
neither belongs in a release branch for one security fix. The 25.12
branch gets the one hunk, with PKG_RELEASE going to 2.

The patch is relative to the extracted tarball root, because the build
strips the single top-level directory and applies with patch -p1. It was
verified to apply cleanly to the 2.3.9 tarball whose hash this Makefile
pins.

CVE: https://nvd.nist.gov/vuln/detail/CVE-2026-5720
Upstream fix: miniupnp/miniupnp@f56bd09

Signed-off-by: Martino Dell'Ambrogio <tillo@tillo.ch>
(cherry picked from commit 983e263)
@tillo
tillo force-pushed the miniupnpd-cve-2026-5720 branch from ba341a6 to f68827f Compare October 31, 2026 12:06
@hnyman

hnyman commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

cc @commodo

@commodo
commodo merged commit fae099b into openwrt:openwrt-25.12 Nov 1, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release/25.12 Issues/PR on branch 25.12

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants