CVE-2026-59338

Denial of Service
Affects
Spring AI
in
Spring
No items found.
Versions
>=1.0.0 <=1.0.10, >=1.1.0 <=1.1.9, >=2.0.0 <=2.0.2

Patch Available.

Exclamation circle icon
Patch Available

This Vulnerability has been fixed in the Never-Ending Support (NES) version offered by HeroDevs.

Overview

Spring AI is an application framework for AI engineering. It applies Spring ecosystem design principles, such as portability and modular design, to the AI domain, and includes document readers that load content from files and URLs for use in AI applications.

A denial of service vulnerability (CVE-2026-59338) has been identified in the Spring AI TikaDocumentReader, which allows attackers to exhaust the JVM heap by supplying a sufficiently large document for the application to parse.

Per OWASP: The Denial of Service (DoS) attack is focused on making a resource (site, application, server) unavailable for the purpose it was designed. There are many ways to make a service unavailable for legitimate users by manipulating network packets, programming, logical, or resources handling vulnerabilities, among others. If a service receives a very large number of requests, it may cease to be available to legitimate users. In the same way, a service may stop if a programming vulnerability is exploited, or the way the service handles resources it uses.

This issue affects multiple versions of Spring AI.

Details

Module Info

Vulnerability Info

This High-severity vulnerability is found in the org.springframework.ai:spring-ai-tika-document-reader package in multiple versions of Spring AI.

TikaDocumentReader uses Apache Tika's AutoDetectParser to extract text from documents such as PDFs, Office files and HTML. Every constructor that does not take an explicit ContentHandler ends in the following one, which creates a BodyContentHandler with a write limit of -1 (shown from the 1.1.x source; 2.0.x creates the same handler through a supplier):

public TikaDocumentReader(Resource resource, ExtractedTextFormatter textFormatter) {
	this(resource, new BodyContentHandler(-1), textFormatter);
}

A write limit of -1 turns off Tika's built-in content-size limit, so get() parses the whole resource and buffers all of the extracted text in memory before converting it to a String and a Document:

public List<Document> get() {
	try (InputStream stream = this.resource.getInputStream()) {
		this.parser.parse(stream, this.handler, this.metadata, this.context);
		return List.of(toDocument(this.handler.toString()));
	}
	...
}

Tika still aborts a parse when the extracted text is disproportionate to the size of the input, which rejects highly compressed inputs such as archive bombs, but that guard is relative to the input and places no absolute ceiling on the total amount of text extracted. An application that uses TikaDocumentReader with its default configuration to process documents from an untrusted source, such as user-uploaded files or attacker-supplied URLs, can therefore be made to allocate an excessive amount of memory while parsing a sufficiently large document, exhausting the available JVM heap and causing a denial of service.

Mitigation

Only recent versions of Spring AI 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 AI.
  • Leverage a commercial support partner like HeroDevs for post-EOL security support.

Credits

Vulnerability Details
Severity
Level
CVSS Assessment
Low
>=0 <4
Medium
>=4 <6
High
>=6 <8
Critical
>=8 <10
High
ID
CVE-2026-59338
PROJECT Affected
Spring AI
Versions Affected
>=1.0.0 <=1.0.10, >=1.1.0 <=1.1.9, >=2.0.0 <=2.0.2
NES Versions Affected
Published date
November 20, 2026
≈ Fix date
Category
Denial of Service
Vex Document
Download VEXHow do I use it?
Sign up for the latest vulnerability alerts fixed in
NES for Spring
Rss feed icon
Subscribe via RSS
or

By submitting the form I acknowledge receipt of our Privacy Policy.

Thanks for signing up for our Newsletter! We look forward to connecting with you.
Oops! Something went wrong while submitting the form.