CVE-2026-59440
Patch Available.
This Vulnerability has been fixed in the Never-Ending Support (NES) version offered by HeroDevs.
Overview
Spring Cloud Function is a Spring project that promotes implementing business logic as functions and decouples that logic from any specific runtime target, so the same code can run as a web endpoint, a stream processor, or a task.
A resource injection vulnerability (CVE-2026-59440) has been identified in the JsonMessageConverter of Spring Cloud Function, which allows attackers to make the application load JDK system or platform classes named in a message's content type and convert the message payload into them.
Per OWASP: This attack consists of changing resource identifiers used by an application in order to perform a malicious task.
This issue affects multiple versions of Spring Cloud Function.
Details
Module Info
- Product: Spring Cloud Function
- Affected packages:
org.springframework.cloud:spring-cloud-function-context - Affected versions: >=4.0.0 <=4.2.4, >=4.3.0 <=4.3.4, >=5.0.0 <=5.0.5
- GitHub repository: https://github.com/spring-cloud/spring-cloud-function
- Published packages: https://central.sonatype.com/artifact/org.springframework.cloud/spring-cloud-function-context
- Package manager: Maven
- Fixed in:
- OSS Spring Cloud Function 5.0.6
- NES for Spring Cloud Function
Vulnerability Info
This Low-severity vulnerability is found in the spring-cloud-function-context package in multiple versions of Spring Cloud Function. As a feature, Spring Cloud Function lets a message specify the type its JSON payload should be converted to through the type parameter of its content type, for example application/json;type=com.example.Order. When the target type of a function cannot be resolved more precisely than Object, JsonMessageConverter.convertFromInternal reads that parameter and loads the named class through the thread context class loader:
MimeType mimeType = getMimeType(message.getHeaders());
String type = mimeType.getParameter("type");
if (StringUtils.hasText(type)) {
try {
convertToType = Thread.currentThread().getContextClassLoader().loadClass(type);
}
catch (ClassNotFoundException e) {
throw new IllegalArgumentException("Failed to load class `" + type + "` specified by the provided content-type: " + mimeType, e);
}
}
The resolved class is then passed to this.jsonMapper.fromJson(message.getPayload(), convertToType), which builds an instance of it from the payload. Nothing checks which class loader defined the class, so a sender who controls the content type of a message can name any JDK class from the bootstrap or platform class loader, such as a java.* type, and have the payload deserialized into it. Some releases also compare the name against a configured list of deserializable types before loading it, but the list check alone still accepts a JDK system or platform class whenever its name is on the list.
Mitigation
Only recent versions of Spring Cloud Function receive community support. Older lines are End-of-Life and will not receive public updates to address this issue.
Users of the affected components should apply one of the following mitigations:
- Upgrade to a currently supported version of Spring Cloud Function.
- Leverage a commercial support partner like HeroDevs for post-EOL security support.
Credits
- hussst (finder)