Feature Secure Processing is a Java XML safety setting intended to restrict risky parsing behavior. It is exposed as javax.xml.XMLConstants.FEATURE_SECURE_PROCESSING and can reduce exposure to external entities and related attack vectors. Its effect is not uniform across parsers, so teams must confirm what it actually blocks in each class.
What Feature Secure Processing actually changes
Feature Secure Processing is a parser safety switch, not a complete XML security model. It is designed to narrow risky parsing behaviour, but the exact protections vary by parser implementation, so teams should treat the flag as a baseline constraint rather than a universal guarantee.
The practical value is that it can reduce the parser’s willingness to expand external or expensive XML constructs that attackers commonly abuse. The limitation is equally important: if a parser does not interpret the feature the same way as another library, the same code change may leave different exposure in place.
Why parser behaviour differs across Java XML stacks
Java exposes the setting through javax.xml.XMLConstants.FEATURE_SECURE_PROCESSING, but the feature is consumed by different XML parsers, validation engines and transformation libraries in different ways. That means the control is partly a contract with the implementation, not just a property of the calling code.
This is why secure defaults must be verified at the library level. A team can enable the flag and still retain unsafe behaviour if the parser ignores part of the setting, applies it only in certain code paths, or requires companion configuration for entity handling, schema resolution or external access restrictions.
Security implications of relying on it
When it works as intended, the setting helps reduce exposure to XML-based abuse such as entity expansion and related parser exhaustion paths. Those attacks matter because they can convert a small input into resource pressure, unexpected data access or parsing failures that are hard to diagnose after the fact.
The main security implication is that the feature is defensive, but not self-validating. Organisations should not assume that turning it on eliminates XXE-style exposure, because parser-specific behaviour can leave gaps around external resolution, validation-time fetching or other risky XML features.
How to validate and govern secure XML parsing
The right way to use the feature is to test the exact parser class in use, then confirm what it blocks under realistic inputs. That should be part of secure coding review, dependency review and regression testing for any code path that accepts XML from untrusted or semi-trusted sources.
Where XML processing is part of a larger workflow, teams should also document the parser version, the feature set it honours and any companion hardening rules needed for entity resolution and external access. This matters because secure processing settings often fail quietly, which makes configuration drift easy to miss until an edge case is triggered.
Risk and Threat Considerations
Feature Secure Processing is attractive because it targets a common XML abuse path, but the risk is false confidence. If a parser only partially honours the flag, hostile XML can still trigger entity expansion, resource exhaustion or unintended outbound resolution, especially in code that was assumed to be hardened.
Failure mechanism: The application enables the setting, but the parser implementation only constrains some risky behaviours, leaving other XML processing paths available to an attacker.
Impact: Teams may still face denial of service, data exposure or parser-driven outbound requests, and they may discover the gap only after a malicious payload reaches production.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
NIST SP 800-53 Rev 5 and CIS Controls v8 set the technical controls, while ISO/IEC 27001:2022 defines the regulatory obligations.
| Framework | Control / Reference | Relevance |
|---|---|---|
| NIST SP 800-53 Rev 5 | SI-10 — Information Input Validation | XML parser hardening depends on validating untrusted input before parsing. |
| SC-18 — Mobile Code | Parser-executed content and external resolution paths create execution-like risk surfaces. | |
| Recommendation — Validate XML inputs and constrain parser behavior for untrusted content. Restrict risky parser features that can execute or fetch external content. | ||
| CIS Controls v8 | CIS-16 — Application Software Security | Secure XML parsing is an application security control that should be verified in code and configuration. |
| Recommendation — Test application parsers to ensure risky XML processing is disabled or constrained. | ||
| ISO/IEC 27001:2022 | A.8.28 — Secure coding | Secure XML parsing is a secure-coding concern where library defaults must be verified. |
| Recommendation — Define and enforce secure XML parsing requirements in development standards. | ||
Practitioner Guidance
What to watch for: Treat this setting as verified only after testing the concrete parser and code path, not after checking a configuration file or framework default. If different components in the stack use different XML libraries, each one needs separate confirmation.
Practitioner takeaway: Secure processing is useful when it is proven in context, but unsafe when it is assumed from the API name alone.
Related resources from NHI Mgmt Group
- How should security teams secure background job processing when jobs can access sensitive data and internal systems?
- How should security teams secure headless browsers used for AI automation and backend processing?
- When should organisations unify batch and streaming feature processing?
- Should organisations treat prompt pre-processing as an AI control or an application feature?
Deepen Your Knowledge
Free weekly newsletter
Subscribe to the NHI & AI Identity Journal
The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.
Bonus 33% off our NHI Course when you subscribe.
Reviewed and updated by the NHIMG editorial team on October 31, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org