[nix-2.28] backport CVE-2025-54800 / GHSA-7qwg-q53v-vh99 (queue-runner validation + template escapes)#1763
Open
dkgkdfg65 wants to merge 11 commits into
Open
Conversation
This prevents a forever-hanging build (don't know why) when < or > are in the path of hydra-build-products. This is not to prevent any XSS (see next commits), just to prevent the DOS (if you can even call it that). (cherry picked from commit 1657f6f)
Removing two characters from a string when it starts with " can lead to a substring call with -1 (cherry picked from commit 85b330b)
(cherry picked from commit 552ca35)
(cherry picked from commit a0ba36d)
(cherry picked from commit 0d3842a)
(cherry picked from commit 7c4f0ab)
(cherry picked from commit 5f226f3)
(cherry picked from commit 33b5c6f)
(cherry picked from commit 99a6656)
(cherry picked from commit b94f47e)
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.
backport of the GHSA-7qwg-q53v-vh99 / CVE-2025-54800 fix series to the nix-2.28 branch. covers the hydra-queue-runner validation side (the substantive fix) plus the template-side HTML.attributes refactor and the existing escape-inputs touch-ups.
commit list (11 of the 12 in the upstream merge
dea1e168f5):omitted from upstream (1 of 12):
c6424f37 templates: Hopefully escape all template inputs— it conflicts structurally on nix-2.28's machine-status.tt (introducesprimarySystemType+ a popover that depends on a data-model field not present here). the queue-runner validation already rejects the dangerous inputs at the source, so the template-side wrap is defense-in-depth; happy to do a separate PR for it after the data-model bits land.two small manual resolutions during the cherry-pick:
[% ELSE %] ... couldn't find ...block that was added on nix-2.28 after the patch's base, and applied theHTML.attributes(href => ...)wrapping around the link inside it.the build log of derivation <tt>...</tt>line (nix-2.28 doesn't carry the extra(<a ...>raw</a>)link that the patch adds; the fix's purpose is escaping existing constructs, and nix-2.28 doesn't have that construct yet, so wrapping was a no-op).verified the queue-runner-side validation A/B as a standalone harness on top of ubuntu:22.04 + g++: the build-result.cc regex whitelists do reject
<script>...,<img onerror=...,<svg onload=...style payloads in releaseName / product.name / metric.name / metric.unit fields pre-vs-post, matching the upstream behaviour.refs:
happy to rebase / split / drop commits if you'd rather take a narrower subset.