8000 wget: backport CVE-2026-15146 fix (FTP PASV address SSRF) by bryan-minimal · Pull Request #916 · gominimal/pkgs · GitHub
[go: up one dir, main page]

Skip to content

wget: backport CVE-2026-15146 fix (FTP PASV address SSRF) - #916

Merged
bryan-minimal merged 1 commit into
mainfrom
wget-cve-backport
Oct 19, 2026
Merged

bryan-minimal merged 1 commit into
mainfrom
wget-cve-backport

Conversation

@bryan-minimal
Copy link
Copy Markdown
Member

What this fixes

CVE-2026-15146. In wget 1.25.0, ftp_pasv() and ftp_lpsv() (src/ftp-basic.c) take the IP address from the server's 227 / 228 reply and never check it against the peer of the control connection. A malicious FTP server, or an HTTP server that redirects to an FTP URL, can therefore point wget's data connection at any host and port: a server-side request forgery against localhost or the internal network.

Changes

  1. CVE-2026-15146.patch. This is the upstream commit's .patch, unmodified. It is the fifth CVE patch, added the same way as the existing four: listed in build.ncl and applied in build.sh with patch -Np1 under set -e, so a stale hunk fails the build. It touches only src/ftp-basic.c, and none of the other four patches touch that file.
  2. Regression test, run at build time. A small fake FTP server written in gawk serves the control connection on 127.0.0.1 and answers PASV with 127,0,0,2,0,9. gawk's /inet sockets mean the test needs no new build dep.
    • The build requires wget to print Cannot parse PASV response. and requires that 127.0.0.2 never appears in the log.
    • Negative control (the 15146 patch line disabled, in a freshly activated session): wget prints ==> PASV ... couldn't connect to 127.0.0.2 port 9: Connection refused, and the build fails.

Verification

All runs were in a min session with the pkgbuild loadout, on arm64:

  • min package build --rebuild --verbose wget: all 5 patches apply and the regression test passes (Cannot parse PASV response.). Result: build finished.
  • Negative control as above: fails, as it should. The session was re-activated before each run.
  • min check --packages wget: all checks pass.

Notes

  • The patch drops itself. pkgmgr-rs#988's carried-patch check runs on update. On the first wget release that contains 4f85853, the patch will reverse-apply and be removed automatically, together with its build.ncl entry and build.sh line.
  • Scanner visibility. CVE-2026-15146 is currently an NVD record with no CPE configuration, so nothing in our pipeline can match it yet. Once NVD analyses it, the GnuProject wget identity will report it against 1.25.0 even though this patch is carried. That will need a VEX not_affected / inline_mitigations_already_exist until the next release.
  • Blast radius: 2 direct importers (icedtea-7, icedtea-8) and 19 packages transitively, through the openjdk boot ladder.

Refs gominimal/pkgmgr-rs#848

🤖 Generated with Claude Code

ftp_pasv() and ftp_lpsv() used the IP address in the server's PASV/LPSV
reply without checking it against the control connection's peer. A
malicious FTP server, or an HTTP redirect to one, could aim wget's data
connection at any host and port (SSRF). 1.25.0, our version and still the
latest, is affected. Upstream fixed it in gnuwget/wget 4f85853f6418, which
is unreleased. Debian carries the same fix as 1.25.0-3.

- Carry the upstream commit verbatim as a fifth CVE patch, in the same
  shape as the existing four. It is applied with `patch -Np1` and
  fails closed.
- Add a build-time regression test. A gawk fake FTP server answers PASV
  with 127.0.0.2, and the build requires wget to reject the reply and
  never connect there. Negative control: with the patch skipped, wget
  prints "couldn't connect to 127.0.0.2 port 9" and the build fails.

Refs gominimal/pkgmgr-rs#848

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bryan-minimal
bryan-minimal requested a review from a team as a code owner October 17, 2026 18:59
@coderabbitai
coderabbitai Bot commented Oct 17, 2026
Copy link
Copy Markdown
Contributor

Warning

Review limit reached

  • Run on-demand review

This review includes 3 billable files and costs up to $0.75.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 32 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available. Your 55 included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: gominimal/pkgs/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: a2a13896-5eae-4c81-b63d-5d6374bf6810
📥 Commits

Reviewing files that changed from the base of the PR and between 5a26fc2 and 442e6f1.

📒 Files selected for processing: 3
  • packages/wget/CVE-2026-15146.patch
  • packages/wget/build.ncl
  • packages/wget/build.sh
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@norrietaylor norrietaylor left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. The patch is identical to gnuwget/wget@4f85853f, applies cleanly to v1.25.0 with no overlap with the existing patches, and adds no new deps.

Nits:

  • Possible flake (build.sh:60-72): the readiness probe at line 65 uses up gawk's single-accept /inet listener, so a fast wget --tries=1 can get ECONNREFUSED while gawk re-listens. It fails closed, so the risk is a spurious build failure, never a false pass. Drop the probe and retry wget a few times, or sleep briefly after the probe.
  • The timeout exit 1 at line 67 leaves the gawk process running.
  • FYI: upstream e9697d98 (unbounded MD5 loop in FTP OPIE, same file, DoS, no CVE) could be a follow-up.

Generated by Claude Code

@bryan-minimal
bryan-minimal added this pull request to the merge queue Oct 19, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Oct 19, 2026
@bryan-minimal
bryan-minimal added this pull request to the merge queue Oct 19, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Oct 19, 2026
@bryan-minimal
bryan-minimal added this pull request to the merge queue Oct 19, 2026
Merged via the queue into main with commit 9dc1fd6 Oct 19, 2026
10 checks passed
@bryan-minimal
bryan-minimal deleted the wget-cve-backport branch October 19, 2026 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0