Skip to content
Draft
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ jobs:
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@cdf488f595d80d6e07e03d4674febd5ab45fa938 # v4.37.9
env:
MAVEN_ARGS: -Puse-apache-snapshots

# 鈩癸笍 Command-line programs to run using the OS shell.
# 馃摎 https://git.io/JvXDl
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ jobs:
distribution: 'temurin'
java-version: ${{ matrix.java }}
- name: Build with Maven
run: mvn --errors --show-version --batch-mode --no-transfer-progress -Ddoclint=none
run: mvn --errors --show-version --batch-mode --no-transfer-progress -Ddoclint=none -Puse-apache-snapshots
5 changes: 5 additions & 0 deletions commons-digester3-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@
<name>Apache Commons Digester :: Core</name>

<dependencies>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-secure-xml</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.commons.xml.secure.SecureSAXParserFactory;
import org.xml.sax.Attributes;
import org.xml.sax.ContentHandler;
import org.xml.sax.EntityResolver;
Expand Down Expand Up @@ -1589,7 +1590,7 @@ public SAXParserFactory getFactory()
{
if ( factory == null )
{
factory = SAXParserFactory.newInstance();
factory = SecureSAXParserFactory.newInstance();
factory.setNamespaceAware( namespaceAware );
factory.setXIncludeAware( xincludeAware );
factory.setValidating( validating );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;

import org.apache.commons.xml.secure.SecureDocumentBuilderFactory;
import org.w3c.dom.Attr;
import org.w3c.dom.DOMException;
import org.w3c.dom.Document;
Expand Down Expand Up @@ -335,7 +336,7 @@ public NodeCreateRule( final DocumentBuilder documentBuilder )
public NodeCreateRule( final int nodeType )
throws ParserConfigurationException
{
this( nodeType, DocumentBuilderFactory.newInstance().newDocumentBuilder() );
this( nodeType, SecureDocumentBuilderFactory.newInstance().newDocumentBuilder() );
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import org.apache.commons.digester3.RulesBase;
import org.apache.commons.digester3.StackAction;
import org.apache.commons.digester3.Substitutor;
import org.apache.commons.xml.secure.SecureSAXParserFactory;
import org.xml.sax.EntityResolver;
import org.xml.sax.ErrorHandler;
import org.xml.sax.Locator;
Expand Down Expand Up @@ -107,7 +108,7 @@ public static DigesterLoader newLoader( final RulesModule... rulesModules )
/**
* The SAXParserFactory to create new default {@link Digester} instances.
*/
private final SAXParserFactory factory = SAXParserFactory.newInstance();
private final SAXParserFactory factory = SecureSAXParserFactory.newInstance();

private final Iterable<RulesModule> rulesModules;

Expand Down
3 changes: 3 additions & 0 deletions src/changes/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
<action dev="simonetripodi" type="add" issue="DIGESTER-171" due-to="Nick Williams, Ivan Diana">Add DefaultThrowingErrorHandler to Digester API.</action>
<action dev="ggregory" type="add" due-to="Gary Gregory">Add Maven property project.build.outputTimestamp for build reproducibility.</action>
<!-- FIX -->
<action dev="pkarwasz" type="fix">
Create SAX parser and document builder factories through org.apache.commons:commons-secure-xml, which bounds entity expansion and enables XML secure processing.
</action>
<action dev="simonetripodi" type="fix" issue="DIGESTER-175">
Regression: DigesterTestCase#testPopNamedStackNotPushed expects EmptyStackException.
</action>
Expand Down
Loading