Security Vulnerability Report
中文
CVE-2026-40980 CVSS 6.5 MEDIUM

CVE-2026-40980

Published: 2026-04-28 09:16:17
Last Modified: 2026-04-29 18:15:45

Description

In Spring AI, a malicious PDF file can be crafted that triggers the allocation of unreasonable amounts of memory when handled by `ForkPDFLayoutTextStripper`. Affected versions: Spring AI: 1.0.0 - 1.0.5 (fixed in 1.0.6), 1.1.0 - 1.1.4 (fixed in 1.1.5)

CVSS Details

CVSS Score
6.5
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

Configurations (Affected Products)

cpe:2.3:a:vmware:spring_ai:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:vmware:spring_ai:*:*:*:*:*:*:*:* - VULNERABLE
Spring AI 1.0.0 - 1.0.5
Spring AI 1.1.0 - 1.1.4

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
// Conceptual PoC to demonstrate the vulnerability trigger // This requires a maliciously crafted PDF file (malicious.pdf) import org.springframework.ai.reader.pdf.PagePdfDocumentReader; import org.springframework.ai.reader.pdf.config.PdfDocumentReaderConfig; public class PocExploit { public static void main(String[] args) { // Configure the reader to use the vulnerable ForkPDFLayoutTextStripper PdfDocumentReaderConfig config = PdfDocumentReaderConfig.builder() .withPageTopMargin(0) .withPageExtractedTextFormatter((...) -> ...) // Implicitly uses vulnerable stripper .build(); // Load the crafted malicious PDF // The PDF contains structures causing infinite loops or massive allocation in ForkPDFLayoutTextStripper PagePdfDocumentReader reader = new PagePdfDocumentReader("malicious.pdf", config); try { // Trigger the parsing and memory exhaustion reader.get(); } catch (OutOfMemoryError e) { System.out.println("Vulnerability Triggered: OutOfMemoryError occurred."); } } }

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-40980", "sourceIdentifier": "[email protected]", "published": "2026-04-28T09:16:16.890", "lastModified": "2026-04-29T18:15:44.910", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "In Spring AI, a malicious PDF file can be crafted that triggers the allocation of unreasonable amounts of memory when handled by `ForkPDFLayoutTextStripper`.\n\nAffected versions:\nSpring AI: 1.0.0 - 1.0.5 (fixed in 1.0.6), 1.1.0 - 1.1.4 (fixed in 1.1.5)"}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H", "baseScore": 6.5, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 2.8, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-400"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:vmware:spring_ai:*:*:*:*:*:*:*:*", "versionStartIncluding": "1.0.0", "versionEndExcluding": "1.0.6", "matchCriteriaId": "1CD6DC44-CDE8-47E4-A788-6D8AE716396F"}, {"vulnerable": true, "criteria": "cpe:2.3:a:vmware:spring_ai:*:*:*:*:*:*:*:*", "versionStartIncluding": "1.1.0", "versionEndExcluding": "1.1.5", "matchCriteriaId": "5013645B-3914-4A40-8D42-CB47344963A7"}]}]}], "references": [{"url": "https://spring.io/security/cve-2026-40980", "source": "[email protected]", "tags": ["Vendor Advisory"]}]}}