News for hackers. Stuff that matters.
Re:Coordinated disclosure of XML roundtrip vulnerabilities i... by jupenur on Monday December 14, 2020 @07:16PM (#25425285)
Blog author here; Russell's implementation is backed by github.com/beevik/etree, but like you said, it's just an interface. The tokenizer is still encoding/xml.

Adding better support for namespaces and providing APIs compatible with dsig doesn't remove the underlying vulnerabilities.

Re:Coordinated disclosure of XML roundtrip vulnerabilities i... by tptacek on Monday December 14, 2020 @08:06PM (#25425749)
Ugh. That's disappointing. I loathe SAML, but also think the right thing to do here is to make sure nobody uses encoding/xml as part of their SAML stack.
Re:Coordinated disclosure of XML roundtrip vulnerabilities i... by ptman on Tuesday December 15, 2020 @03:46AM (#25428314)
Pardon my ignorance, but what should be used instead of encoding/xml?
Re:Coordinated disclosure of XML roundtrip vulnerabilities i... by hakre on Tuesday December 15, 2020 @04:41AM (#25428598)
I think libxml does not have that problem, IIRC golang supports c-bindings.
Re:Coordinated disclosure of XML roundtrip vulnerabilities i... by masklinn on Wednesday December 16, 2020 @09:43AM (#25443039)
> I think libxml does not have that problem

I don't know about that. libxml certainly doesn't round-trip XML documents in general (though I don't think it breaks namespaces at least), whether that breaks SAML or not I have no idea.

Anyway from tptacek's other comments it looks like general-purpose XML libraries should not be assumed suitable for SAML, instead they should have purpose-built implementation for the SAML bit, then once the document has been properly validated and the SAML bits stripped off I guess that can be passed onto a general-purpose library:

> SAML libraries should include purpose-built, locked-down, SAML-only XMLDSIGs, and those XMLDSIGs should include purpose-built, stripped-down XMLs.

Re:Coordinated disclosure of XML roundtrip vulnerabilities i... by tptacek on Wednesday December 16, 2020 @09:43PM (#25451764)
I would go out of my way to avoid libxmlsec1 and libxml. I honestly don't understand why it's so hard for a SAML implementation to just bring its own hardened stripped-down XML.
Re:Coordinated disclosure of XML roundtrip vulnerabilities i... by masklinn on Thursday December 17, 2020 @12:44AM (#25452923)
If I had to hazard a guess, bespoke implementation is usually recommended against, especially for complex formats. That it would be the best practice for saml does sound counter-intuitive.
Re:Coordinated disclosure of XML roundtrip vulnerabilities i... by GoblinSlayer on Tuesday December 15, 2020 @05:02AM (#25428714)
Huh, namespaces are a semantic convention on top of xml syntax, tokenizer can't really implement it.
Re:Coordinated disclosure of XML roundtrip vulnerabilities i... by rsc on Tuesday December 15, 2020 @11:52AM (#25432046)
This is like saying that variable name scoping is a semantic convention on top of the C language grammar and that a lexer can't really implement it. In the case of C, it turns out that the lexer must implement it. In the case of XML, processing name spaces directives during lexing is the right thing to do in nearly all cases. But it's not what these SAML libraries needed.
Re:Coordinated disclosure of XML roundtrip vulnerabilities i... by jupenur on Tuesday December 15, 2020 @09:58AM (#25430851)
Well that didn't stop them from trying