nginx: patch CVE-2026-42945 and related CVEs via overlay#343
Merged
Conversation
Apply upstream patches for the following CVEs disclosed 2026-05-13: - CVE-2026-40460: HTTP/3 address spoofing - CVE-2026-40701: use-after-free in OCSP resolver - CVE-2026-42934: buffer overread in charset module - CVE-2026-42945: heap buffer overflow in rewrite module (NGINX Rift) - CVE-2026-42946: buffer overread in scgi/uwsgi modules Patches are taken from the upstream nginx commits, matching what nixpkgs#520076 applied to release-25.11. This overlay should be removed once the nixos-25.11 channel advances past the fix. Co-Authored-By: Oliver Ni <oliver.ni@gmail.com>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
oliver-ni
approved these changes
May 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Applies upstream nginx security patches via a nixpkgs overlay to address 5 CVEs disclosed on 2026-05-13, including the critical CVE-2026-42945 ("NGINX Rift") heap buffer overflow (CVSS v4 9.2).
The
nixos-25.11channel is stuck on an April 30 build and hasn't advanced in over two weeks, so the fix merged intorelease-25.11via nixpkgs#520076 is not yet available through normal channel updates. This overlay applies the same upstream patches directly topkgs.nginxuntil the channel catches up.CVEs patched:
Affected hosts: scootaloo (matrix), spike (niks3-cache), amethyst (webhost), termites & anglerfish (jukebox)
Note: While none of our nginx configs currently contain the specific
rewritepattern that triggers CVE-2026-42945, patching is still important as a defense-in-depth measure and to address the other CVEs. This overlay should be removed onceflake.lockpoints to a nixpkgs with nginx >= 1.30.1.Review & Testing Checklist for Human
nix build .#nixosConfigurations.amethyst.config.system.build.toplevel(or any host running nginx)nginx -Voutput on a test deploynixos-25.11channel advances past the fix, remove this overlay fromflake.nixto avoid patch conflictsNotes
Patch hashes are taken directly from nixpkgs#520076 which was reviewed by NixOS security team and merged on May 14.
Link to Devin session: https://app.devin.ai/sessions/99413c6842484ce9a99d3cc881ca7b2d
Requested by: @oliver-ni