All work

 

Eliminate uses of getTextContent in DOM helpers

Fixed

Description

The distributed default shibboleth2.xml config file is missing the XML namespace declaration bound to the md: prefix as used in an EntityRoleWhilteList MetadataFilter: That filter uses the md prefix in the values of its RetainedRole child elements (e.g. md:IDPSSODescriptor).

That causes all IDPs to be filtered, with nothing being logged – not even with OpenSAML.MetadataProvider on DEBUG – other than "applying metadata
filter" for each configured filter, making this a bit hard to find.

Adding the declaration makes metadata re-appear:

Only after fixing this for me I noticed that the distributed example-shibboleth2.xml already has that prefix declared.

Environment

Fresh CentOS 7

Details

Assignee

Reporter

Components

Fix versions

Created July 11, 2018 at 3:24 AM
Updated July 17, 2018 at 1:51 PM
Resolved July 11, 2018 at 6:23 PM

Activity

Scott Cantor 
July 11, 2018 at 6:23 PM

All uses of DOMNode::getTextContent have been replaced with calls to an XMLHelper version that deliberately assume trusted content with no merging needed, or explicitly merge adjacent nodes and the caller releases the data. The QName case now uses the untrusted method, which is needed for a couple of SOAP and SAML cases where external content might contain a QName.

The other fix is that the namespace lookup now throws on an error so an unbound prefix will fail to load at all, which was the specific bug in the metadata filter case.

peter 
July 11, 2018 at 2:54 PM

Nothing logged at all unless DEBUG for the right category.

peter 
July 11, 2018 at 2:53 PM

D'oh, sorry (s/Provider/Filter/).

Yes, each IDP get's listed at DEBUG with "filtering out role-less entity".

Scott Cantor 
July 11, 2018 at 2:52 PM

Sigh, not only is it not logging, this is actually a bug I should have fixed, there are XML helper routines relying on dangerous methods to extract text content even after the big fixes I made. This will need a bigger fix that hopefully will have a side effect of improving the logging in this case.

Scott Cantor 
July 11, 2018 at 2:44 PM

I know I removed the namespace deliberately, which is debateable (it's still in the example because it's used there). I'm wondering if there was something logged though, it should have noted the QName would be undefined. That I think is the core issue, it should be pretty loud about that.