CVE-2026-59371
Patch Available.
This Vulnerability has been fixed in the Never-Ending Support (NES) version offered by HeroDevs.
Overview
Spring Web Services is the Spring project for building contract-first SOAP web services and SOAP clients. Its WebServiceTemplate client runs outgoing requests and incoming responses through a chain of client interceptors, which handle concerns such as XML schema validation and WS-Security.
A signature forgery vulnerability (CVE-2026-59371) has been identified in the client-side schema validation interceptors of Spring Web Services, which allows attackers who can supply a response to a client to bypass the client's WS-Security signature and encryption checks by making the response payload schema-invalid. The unverified response is then returned to the application.
Per OWASP: Software and data integrity failures relate to code and infrastructure that does not protect against integrity violations.
This issue affects multiple versions of Spring Web Services.
Details
Module Info
- Product: Spring Web Services
- Affected packages:
org.springframework.ws:spring-ws-core - Affected versions: <=3.1.9, >=4.0.0 <=4.0.19, >=4.1.0 <=4.1.4, >=5.0.0 <=5.0.3
- GitHub repository: https://github.com/spring-projects/spring-ws
- Published packages: https://central.sonatype.com/artifact/org.springframework.ws/spring-ws-core
- Package manager: Maven
- Fixed in:
- OSS Spring Web Services 5.0.4
- NES for Spring Web Services
Vulnerability Info
This Medium-severity vulnerability is found in the org.springframework.ws:spring-ws-core package in multiple versions of Spring Web Services. It affects clients that declare a PayloadValidatingInterceptor with validateResponse set to true, and declare a response-securing interceptor, such as Wss4jSecurityInterceptor validating responses, before it in the client's interceptor list. Wss4jSecurityInterceptor validates responses by default.
When a response fails schema validation, AbstractValidatingInterceptor.handleResponse returns the result of handleResponseValidationErrors, which only logs the errors and returns false:
protected boolean handleResponseValidationErrors(MessageContext messageContext, SAXParseException[] errors)
throws WebServiceValidationException {
for (SAXParseException error : errors) {
this.logger.warn("XML validation error on response: " + error.getMessage());
}
return false;
}WebServiceTemplate calls the response interceptors in reverse order, so the interceptors declared before the validating one run after it. A false result breaks that loop, and the template then extracts the response and hands it to the caller:
private void triggerHandleResponse(int interceptorIndex, MessageContext messageContext) {
if (messageContext.hasResponse() && this.interceptors != null) {
for (int i = interceptorIndex; i >= 0; i--) {
if (!this.interceptors[i].handleResponse(messageContext)) {
break;
}
}
}
}Rejecting an invalid response is the expected outcome here, but the method fails open instead. The response is neither rejected nor passed to the remaining interceptors, so the WS-Security interceptor never checks its security header. An attacker able to supply the response, for example through a compromised or impersonated service endpoint, can send a payload that deliberately fails schema validation. The client then accepts the response without verifying its signature or decrypting it, and the application consumes content whose integrity and origin were never checked.
Mitigation
Only recent versions of Spring Web Services receive community support. Older lines are End-of-Life and will not receive public updates to address this issue.
Where an upgrade is not immediately possible, unset validateResponse on the validating interceptor, so that WS-Security validation of responses continues to apply, or subclass the interceptor and override handleResponseValidationErrors to throw a WebServiceValidationException:
public class RejectingPayloadValidatingInterceptor extends PayloadValidatingInterceptor {
@Override
protected boolean handleResponseValidationErrors(MessageContext messageContext, SAXParseException[] errors) {
throw new WebServiceValidationException(errors);
}
}Users of the affected components should apply one of the following mitigations:
- Upgrade to a currently supported version of Spring Web Services.
- Leverage a commercial support partner like HeroDevs for post-EOL security support.