CVE-2026-47881 Overview
CVE-2026-47881 is a denial-of-service vulnerability in Spring Batch's FlatFileItemReader. The reader supports files where a single logical record spans multiple physical lines, such as a CSV field containing embedded newlines wrapped in quotes. A specially crafted input file can exploit the multi-line record assembly logic to consume excessive CPU time and memory. The result is a stalled batch job or an out-of-memory failure.
The issue affects Spring Batch versions 6.0.0 through 6.0.4, 5.2.0 through 5.2.6, and 4.3.0 through 4.3.13. The vulnerability is tracked as an algorithmic complexity issue leading to resource exhaustion [CWE-400].
Critical Impact
Attackers who can supply input files to a Spring Batch job can trigger CPU and memory exhaustion, stalling batch processing or crashing the JVM.
Affected Products
- Spring Batch 6.0.0 through 6.0.4
- Spring Batch 5.2.0 through 5.2.6
- Spring Batch 4.3.0 through 4.3.13
Discovery Timeline
- 2026-08-27 - CVE-2026-47881 published to NVD
- 2026-08-27 - Last updated in NVD database
Technical Details for CVE-2026-47881
Vulnerability Analysis
Spring Batch provides the FlatFileItemReader component to read flat files, including CSV. The reader supports multi-line records where a field can contain embedded newlines when properly quoted. To assemble a single logical record, the reader continues reading physical lines until quoting is balanced.
An attacker who controls the input file can craft content that causes the assembly logic to buffer excessive data or perform expensive operations on each additional line. The pathological input drives CPU and heap usage until the batch job stalls or the JVM throws OutOfMemoryError.
Exploitation requires an attacker to influence the file processed by the batch job. This may be direct upload, staged content in an object store, or files sourced from an integration partner. No authentication to Spring Batch itself is required when the file pipeline accepts untrusted input.
Root Cause
The root cause is unbounded aggregation of physical lines during multi-line record assembly in FlatFileItemReader. The component does not enforce a hard limit on the number of continuation lines or the total buffered size for a single logical record. Malformed quoting that never closes forces the reader to accumulate content indefinitely.
Attack Vector
The attack vector is network-reachable in the sense that the input file traverses a data pipeline exposed to untrusted sources. An adversary submits a CSV or flat file containing an unterminated quoted field with embedded newlines. When Spring Batch processes the file, the reader consumes CPU and memory proportional to the crafted content until the job fails.
No verified public exploit code is available. See the Spring Security Advisory for CVE-2026-47881 for vendor technical details.
Detection Methods for CVE-2026-47881
Indicators of Compromise
- Batch jobs that stall or fail with OutOfMemoryError while reading a specific input file.
- Spring Batch worker JVM heap saturation shortly after job start, without progress on record counters.
- Input files with unusually long lines or unbalanced quote characters observed in FlatFileItemReader sources.
Detection Strategies
- Enable heap and CPU telemetry for JVMs running Spring Batch workloads and alert on sustained saturation during job execution.
- Add pre-processing validation that rejects files exceeding expected maximum line count, line length, or unbalanced quote counts.
- Log the number of physical lines consumed per logical record in FlatFileItemReader and alert on outliers.
Monitoring Recommendations
- Track job duration, records processed per second, and heap usage as a baseline per job type, then alert on deviation.
- Correlate batch job failures with the specific file source, upload user, or integration partner for triage.
- Monitor kill signals and OutOfMemoryError events in application logs across all Spring Batch nodes.
How to Mitigate CVE-2026-47881
Immediate Actions Required
- Inventory all applications using Spring Batch and identify versions in the affected ranges 4.3.0–4.3.13, 5.2.0–5.2.6, and 6.0.0–6.0.4.
- Upgrade to a fixed Spring Batch release as documented in the Spring Security Advisory for CVE-2026-47881.
- Restrict file ingestion paths that feed FlatFileItemReader to authenticated and validated sources only.
Patch Information
Refer to the Spring Security Advisory for CVE-2026-47881 for the fixed versions and upgrade guidance. Update the spring-batch-core and spring-batch-infrastructure dependencies in Maven or Gradle build files, then rebuild and redeploy affected batch applications.
Workarounds
- Pre-validate input files to enforce maximum file size, maximum line length, and balanced quote characters before invoking the batch job.
- Configure JVM heap limits and job timeouts so a malicious file fails fast rather than consuming shared resources.
- Isolate batch workers processing untrusted files into dedicated containers or nodes to contain resource exhaustion.
# Example: enforce JVM heap ceiling and job timeout for Spring Batch workers
java -Xmx1g -XX:+ExitOnOutOfMemoryError \
-Dspring.batch.job.timeout=600s \
-jar spring-batch-app.jar
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

