Nil-pointer panic in validateAssertion and namespace-blind Subject.NameID in github.com/crewjam/saml
- GO-2026-6909
Description
github.com/crewjam/saml before v0.5.2 contains two vulnerabilities in SAML assertion processing: 1. ServiceProvider.validateAssertion dereferences assertion.Subject, assertion.Conditions, and SubjectConfirmationData without nil checks. A signed SAML assertion that omits any of these optional elements causes a nil-pointer dereference panic after signature verification. 2. Subject uses the bare XML struct tag xml:"NameID", which matches <NameID> elements in any XML namespace. When a signed assertion omits <saml:NameID> and includes a <NameID> element in a foreign namespace inside <saml:Subject>, encoding/xml populates Subject.NameID from the foreign element, allowing an authenticated principal to spoof Subject.NameID.Value.
Text from the OSV record.
Recommendation
github.com/crewjam/saml
- If you run a version before 0.5.2update to 0.5.2 or latergithub.com/crewjam/saml 0.5.2 on its registry (opens in a new tab)
Taken from the version ranges the sources state. Check the vendor advisory: nothing is said about versions the ranges do not list. Breaking-change risk is read from the version numbers only.
Affected
github.com/crewjam/samlGo
Affected versions Fixed in before 0.5.2 0.5.2
Timeline
- Published
Related news
No article from the followed outlets names this vulnerability.