[AutoPR- Security] Patch cni-plugins for CVE-2026-42506, CVE-2026-27136, CVE-2026-42502, CVE-2026-25681, CVE-2026-25680 [MEDIUM]#17455
Conversation
🔒 CVE Patch Review: CVE-2026-25681, CVE-2026-27136, CVE-2026-42502, CVE-2026-42506PR #17455 — [AutoPR- Security] Patch cni-plugins for CVE-2026-42506, CVE-2026-27136, CVE-2026-42502, CVE-2026-25681 [MEDIUM] Spec File Validation
Build VerificationBuild log analysis was skipped (no build ID available). Patch Analysis
Detailed analysisComparison shows the PR changes mirror the upstream patch:
Comparison shows the PR patch introduces the same logic as upstream to ignore duplicate attributes during tokenization, preventing parser misalignment. Specifically: (1) it adds a new field to Tokenizer: attrNames map[string]bool; (2) it clears this map at the start of readTag via clear(z.attrNames); (3) when reading an attribute, it lowercases the attribute key (strings.ToLower on the raw bytes) and only appends the attribute if the key hasn't been seen, marking it seen afterward; (4) it initializes attrNames in NewTokenizerFragment with make(map[string]bool). The line offsets and file paths differ (vendor/golang.org/x/net/html/token.go versus html/token.go), consistent with a backport to a vendored dependency, but the hunks themselves are equivalent. The upstream changes to token tests are not included, which is expected in vendor patches and does not affect runtime behavior. The fix relies on Go's clear builtin for maps; as long as the package is built with a sufficiently recent Go toolchain (as in upstream), behavior will match. Overall, the PR implements the upstream security fix without functional deviations, and the risk of incompleteness or regression due to these changes is low.Scope and location: The PR patch modifies vendor/golang.org/x/net/html/render.go in the cni-plugins package. It inserts the same 16-line block in childTextNodesAreLiteral as upstream commit a8fb2fe4f7378f816302b9f2f7b8290ce512e5dd, adding a loop that walks ancestors to detect a non-empty namespace and, unless the ancestor is an HTML integration point (htmlIntegrationPoint), treats the node as foster-parented and returns false (i.e., do not render raw text). This mirrors upstream logic exactly: the same tags are checked (iframe, noembed, noframes, noscript, plaintext, script, style, xmp), the same ancestor walk is performed, and the same return behavior is preserved. Context lines and function boundaries match; there are no additional changes. Differences from upstream: The PR does not include any of the upstream tests (parse_test.go change, render_test.go new test, and the new testdata file). These are test-only hunks and their absence does not affect runtime behavior. Risk and compatibility: Since the runtime change is identical to upstream, functional risk is low assuming the vendor'd x/net/html package includes the htmlIntegrationPoint function (as in upstream). The omission of tests is normal in vendorized/packaged environments and does not impact the fix. Overall, this is a straightforward backport of the functional change without tests.Core fix parity: The upstream patch modifies html/parse.go to ensure that, when handling "any other end tag" in the in-body insertion mode, a matching element is only considered if it is in the HTML namespace. This is implemented by changing the conditional from (p.oe[i].DataAtom == tagAtom) && ((tagAtom != 0) || (p.oe[i].Data == tagName)) to p.oe[i].Namespace == "" && (p.oe[i].DataAtom == tagAtom) && ((tagAtom != 0) || (p.oe[i].Data == tagName)). The PR patch applies the identical conditional change in vendor/golang.org/x/net/html/parse.go, preserving logical behavior. It also removes the same two spec-reference comment lines as upstream. Tests: Upstream adds html/testdata/go/in_body_end.dat to validate the behavior. The PR adds the same test content at vendor/golang.org/x/net/html/testdata/go/in_body_end.dat, mirroring upstream. While the build may not run tests in this packaging context, inclusion indicates fidelity to upstream. Context and path differences: Line numbers and the index hashes differ (as expected for a vendored backport), and the file paths are under vendor/ instead of the upstream module path. No functional divergence is introduced by these differences. Completeness: No upstream hunks are missing; both the code change and test addition are present. There are no extra, unrelated modifications. Risk: Low. The change tightens matching to HTML-namespace elements, aligning with the HTML parsing spec and upstream fix for CVE-2026-42506. Potential impact is limited to preventing incorrect end-tag matching across foreign namespaces, which is the intended security fix. Regressions are unlikely given upstream review and the minimal, well-scoped condition change. Verdict✅ APPROVED — All checks passed. Ready to merge. |
Kanishk-Bansal
left a comment
There was a problem hiding this comment.
Patch Analysis (matches upstream, test files are ommitted.)
- Buddy Build
- patch applied during the build (check
rpm.log) - patch include an upstream reference
- PR has security tag
Auto Patch cni-plugins for CVE-2026-42506, CVE-2026-27136, CVE-2026-42502, CVE-2026-25681, CVE-2026-25680.
Autosec pipeline run -> https://dev.azure.com/mariner-org/mariner/_build/results?buildId=1126741&view=results
Autosec pipeline run -> https://dev.azure.com/mariner-org/mariner/_build/results?buildId=1130196&view=results
Autosec pipeline run -> https://dev.azure.com/mariner-org/mariner/_build/results?buildId=1127811&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