HIGH

CVE-2026-59345

Denial of Service via regex-recursion

Description

ExtractedTextFormatter is vulnerable to a denial of service when processing untrusted text extracted from documents.

trimAdjacentBlankLines() and alignToLeft() collapse runs of blank lines using regular expressions with a quantified group, and Java's backtracking regex engine recurses one stack frame per repetition of that group. A specially crafted document can exploit this to exhaust the calling thread's stack, resulting in an uncaught StackOverflowError. This crashes the thread processing the document; repeated submissions against a bounded worker pool can degrade or deny service to all users, even though any single crash is thread-local rather than JVM-wide. Any application that processes documents from untrusted sources (document upload, email attachment processing, RAG ingestion, web crawling) through TikaDocumentReader, PagePdfDocumentReader, or ParagraphPdfDocumentReader is impacted, regardless of file type.

Affected Maven artifacts (1)

ArtifactAffected versionsFixed in
org.springframework.ai » spring-ai-commons
>= 1.0.0, <= 1.0.10>= 1.1.0, <= 1.1.9>= 2.0.0, < 2.0.3
2.0.3

Blast radius

1affected artifacts
22affected versions
1,503dependent artifacts (est.)
17,194dependent versions

83% of the dependent artifacts (1,250) still pull an affected version in their latest release.

DepthDependent versions
Direct
586
2 hops
2,890
3 hops
6,926
4 hops
5,154
5 hops
1,172
6 hops
466

Most used dependents

Computed from the dependency graph of build 20261125.2201 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.