Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.codemodder.plugins.maven.operator;

import static io.github.pixee.security.XMLInputFactorySecurity.hardenFactory;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
Expand Down Expand Up @@ -35,7 +36,7 @@ class FormatCommand extends AbstractCommand {
private static final Logger LOGGER = LoggerFactory.getLogger(FormatCommand.class);

/** StAX InputFactory */
private XMLInputFactory inputFactory = XMLInputFactory.newInstance();
private XMLInputFactory inputFactory = hardenFactory(XMLInputFactory.newInstance());

/** StAX OutputFactory */
private XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
Expand Down Expand Up @@ -529,7 +530,7 @@ private byte[] serializePomFile(POMDocument pom) throws XMLStreamException {
*
* <p>Grab the same initial offset from the formatted element like we did
*/
XMLInputFactory inputFactory = XMLInputFactory.newInstance();
XMLInputFactory inputFactory = hardenFactory(XMLInputFactory.newInstance());
XMLEventReader eventReader =
inputFactory.createXMLEventReader(
new ByteArrayInputStream(xmlRepresentation.getBytes(pom.getCharset())));
Expand Down