CVE-2026-41862: Spring Statemachine Kryo Deserialization RCE
Spring Statemachine versions 3.2.0–3.2.4 and 4.0.0–4.0.1 contain a critical flaw in how they store and restore application state using Kryo serialization. When applications use JPA, MongoDB, Redis, or ZooKeeper backends to persist state-machine contexts, the framework deserializes that data without validating which classes are allowed to be reconstructed. An attacker with valid application credentials can craft malicious serialized payloads that, when restored, execute arbitrary code within the application's Java process. This is a classic unsafe deserialization vulnerability that treats any persisted data as trustworthy.
Source data · NVD / CISA · public domain
- CVSS
- 3.1 · 8.8 HIGH · CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- Weaknesses (CWE)
- CWE-502
- Affected products
- 0 configuration(s)
- Published / Modified
- 2026-06-23 / 2026-06-25
NVD description (verbatim)
Spring Statemachine's Kryo-based persistence backends (JPA, MongoDB, Redis and ZooKeeper) deserialise persisted state-machine contexts without enforcing a class allowlist (CWE-502, deserialisation of untrusted data), which can lead to remote code execution inside the application JVM. Affected versions: Spring Statemachine 4.0.0 through 4.0.1 Spring Statemachine 3.2.0 through 3.2.4
1 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
The vulnerability stems from Kryo deserialization in Spring Statemachine's persistence layer (CWE-502). Kryo is a fast Java serialization framework, but it can instantiate arbitrary classes during deserialization unless an allowlist (known as a classloader filter or type mapping) is enforced. The affected versions apply Kryo to multiple storage backends without such controls. An authenticated user who can influence or inject persisted state-machine context data can cause the Kryo deserializer to instantiate malicious objects, triggering static initializers, constructors, or method calls that lead to remote code execution within the application JVM. The CVSS 3.1 score of 8.8 (HIGH) reflects the requirement for prior authentication (PR:L) but the complete compromise potential (C:H, I:H, A:H) and network accessibility (AV:N).
Business impact
Any application running Spring Statemachine 3.2.0–3.2.4 or 4.0.0–4.0.1 with persistence enabled faces the risk that a logged-in user or an attacker who gains user credentials can achieve remote code execution. This enables data theft, system compromise, lateral movement within the network, and potential supply-chain attacks if the compromised application is a service provider. Remediation requires either upgrading to patched versions or disabling Kryo-based persistence until a fix is deployed. Organizations should assess whether any critical workflows depend on persistence and prioritize patching accordingly.
Affected systems
Spring Statemachine 3.2.0, 3.2.1, 3.2.2, 3.2.3, 3.2.4, 4.0.0, and 4.0.1 are affected when configured with JPA, MongoDB, Redis, or ZooKeeper persistence backends. Applications that use Spring Statemachine for workflow management, order processing, or any stateful business logic with persistence are in scope. Versions prior to 3.2.0 and versions released after the patch (consult the Spring project release notes) are not affected.
Exploitability
Exploitation requires valid application credentials (authentication is enforced per the CVSS vector PR:L). There is no known public exploit code, and the vulnerability is not currently tracked in the CISA Known Exploited Vulnerabilities catalog. However, the attack surface is accessible over the network if the application is exposed, and the technical barrier to crafting a Kryo payload is moderate for attackers familiar with Java serialization. Once credentials are compromised or if credential controls are weak, exploitation becomes practical. Internal threat actors with legitimate access pose a meaningful risk.
Remediation
Organizations should immediately update to patched versions released by the Spring project after 4.0.1 and 3.2.4. Verify the exact patched version numbers in the official Spring Security or Spring Statemachine advisory. As an interim control, disable Kryo-based persistence if the application permits; switch to alternative serialization backends or disable persistence entirely until patches are applied. Review access logs and persistence storage (databases, caches, queues) for signs of unauthorized state-machine context injection or deserialization errors.
Patch guidance
Check the Spring Statemachine release notes and security advisory for the earliest patched versions following 4.0.1 and 3.2.4. Apply patches in a controlled manner: test in staging first to confirm compatibility with your persistence backend (JPA, MongoDB, Redis, ZooKeeper). If you are on 3.2.x, verify the upgrade path to the patched 3.2.x version; if on 4.0.x, similarly check for a patched 4.0.x release. If no patched version exists in your minor release line, plan a minor or major version upgrade. Monitor application logs during and after patching for deserialization warnings or exceptions.
Detection guidance
Monitor application logs for Kryo deserialization errors, ClassNotFoundException, or SecurityException events related to persistence operations. Check for unusual activity following state-machine context restoration. Review authentication logs for failed or successful logins followed by state-machine mutations. In persistence layers (database, Redis, ZooKeeper), look for anomalous serialized objects or unexpected payload sizes in state-machine context records. Set up alerting on deserialization exceptions and track any process execution spawned by the application JVM after state-machine context loads. Network-based detection is difficult without deep packet inspection; focus on host and application logging.
Why prioritize this
This vulnerability merits immediate attention because it enables remote code execution within the application JVM—the highest-impact privilege escalation. Although it requires authentication, compromised credentials are common, and the persistence backends are often accessible in cloud or containerized deployments. The CVSS score of 8.8 and the breadth of affected versions (two minor release lines) justify urgent patching. Any organization running Spring Statemachine should determine within hours whether they are on an affected version.
Risk score, explained
The CVSS 3.1 score of 8.8 is HIGH because of the full confidentiality, integrity, and availability impact (C:H, I:H, A:H) and network-accessible attack vector (AV:N). The requirement for authenticated access (PR:L) prevents a CRITICAL rating, but in practice, credential compromise is frequent. The low attack complexity (AC:L) reflects that no special conditions or user interaction (UI:N) are needed once an attacker has valid credentials. The unchanged scope (S:U) means impact is confined to the affected application, not other systems—though lateral movement is often a follow-on risk.
Frequently asked questions
Do we need valid credentials to exploit this?
Yes. The CVSS vector includes PR:L (privileges required: low), meaning the attacker must possess valid application credentials. However, this does not mean the vulnerability is low-risk: credential theft, weak password policies, or insider threats can quickly enable exploitation. If your application exposes login to the internet, the attack surface is significant.
Is there an exploit available or is this vulnerability being actively exploited?
As of the current date, there is no known public exploit code, and the vulnerability is not listed in the CISA Known Exploited Vulnerabilities catalog. However, exploitation is straightforward for attackers familiar with Java Kryo serialization, so treat this as a high-priority patch regardless of current threat intelligence.
Can we work around this without patching?
Partially. If your application can tolerate disabling persistence (or switching to a non-Kryo serialization backend), that mitigates the vulnerability until a patch is available. Review your business requirements for state-machine persistence; if it is not critical, disable it. Otherwise, upgrade to a patched version as soon as possible.
Which persistence backends are affected?
All four listed: JPA (relational databases), MongoDB, Redis, and ZooKeeper. Applications using Spring Statemachine with any of these backends and Kryo serialization are at risk. Applications not using persistence, or those using alternative serialization methods, are unaffected.
This analysis is based on the CVE record as of the published date. Patch versions, advisory details, and exploitation status may evolve; always consult the official Spring Security project advisory and your vendor's guidance before applying patches. No exploit code or detailed attack steps are provided. This vulnerability requires authenticated access; however, credential compromise is common and should not be underestimated when assessing risk. Test patches thoroughly in a staging environment before production deployment. Source: NVD (public-domain), retrieved 2026-07-29. Analysis generated by SEC.co (claude-haiku-4-5).
Weaknesses (CWE)
Related vulnerabilities
- CVE-2025-11993HIGHWooCommerce Infinite Scroll Plugin PHP Object Injection – HIGH Severity
- CVE-2025-27511HIGHGeoServer DB2 JNDI Injection Remote Code Execution
- CVE-2025-69130HIGHPHP Object Injection in Entrepreneur WordPress Booking Theme ≤3.1.3
- CVE-2025-71339HIGHPicklescan Gadget Bypass Allows Arbitrary Code Execution
- CVE-2025-71341HIGHPicklescan Bypass Enables Remote Code Execution via profile.Profile.runctx
- CVE-2025-71344HIGHpicklescan RCE via Undetected ensurepip._run_pip
- CVE-2025-71348HIGHpicklescan Detection Evasion in Torch Config Loading
- CVE-2025-71357HIGHPicklescan Evasion via idlelib.pyshell.ModifiedInterpreter