Skip to content

Commit b3945db

Browse files
replace DocumentBuilder in IdentityProviderAuthenticationIT
1 parent 9c725e8 commit b3945db

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

x-pack/plugin/identity-provider/qa/idp-rest-tests/src/javaRestTest/java/org/elasticsearch/xpack/idp/IdentityProviderAuthenticationIT.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import org.elasticsearch.common.settings.Settings;
1818
import org.elasticsearch.common.util.concurrent.ThreadContext;
1919
import org.elasticsearch.core.Nullable;
20+
import org.elasticsearch.core.XmlUtils;
2021
import org.elasticsearch.xcontent.ObjectPath;
2122
import org.elasticsearch.xcontent.XContentBuilder;
2223
import org.elasticsearch.xcontent.json.JsonXContent;
@@ -163,7 +164,7 @@ public void testCustomAttributesInIdpInitiatedSso() throws Exception {
163164
final String samlResponse = generateSamlResponseWithAttributes(SP_ENTITY_ID, SP_ACS, null, attributesMap);
164165

165166
// Parse XML directly from samlResponse (it's not base64 encoded at this point)
166-
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
167+
DocumentBuilderFactory factory = XmlUtils.getHardenedBuilderFactory();
167168
factory.setNamespaceAware(true); // Required for XPath
168169
DocumentBuilder builder = factory.newDocumentBuilder();
169170
Document document = builder.parse(new InputSource(new StringReader(samlResponse)));

0 commit comments

Comments
 (0)