You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2026/08/28 18:31:48 UTC
(commons-xml) branch main updated (9d5b52d -> cea2237)
This is an automated email from the ASF dual-hosted git repository.
garydgregory pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/commons-xml.git
from 9d5b52d Name like in the JRE example in MethodHandles.Lookup.findStatic().
new 12b3179 Javadoc Javadoc: "hardening" -> "secure" wording to match new class and method names.
new cea2237 Javadoc: "hardening" -> "secure" wording to match new class and method names.
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../org/apache/commons/xml/AttackTestSupport.java | 30 +++++++++++-----------
.../org/apache/commons/xml/BillionLaughsTest.java | 20 +++++++--------
2 files changed, 25 insertions(+), 25 deletions(-)
(commons-xml) 02/02: Javadoc: "hardening" -> "secure" wording to match new class and method names.
Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
garydgregory pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/commons-xml.git
commit cea2237c819f54e490cc3019974a1c1a268cfeef
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Fri Aug 28 14:31:42 2026 -0400
Javadoc: "hardening" -> "secure" wording to match new class and
method names.
Rename test methods.
---
.../org/apache/commons/xml/BillionLaughsTest.java | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/src/test/java/org/apache/commons/xml/BillionLaughsTest.java b/src/test/java/org/apache/commons/xml/BillionLaughsTest.java
index f0f6dff..30416b5 100644
--- a/src/test/java/org/apache/commons/xml/BillionLaughsTest.java
+++ b/src/test/java/org/apache/commons/xml/BillionLaughsTest.java
@@ -24,9 +24,9 @@
/**
* Checks whether parsers reject a Billion Laughs payload (nested entity expansion in the internal DTD subset).
*
- * <p>Each {@code hardened*} test asserts the library blocks the payload;
+ * <p>Each {@code secure*} test asserts the library blocks the payload;
* its {@code unconfigured*} positive control asserts the same payload parses once the limit is disabled,
- * so a block reflects the hardening rather than a broken wrapper.
+ * so a block reflects the secure rather than a broken wrapper.
* The library pins no custom entity-expansion limit; each parser keeps its own secure-processing default, which varies by implementation:
* {@code 2,500} (stock JDK),
* {@code 64,000} (external Xerces under {@code FEATURE_SECURE_PROCESSING}),
@@ -136,7 +136,7 @@ private static String xsltPayload() {
@Test
@Tag("dom")
- void hardenedDomBlocks() {
+ void secureDomBlocks() {
Assumptions.assumeTrue(AttackTestSupport.DOM_RESOLVES_INTERNAL_ENTITIES,
"Skipped: platform DOM does not resolve user-defined entities");
AttackTestSupport.assertDomBlocks(xmlPayload());
@@ -144,43 +144,43 @@ void hardenedDomBlocks() {
@Test
@Tag("sax")
- void hardenedSaxBlocks() {
+ void secureSaxBlocks() {
AttackTestSupport.assertSaxBlocks(xmlPayload());
}
@Test
@Tag("schema")
- void hardenedSchemaBlocks() {
+ void secureSchemaBlocks() {
AttackTestSupport.assertSchemaBlocks(AttackTestSupport.streamSource(xsdPayload()));
}
@Test
@Tag("stax")
- void hardenedStaxBlocks() {
+ void secureStaxBlocks() {
AttackTestSupport.assertStaxBlocks(xmlPayload());
}
@Test
@Tag("trax")
- void hardenedTemplatesBlocks() {
+ void secureTemplatesBlocks() {
AttackTestSupport.assertTemplatesBlocks(AttackTestSupport.streamSource(xsltPayload()));
}
@Test
@Tag("trax")
- void hardenedTransformerBlocks() {
+ void secureTransformerBlocks() {
AttackTestSupport.assertTransformerBlocks(xmlPayload());
}
@Test
@Tag("schema")
- void hardenedValidatorBlocks() {
+ void secureValidatorBlocks() {
AttackTestSupport.assertValidatorBlocks(xmlPayload());
}
@Test
@Tag("sax")
- void hardenedXmlReaderBlocks() {
+ void secureXmlReaderBlocks() {
AttackTestSupport.assertXmlReaderBlocks(xmlPayload());
}
(commons-xml) 01/02: Javadoc Javadoc: "hardening" -> "secure" wording to match new class and method names.
Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
garydgregory pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/commons-xml.git
commit 12b31799071f3b6d2fc31f880b07b3e9948a43a6
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Fri Aug 28 14:28:31 2026 -0400
Javadoc Javadoc: "hardening" -> "secure" wording to match new class and
method names.
---
.../org/apache/commons/xml/AttackTestSupport.java | 30 +++++++++++-----------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/src/test/java/org/apache/commons/xml/AttackTestSupport.java b/src/test/java/org/apache/commons/xml/AttackTestSupport.java
index a81d0de..fb03af8 100644
--- a/src/test/java/org/apache/commons/xml/AttackTestSupport.java
+++ b/src/test/java/org/apache/commons/xml/AttackTestSupport.java
@@ -64,9 +64,9 @@
* <li>{@code assert*Blocks(...)} runs the payload through a secure factory from {@link org.apache.commons.xml} and asserts the parse throws. Used when the hardening
* layer is expected to reject the attack outright.</li>
* <li>{@code assert*DoesNotLeak(...)} runs the payload through a secure factory and asserts the parse completes without throwing and without producing the
- * {@link #LEAKED_MARKER} string. Used when the hardening contract guarantees the parse succeeds but never resolves the external resource (for example,
+ * {@link #LEAKED_MARKER} string. Used when the secure contract guarantees the parse succeeds but never resolves the external resource (for example,
* the ignore-all resolver floor resolving the external subset to empty content).</li>
- * <li>{@code assert*BlocksOrDoesNotLeak(...)} accepts either of the previous two outcomes. Used where the same hardening contract surfaces differently across
+ * <li>{@code assert*BlocksOrDoesNotLeak(...)} accepts either of the previous two outcomes. Used where the same secure contract surfaces differently across
* providers (for example, an entity declared in the emptied external subset is a fatal error on one implementation and a silently skipped reference on
* another).</li>
* </ul>
@@ -78,7 +78,7 @@
* <p>The permissive-side positive controls mirror the hardened-side verbs with an {@code assertPermissive*} prefix: {@code assertPermissive*Parses} for direct
* parsing, {@code assertPermissive*Compiles} for {@link SchemaFactory} / {@link TransformerFactory} compilation, {@code assertPermissiveTransformerTransforms}
* for {@code Transformer.transform}, {@code assertPermissiveValidatorValidates} for {@code Validator.validate}. Both sides perform the same operation; the
- * prefix marks which factory hardening level the assertion is set against.</p>
+ * prefix marks which factory secure level the assertion is set against.</p>
*
* <p>Schema and Templates assertions take a {@link Source} so the same helper covers both inline-string payloads and resource-backed wrappers; build the
* source via {@link #streamSource(String)} for a string payload or {@link #resourceSource(String)} for a file under {@code src/test/resources/leaked/}. The
@@ -115,7 +115,7 @@ public void setFeature(final String name, final boolean value) throws SAXNotReco
/**
* Strict reporter installed on every secure factory, parser, validator and transformer in the helpers below.
*
- * <p>The hardening layer signals every blocked external fetch and every SAX-fatal it could not silently skip via the standard JAXP error channels:
+ * <p>The secure layer signals every blocked external fetch and every SAX-fatal it could not silently skip via the standard JAXP error channels:
* {@link ErrorListener#error(TransformerException)} / {@link ErrorListener#fatalError(TransformerException) fatalError} on the TrAX side and
* {@link ErrorHandler#error(SAXParseException) error} / {@link ErrorHandler#fatalError(SAXParseException) fatalError} on the SAX side. Both Apache Xalan's
* {@code DefaultErrorHandler(false)} and Saxon's {@code StandardErrorListener} are pathologically lenient defaults that swallow these events; SAX's
@@ -226,7 +226,7 @@ static void assertDomBlocksOrDoesNotLeak(final String payload) {
/**
* Asserts a secure DOM parse completes without throwing and without leaked content.
*
- * <p>{@link DocumentBuilder#parse(InputSource)} via {@link SecureDocumentBuilderFactory#newInstance()}; use this when the hardening guarantee is "the parse
+ * <p>{@link DocumentBuilder#parse(InputSource)} via {@link SecureDocumentBuilderFactory#newInstance()}; use this when the secure guarantee is "the parse
* succeeds but never resolves the external resource", for example, when the ignore-all resolver floor resolves the external subset to empty content.</p>
*/
static void assertDomDoesNotLeak(final String payload) {
@@ -251,7 +251,7 @@ static void assertDomParses(final String payload) {
*
* @param action The parse to execute, returning the captured output text checked for {@link #LEAKED_MARKER}.
* @param description short label naming the JAXP surface under test.
- * @param expected The exception types any of which the hardening layer may surface as a clean rejection.
+ * @param expected The exception types any of which the secure layer may surface as a clean rejection.
*/
@SafeVarargs
private static void assertNoLeakOrThrows(final ThrowingSupplier<String> action, final String description, final Class<? extends Throwable>... expected) {
@@ -260,7 +260,7 @@ private static void assertNoLeakOrThrows(final ThrowingSupplier<String> action,
output = action.get();
} catch (final Throwable thrown) {
if (Arrays.stream(expected).anyMatch(c -> c.isInstance(thrown))) {
- return; // hardening blocked at parse; acceptable outcome.
+ return; // secure blocked at parse; acceptable outcome.
}
throw new AssertionError(blockedDescription(description) + " (got " + thrown.getClass().getName() + ")", thrown);
}
@@ -272,7 +272,7 @@ private static void assertNoLeakOrThrows(final ThrowingSupplier<String> action,
* Skeleton for every strict {@code assert*DoesNotLeak} helper.
*
* <p>Runs the action, lets any thrown exception fail the assertion, and asserts that the captured output omits {@link #LEAKED_MARKER}. Use this when the
- * hardening contract guarantees "parses successfully without resolving the external resource"; use {@link #assertNoLeakOrThrows} when the contract is
+ * secure contract guarantees "parses successfully without resolving the external resource"; use {@link #assertNoLeakOrThrows} when the contract is
* "either blocks at parse or completes without leaked content".</p>
*
* @param action The parse to execute, returning the captured output text checked for {@link #LEAKED_MARKER}.
@@ -289,7 +289,7 @@ private static void assertNoLeakStrict(final ThrowingSupplier<String> action, fi
*
* @param action The parse to execute.
* @param description short label naming the JAXP surface under test.
- * @param expected The exception type the hardening layer is expected to surface.
+ * @param expected The exception type the secure layer is expected to surface.
*/
static void assertParseFails(final Executable action, final String description, final Class<? extends Throwable> expected) {
assertThrows(expected, action, blockedDescription(description));
@@ -300,7 +300,7 @@ static void assertParseFails(final Executable action, final String description,
*
* @param action The parse to execute.
* @param description short label naming the JAXP surface under test.
- * @param expected The exception types any of which the hardening layer may surface.
+ * @param expected The exception types any of which the secure layer may surface.
*/
@SafeVarargs
static void assertParseFails(final Executable action, final String description, final Class<? extends Throwable>... expected) {
@@ -460,7 +460,7 @@ static void assertSaxBlocksOrDoesNotLeak(final String payload) {
/**
* Asserts a secure SAX parse completes without throwing and without leaked content.
*
- * <p>{@link XMLReader#parse(InputSource)} on a parser from {@link SecureSAXParserFactory#newInstance()}; use this when the hardening guarantee is "the parse
+ * <p>{@link XMLReader#parse(InputSource)} on a parser from {@link SecureSAXParserFactory#newInstance()}; use this when the secure guarantee is "the parse
* succeeds but never resolves the external resource", for example, when the ignore-all resolver floor resolves the external subset to empty content.</p>
*/
static void assertSaxDoesNotLeak(final String payload) {
@@ -508,7 +508,7 @@ static void assertSchemaCompiles(final Source xsd) {
/**
* Asserts a secure Schema compilation completes without throwing.
*
- * <p>{@link SchemaFactory#newSchema(Source)} via {@link SecureSchemaFactory#newInstance(String)}; use this when the hardening contract guarantees the compile
+ * <p>{@link SchemaFactory#newSchema(Source)} via {@link SecureSchemaFactory#newInstance(String)}; use this when the secure contract guarantees the compile
* succeeds but never resolves the external resource (for example, {@code XERCES_LOAD_EXTERNAL_DTD=false} silently skipping the external subset, with the body's
* undeclared entity reference dropped per XML 1.0 ยง4.1).</p>
*/
@@ -539,7 +539,7 @@ static void assertStaxBlocksOrDoesNotLeak(final String payload) {
* Asserts a secure StAX parse completes without throwing and without leaked content.
*
* <p>{@link XMLStreamReader} and {@link XMLEventReader} from {@link SecureXMLInputFactory#newInstance()}; both flavors are exercised. Use this when the
- * hardening guarantee is "the parse succeeds but never resolves the external resource", for example, when the JDK's {@code ignore-external-dtd} property silently
+ * secure guarantee is "the parse succeeds but never resolves the external resource", for example, when the JDK's {@code ignore-external-dtd} property silently
* skips the external subset.</p>
*/
static void assertStaxDoesNotLeak(final String payload) {
@@ -668,7 +668,7 @@ static void assertValidatorBlocksOrDoesNotLeak(final String xml) {
* Asserts a secure Validator validation completes without throwing.
*
* <p>{@link Validator#validate(Source)} on a validator from {@link #BENIGN_SCHEMA} compiled via {@link SecureSchemaFactory#newInstance(String)}; use this when the
- * hardening contract guarantees the validate succeeds but never resolves the external resource.</p>
+ * secure contract guarantees the validate succeeds but never resolves the external resource.</p>
*/
static void assertValidatorDoesNotLeak(final String xml) {
assertParseSucceeds(
@@ -707,7 +707,7 @@ static void assertXmlReaderBlocksOrDoesNotLeak(final String payload) {
/**
* Asserts a hardened-in-place XMLReader parse completes without throwing and without leaked content.
*
- * <p>{@link XMLReader#parse(InputSource)} on a raw reader secure via {@link SecureSAXParserFactory#secure(XMLReader)}; use this when the hardening contract
+ * <p>{@link XMLReader#parse(InputSource)} on a raw reader secure via {@link SecureSAXParserFactory#secure(XMLReader)}; use this when the secure contract
* guarantees the parse succeeds but never resolves the external resource.</p>
*/
static void assertXmlReaderDoesNotLeak(final String payload) {