Apache Rampart is the WS-Security implementation for Apache Axis2/Java. It provides message-level security for SOAP web services: XML Signature, XML Encryption, UsernameToken authentication, SAML 1.1/2.0 assertion processing, Kerberos token support, WS-Trust (Secure Token Service), and WS-SecureConversation. Rampart is deployed as an Axis2 module (MAR) that adds inbound and outbound security handlers to the Axis2 message processing pipeline.
Rampart delegates cryptographic operations to Apache WSS4J (4.0.1) and SAML processing to OpenSAML (5.2.1). It is the security enforcement layer — if Rampart is bypassed or misconfigured, Axis2 services have no message-level security.
| Role | Trust Level | Description |
|---|---|---|
| Server Administrator | Fully trusted | Configures Rampart policies, manages keystores, deploys MAR modules. |
| Service Deployer | Trusted | Attaches WS-SecurityPolicy to services via WSDL or programmatic configuration. |
| Security Token Service (STS) | Trusted (configurable) | Issues SAML assertions and security context tokens. May be local (rahas module) or remote. Trust established via certificate validation. |
| Authenticated Client | Partially trusted | Presents valid security tokens (X.509 signature, SAML assertion, UsernameToken, Kerberos ticket). Rampart validates tokens against policy. |
| Anonymous Client | Untrusted | Sends SOAP messages without security headers. Rampart rejects if policy requires security. |
TransportBinding policy requires HTTPS but does not enforce it — it trusts the container’s isSecure() flag.Incoming SOAP Message
|
v
Axis2 Transport-In Phase
|
v
RampartReceiver (inbound handler)
|
v
RampartEngine.process(MessageContext)
|
v
Extract WS-Security header
|
v
WSSecurityEngine (WSS4J 4.0.1)
- Validate signatures (XML-DSIG via Apache Santuario)
- Decrypt encrypted parts (XML-ENC)
- Validate UsernameToken (password callback)
- Validate SAML assertions (OpenSAML 5.2.1)
- Validate Kerberos tokens (JDK JAAS/GSS)
- Validate timestamps (clock skew tolerance)
|
v
PolicyBasedResultsValidator
- Match WSS4J results against WS-SecurityPolicy assertions
- Verify required tokens present
- Verify signed/encrypted parts match policy
|
v
Service method invocation (if validation passes)
|
v
RampartSender (outbound handler)
|
v
MessageBuilder
- Apply signatures, encryption per outbound policy
- Add timestamps, nonces
- Insert security header into SOAP envelope
|
v
Axis2 Transport-Out Phase
| Component | Threats | Mitigations |
|---|---|---|
| XML Signature validation (WSS4J/Santuario) | Signature wrapping; reference manipulation; HMAC truncation | WSS4J 4.0.1 signature reference validation; Santuario's strict reference processing |
| XML Encryption (WSS4J/Santuario) | Padding oracle; chosen-ciphertext attacks; CBC mode weaknesses | Algorithm suite enforcement; GCM recommended over CBC |
| SAML assertion parsing (OpenSAML 5.2.1) | XXE in assertion XML; forged assertions; expired/replayed assertions; issuer spoofing | OpenSAML unmarshalling; assertion signature validation; NotBefore/NotOnOrAfter enforcement; issuer certificate pinning |
| SAML2Utils.getSAML2KeyInfo() | XXE — DocumentBuilderFactory.newInstance() without explicit XXE hardening flags | Depends on OpenSAML's AxiomParserPool configuration; review needed |
| WS-Trust STS (rahas module) | Token issuance policy bypass; privilege escalation via crafted RequestSecurityToken (RST); DoS against token issuance | TokenIssuer implementations must validate RSTs against policy before issuing tokens |
| UsernameToken validation | Plaintext password interception; weak hashing; brute force | TransportBinding requires HTTPS for plaintext; nonce+created for hashed; callback-based validation |
| Kerberos token decoding | Forged tickets; replay attacks | JDK Kerberos SPI handles validation; keytab/realm configuration is admin responsibility |
| Certificate/key management | Key confusion; expired certificates; revocation bypass | CertificateValidator extends WSS4J SignatureTrustValidator; chain validation delegated to JDK |
| Timestamp validation | Replay attacks; clock skew exploitation | WSS4J timestamp processing; configurable skew tolerance |
| Nonce caching | Replay of previously valid nonces | In-memory nonce cache; cache TTL configuration |
| Policy matching | Downgrade attacks; policy confusion | PolicyBasedResultsValidator enforces all required assertions |
| Transport binding validation | HTTPS bypass | RampartUtil.validateTransport() checks servlet container's isSecure() flag and optionally extracts client certificate from jakarta.servlet.request.X509Certificate attribute — trusts container entirely |
| Crypto caching | Stale key material | CachedCrypto with TTL; thread-safe access |
| Dependency | Version | Security Role |
|---|---|---|
| WSS4J | 4.0.1 | Core WS-Security processing — signatures, encryption, token validation |
| OpenSAML | 5.2.1 | SAML assertion parsing, validation, and issuance |
| Apache Santuario (xmlsec) | via WSS4J | XML Signature and XML Encryption implementation |
| Bouncy Castle | runtime dependency | JCE provider for advanced crypto algorithms |
Maintenance note (RAMPART-454): When updating these dependencies, reviewers must read every intermediate CVE release note (not just the latest version), ensure no weak algorithm or key size is reintroduced as a default, and re-run all policy samples to verify no regression.
Rampart has no independently assigned CVEs. Its security posture depends heavily on WSS4J and OpenSAML, which have extensive CVE histories:
The scan should verify that Rampart's integration with these libraries does not reintroduce vulnerabilities that the libraries themselves have fixed — particularly in areas where Rampart wraps or preprocesses data before passing it to WSS4J/OpenSAML (e.g., Axis2Util.getDocumentFromSOAPEnvelope(), SAML2Utils.getSAML2KeyInfo()).
SAML2Utils.getSAML2KeyInfo() — Creates DocumentBuilderFactory without visible XXE hardening. If the OpenSAML AxiomParserPool does not enforce XXE protections, this is a vulnerability.
RampartUtil.validateTransport() — Trusts the servlet container's isSecure() flag and X.509 certificate attribute without re-validating the certificate chain. Container misconfiguration could bypass client certificate authentication.
Algorithm suite defaults — Policy samples include sp:Basic128 which uses 3DES. Scan for any code path where weak algorithms are accepted by default without explicit policy opt-in.
Plaintext password handling — RampartUsernameTokenValidator overrides WSS4J's default password verification. Verify the override does not weaken validation.
Report vulnerabilities to: security@apache.org
Follow the Apache Security Policy.