CVE-2020-5411: Deserialization of Untrusted Data in Spring Batch

Summary

24/05/2022
Yes i
High
8.1

CVE-2020-5411: Deserialization of Untrusted Data in Spring Batch. Affects org.springframework.batch:spring-batch-core versions >= 4.0.0, < 4.2.3. Fixed in 4.2.3. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Spring Batch is a framework for batch processing in Java. It provides reusable components and patterns for processing large volumes of data in batch jobs. The framework leverages Jackson for serialization and deserialization of data. Jackson is a popular JSON library for Java that allows developers to convert Java objects to JSON and vice versa. However, Jackson had a deserialization vulnerability that could lead to arbitrary code execution. Spring Batch's default configuration enabled this vulnerability, making it susceptible to attacks if a malicious user gains write access to the data store used by the JobRepository.

Vulnerability Detail

The vulnerability in Spring Batch arises from the default typing feature of Jackson. When default typing is enabled, Jackson attempts to infer the type of the object being deserialized based on the serialized data. This can be exploited by an attacker by providing maliciously crafted serialized data that triggers the execution of arbitrary code during deserialization. In the context of Spring Batch, this vulnerability can be exploited if the job's ExecutionContext is serialized using Jackson and a malicious user gains write access to the JobRepository's data store. To mitigate this vulnerability, Jackson has blacklisted known "deserialization gadgets" to prevent their deserialization. Spring Batch should also proactively block unknown "deserialization gadgets" when enabling default typing.

How To Fix

Latest published version: 6.1.0-RC1 as of 23 Oct 2026

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

4.2.3

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If upgrading to the fixed version is not immediately feasible, a workaround is to disable default typing in Jackson. This can be done by configuring Jackson's ObjectMapper with the disableDefaultTyping() method. However, disabling default typing may impact the functionality of the application if it relies on polymorphic deserialization. It is recommended to thoroughly test the application after applying this workaround.

Conclusion

The deserialization vulnerability in Spring Batch can lead to arbitrary code execution if a malicious user gains write access to the JobRepository's data store. It is crucial to upgrade to Spring Batch version 4.2.3 or later to fix this vulnerability. Alternatively, you can disable default typing in Jackson, but this may have implications on the application's functionality. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for org.springframework.batch:spring-batch-core →

Share this vulnerability

FAQ

Spring Batch is a framework for batch processing in Java. It provides reusable components and patterns for processing large volumes of data in batch jobs.

Jackson is a popular JSON library for Java that allows developers to convert Java objects to JSON and vice versa.

Default typing is a feature in Jackson that enables the serialization and deserialization of polymorphic types without explicitly specifying the type information.

The deserialization vulnerability in Jackson can be exploited in Spring Batch if the job's ExecutionContext is serialized using Jackson and a malicious user gains write access to the JobRepository's data store. This can lead to arbitrary code execution.

The deserialization vulnerability can be mitigated by upgrading to Spring Batch version 4.2.3 or later, which includes the fix for the vulnerability. Alternatively, you can disable default typing in Jackson, but this may impact the functionality of the application.

Related vulnerabilities

Recent vulnerabilities recorded for org.springframework.batch:spring-batch-core.

How To Fix

Latest published version: 6.1.0-RC1 as of 23 Oct 2026

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

4.2.3

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback