[AutoPR- Security] Patch docker-buildx for CVE-2026-46598, CVE-2026-42502, CVE-2026-39835, CVE-2026-39827, CVE-2026-25681, CVE-2026-25680 [MEDIUM]#17577
Conversation
🔒 CVE Patch Review: CVE-2026-25680, CVE-2026-25681, CVE-2026-39827, CVE-2026-39835, CVE-2026-42502, CVE-2026-46598PR #17577 — [AutoPR- Security] Patch docker-buildx for CVE-2026-46598, CVE-2026-42502, CVE-2026-39835, CVE-2026-39827, CVE-2026-25681, CVE-2026-25680 [MEDIUM] Spec File Validation
Build VerificationBuild log analysis was skipped (no build ID available). Patch Analysis
Detailed analysisCore change parity: The PR patch mirrors the upstream modifications to html/parse.go within vendor/golang.org/x/net/html/parse.go. It adds imports for "cmp" and "slices"; defines attrCompare(a, b Attribute) int using cmp.Or on Namespace, Key, and Val; sorts the incoming attribute slice (attr) with slices.SortFunc(attr, attrCompare) before the search; replaces the previous cubic attribute comparison block with a single if !slices.Equal(n.Attr, attr) check; and sorts the top node's attributes (top.Attr) before appending it to the active formatting elements (p.afe). These are the exact functional changes upstream introduced to implement a linearithmic, equality-based check for the Noah's Ark clause. Context and file path: The PR targets a vendored copy under vendor/golang.org/x/net/html/parse.go rather than html/parse.go, with different index hashes, and includes packaging lines (Signed-off-by, Upstream-reference). None of these alter functionality. The surrounding code context lines in the PR match the upstream function locations (addFormattingElement and related helpers), indicating correct placement. Completeness: No upstream hunks are missing. The import additions, helper function, two attribute sorting sites, and the replacement of the cubic comparison loop are all present. Comments are also preserved. Behavioral notes and risks: The change sorts attribute slices for nodes stored in the active formatting elements and for the new element, making slices.Equal reliable and eliminating the prior O(n^3) behavior, addressing CVE-2026-25680 (potential DoS via pathological attribute comparisons). This will also result in normalized (sorted) attribute order in the parse tree for these elements, which is consistent with upstream and typically acceptable since HTML attribute order is not semantically significant. Build/toolchain consideration: the use of standard library packages cmp and slices requires Go 1.21+. If the package is built with an older Go toolchain, it would fail to compile; however, this is identical to upstream requirements. Overall, the risk of regressions is low and the fix is complete and equivalent.Comparison shows the PR patch makes the same functional changes as upstream, but in the vendored path vendor/golang.org/x/net/html/render.go used by docker-buildx. Specifically: (1) In render1, calls to writeQuoted for PUBLIC and SYSTEM identifiers are changed to writeDoctypeQuoted in all three places, matching upstream. (2) The helper function is renamed from writeQuoted to writeDoctypeQuoted, its comment is updated to note escaping, it adds a safety check that errors if both quote types appear in the identifier, and it replaces all '>' characters with ">" via strings.ReplaceAll before writing. These match the upstream logic exactly. (3) The test file html/testdata/go/doctype_named_entity.dat is added under the vendor path with identical contents to upstream. Context line numbers (e.g., 251 vs 267) differ slightly, as expected for a backport against a slightly different baseline, but there are no substantive divergences. No upstream hunks are missing: all modified call sites and the helper function changes are present, and the test data file is included. The patch does not alter imports, consistent with upstream (errors and strings are already used/imported in the file in typical versions). Given the minimal, localized nature of the changes and parity with upstream, the risk of incompleteness or regression is low.Core fix comparison:
Omissions and differences:
Assessment:
Comparison shows the PR patch adds two checks in vendor/golang.org/x/crypto/ssh/certs.go that are functionally identical to upstream:
Functional comparison: Upstream modifies html/render.go in childTextNodesAreLiteral to handle foster-parented elements placed under a non-HTML namespace. Specifically, inside the case for tags [iframe, noembed, noframes, noscript, plaintext, script, style, xmp], it walks up the ancestor chain to find the first node with a non-empty namespace and, if that ancestor is not an HTML integration point, returns false so that text is escaped rather than emitted raw. The PR patch introduces the identical logic and comment at the same point in vendor/golang.org/x/net/html/render.go. The surrounding context (early return when n.Namespace != "", the switch on n.Data, and return paths) matches, and the semantics are unchanged. Differences: The PR does not include upstream's test updates (parse_test.go blacklist entry, a new render test, and a new testdata file), which are non-functional and commonly excluded in distribution patches. The PR also applies to a vendored path within docker-buildx, reflecting packaging layout rather than a source-tree difference. No additional deviations from upstream were found in the functional change. Risk: The change narrows literal-text rendering to exclude fostered nodes under foreign content unless behind an HTML integration point, aligning with the HTML parsing/rendering spec and mitigating the CVE. The code is localized and guarded by specific tag checks, so regression risk is low; upstream has reviewed and accepted the change.Comparison of the core changes shows the PR inserts identical guards to upstream in two locations: prior to casting k.Priv to ed25519.PrivateKey in parseEd25519Key and parseEd25519Cert, it now checks len(k.Priv) != ed25519.PrivateKeySize and returns fmt.Errorf("agent: bad ED25519 key size: %d", len(k.Priv)) on mismatch. These insertions are byte-for-byte equivalent to upstream. The line numbers and file paths differ (vendor/golang.org/x/crypto/ssh/agent/server.go at offsets ~267 and ~333 vs upstream ssh/agent/server.go at ~270 and ~336), reflecting vendor context and minor upstream drift, but the surrounding context (ssh.Unmarshal(req, &k), and the subsequent ed25519.PrivateKey(k.Priv) cast) is consistent, indicating a correct application. No other logic is altered. The PR does not include the upstream test addition (server_test.go) which is common for distribution patches that only modify vendored source code; this does not affect runtime behavior. The file already uses ed25519 and fmt elsewhere in the agent server, so no import adjustments are needed. Functionally, the fix prevents a panic caused by short ED25519 private key payloads (priv[32:] in Public()), returning an error instead, aligning with the upstream CVE fix. Given the exact equivalence of the security-relevant hunks and the minimal scope, the risk of regression is low, and the fix appears complete for the targeted issue. Verdict✅ APPROVED — All checks passed. Ready to merge. |
Auto Patch docker-buildx for CVE-2026-46598, CVE-2026-42502, CVE-2026-39835, CVE-2026-39827, CVE-2026-25681, CVE-2026-25680.
Autosec pipeline run -> https://dev.azure.com/mariner-org/mariner/_build/results?buildId=1130143&view=results
Merge Checklist
All boxes should be checked before merging the PR (just tick any boxes which don't apply to this PR)
*-staticsubpackages, etc.) have had theirReleasetag incremented../cgmanifest.json,./toolkit/scripts/toolchain/cgmanifest.json,.github/workflows/cgmanifest.json)./LICENSES-AND-NOTICES/SPECS/data/licenses.json,./LICENSES-AND-NOTICES/SPECS/LICENSES-MAP.md,./LICENSES-AND-NOTICES/SPECS/LICENSE-EXCEPTIONS.PHOTON)*.signatures.jsonfilessudo make go-tidy-allandsudo make go-test-coveragepassSummary
What does the PR accomplish, why was it needed?
Change Log
Does this affect the toolchain?
YES/NO
Associated issues
Links to CVEs
Test Methodology