CVE-2026-59434
Patch Available.
This Vulnerability has been fixed in the Never-Ending Support (NES) version offered by HeroDevs.
Overview
Spring Cloud Kubernetes provides implementations of well known Spring Cloud interfaces, such as externalized configuration and service discovery, that allow developers to build and run Spring Cloud applications on Kubernetes. Its configuration support loads application properties from Kubernetes ConfigMaps and Secrets.
A remote code execution vulnerability (CVE-2026-59434) has been identified in the ConfigMap and Secret property source support of Spring Cloud Kubernetes, which allows attackers who can write to a ConfigMap or Secret that the application reads to make the application instantiate arbitrary Java types. With a SnakeYAML version earlier than 2.0 on the classpath, this unsafe deserialization can lead to the execution of attacker-chosen code.
Per OWASP: Data which is untrusted cannot be trusted to be well formed. Malformed data or unexpected data could be used to abuse application logic, deny service, or execute arbitrary code, when deserialized.
This issue affects multiple versions of Spring Cloud Kubernetes.
Details
Module Info
- Product: Spring Cloud Kubernetes
- Affected packages:
org.springframework.cloud:spring-cloud-kubernetes-commons - Affected versions: >=3.1.0 <=3.2.4, >=3.3.0 <=3.3.4, >=5.0.0 <=5.0.4
- GitHub repository: https://github.com/spring-cloud/spring-cloud-kubernetes
- Published packages: https://central.sonatype.com/artifact/org.springframework.cloud/spring-cloud-kubernetes-commons
- Package manager: Maven
- Fixed in:
- OSS Spring Cloud Kubernetes 5.0.5
- NES for Spring Cloud Kubernetes
Vulnerability Info
This Medium-severity vulnerability is found in the org.springframework.cloud:spring-cloud-kubernetes-commons package in multiple versions of Spring Cloud Kubernetes.
When Spring Cloud Kubernetes reads a ConfigMap or Secret, SourceDataEntriesProcessor treats any data entry whose name ends in .yml or .yaml as a YAML document. It passes the entry's value to the parser returned by PropertySourceUtils.yamlParserGenerator, which hands it to ProfileActivationAwareYamlPropertiesFactoryBean.createProperties. That method parses the content with a SnakeYAML Yaml instance created with its default constructor:
Map<String, Object> createProperties(String source) {
LinkedHashMap<String, Object> finalMap = new LinkedHashMap<>();
Yaml yaml = new Yaml();
Resource resource = new ByteArrayResource(source.getBytes(StandardCharsets.UTF_8));
try (Reader reader = new UnicodeReader(resource.getInputStream())) {
Iterable<Object> iterable = yaml.loadAll(reader);
// ...
The Yaml instance is built without a SafeConstructor and without the type restrictions that Spring Framework's own YamlProcessor applies to the YAML it loads. In SnakeYAML versions earlier than 2.0, the default constructor resolves global tags such as !!com.example.SomeClass to Java classes and invokes their constructors and setters while the document is loaded. An attacker with write access to a ConfigMap or Secret that the application consumes can therefore place a crafted .yaml entry in it, and the application instantiates the attacker-chosen types when it loads its configuration. Depending on the classes available on the classpath, this can be used to execute arbitrary code in the application.
Mitigation
Only recent versions of Spring Cloud Kubernetes 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 Kubernetes.
- Leverage a commercial support partner like HeroDevs for post-EOL security support.