Summary
CVE-2026-87830 is a security policy enforcement bypass in Apache WSS4J’s StAX (streaming) WS-SecurityPolicy validator. Certain relative or unsupported XPath expressions used to describe required elements are converted into internal paths that never actually match the real XML element path, causing the validator to silently fail to enforce signature and encryption requirements. As a result, a remote SOAP peer can send a message containing a "required" element that is missing its expected signature or encryption protection, and the streaming validator will accept it anyway. The issue affects any application using the org.apache.wss4j:wss4j-ws-security-policy-stax module to enforce WS-SecurityPolicy assertions via the streaming (StAX) processing path.
Technical details
- Root cause: When the streaming WS-SecurityPolicy validator translates policy-defined XPath expressions (used to identify elements that must be signed or encrypted) into the internal element-path representation it checks against incoming messages, relative or unsupported XPath forms can be converted incorrectly. The resulting internal path never matches the actual path of the element in the inbound XML document.
- Trigger conditions: A WS-SecurityPolicy configuration that relies on the StAX/streaming validator to enforce element-level signature or encryption requirements expressed via such XPath expressions.
- Attack vector: Network — a remote SOAP client or server can craft/send a SOAP message in which a policy-required element is present but lacks the mandated signature or encryption, and the receiving service’s streaming policy validator fails to detect the omission.
- Impact: Because the validator effectively treats the mismatched-path check as satisfied, messages that should be rejected for missing confidentiality or integrity protection are instead processed as valid. This can expose sensitive SOAP message content to disclosure or tampering that the WS-SecurityPolicy configuration was intended to prevent, without requiring authentication or user interaction.
Affected software
- Apache WSS4J versions prior to 2.4.4
- Apache WSS4J 3.0.0 through 3.0.5
- Apache WSS4J 4.0.0 through 4.0.1
- Specifically impacts applications using the
org.apache.wss4j:wss4j-ws-security-policy-staxmodule for streaming (StAX) WS-SecurityPolicy validation
Severity
- CVSS v3.1 Base Score: 9.1 (Critical)
- Vector:
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
Mitigation and recommended actions
- Immediate: Upgrade Apache WSS4J to version 2.4.4, 3.0.6, or 4.0.2, all of which fix the XPath-to-element-path conversion flaw in the streaming WS-SecurityPolicy validator.
- If patching is not immediately possible:
- Review WS-SecurityPolicy configurations that use the streaming (StAX) validation path and, where feasible, switch enforcement of signature/encryption requirements to the DOM-based validator until the upgrade can be applied.
- Audit policy expressions that rely on relative or non-standard XPath forms to identify required elements, as these are the specific constructs implicated in the mismatch.
- Monitor and restrict which peers can exchange SOAP messages with services relying on WS-SecurityPolicy enforcement, as an additional network-level compensating control.

