CVE-2025-66908: n/a
Turms AI-Serving module v0.10.0-SNAPSHOT and earlier contains an improper file type validation vulnerability in the OCR image upload functionality. The OcrController in turms-ai-serving/src/main/java/im/turms/ai/domain/ocr/controller/OcrController.java uses the @FormData(contentType = MediaTypeConst.IMAGE) annotation to restrict uploads to image files, but this constraint is not properly enforced. The system relies solely on client-provided Content-Type headers and file extensions without validating actual file content using magic bytes (file signatures). An attacker can upload arbitrary file types including executables, scripts, HTML, or web shells by setting the Content-Type header to "image/*" or using an image file extension. This bypass enables potential server-side code execution, stored XSS, or information disclosure depending on how uploaded files are processed and served.
AI Analysis
Technical Summary
The vulnerability identified as CVE-2025-66908 affects the Turms AI-Serving module version 0.10.0-SNAPSHOT and earlier. It arises from improper validation of uploaded files in the OCR image upload functionality. Specifically, the OcrController uses the @FormData annotation to restrict uploads to image files by checking the Content-Type header and file extensions. However, this validation is insufficient because it relies solely on client-provided metadata without verifying the actual file content via magic bytes or file signatures. Consequently, an attacker can craft requests with a Content-Type header set to "image/*" or use image file extensions while uploading malicious files such as executables, scripts, HTML files, or web shells. If these files are processed or served by the server without proper sanitization, it can lead to severe security consequences including server-side code execution, stored cross-site scripting (XSS), or information disclosure. The vulnerability does not require authentication or user interaction, increasing its risk profile. Although no known exploits have been reported in the wild, the flaw presents a significant attack vector due to the common use of OCR modules in AI-driven applications. The lack of a CVSS score necessitates an assessment based on impact and exploitability factors. The vulnerability's root cause is the absence of robust server-side file content validation, a critical oversight in secure file upload implementations.
Potential Impact
For European organizations, the impact of CVE-2025-66908 can be substantial. Organizations using the Turms AI-Serving module for OCR tasks may face risks of unauthorized code execution on their servers if attackers upload malicious files disguised as images. This can lead to full system compromise, data breaches, or persistent cross-site scripting attacks affecting users and internal systems. The vulnerability threatens confidentiality, integrity, and availability of affected systems. Sectors such as finance, healthcare, government, and technology firms that rely on AI and OCR for document processing are particularly vulnerable. Exploitation could result in exposure of sensitive personal or corporate data, disruption of critical services, and reputational damage. Given the ease of exploitation without authentication, attackers could automate attacks at scale. The lack of current known exploits provides a window for proactive mitigation, but the potential impact warrants urgent attention to prevent future incidents.
Mitigation Recommendations
To mitigate CVE-2025-66908, organizations should implement strict server-side validation of uploaded files beyond relying on Content-Type headers and file extensions. This includes verifying file signatures (magic bytes) to confirm the file type matches expected image formats. Employing libraries or tools that perform deep content inspection can prevent malicious files from being accepted. Additionally, restrict upload permissions and isolate upload directories to minimize the impact of any malicious files. Sanitize and validate any user-generated content before processing or serving it to prevent XSS attacks. Implement application-layer firewalls or intrusion detection systems to monitor and block suspicious upload attempts. Regularly update the Turms AI-Serving module to versions where this vulnerability is patched once available. Conduct security code reviews and penetration testing focused on file upload functionalities. Finally, educate developers and administrators about secure file handling best practices to prevent similar issues.
Affected Countries
Germany, France, United Kingdom, Netherlands, Sweden, Finland
CVE-2025-66908: n/a
Description
Turms AI-Serving module v0.10.0-SNAPSHOT and earlier contains an improper file type validation vulnerability in the OCR image upload functionality. The OcrController in turms-ai-serving/src/main/java/im/turms/ai/domain/ocr/controller/OcrController.java uses the @FormData(contentType = MediaTypeConst.IMAGE) annotation to restrict uploads to image files, but this constraint is not properly enforced. The system relies solely on client-provided Content-Type headers and file extensions without validating actual file content using magic bytes (file signatures). An attacker can upload arbitrary file types including executables, scripts, HTML, or web shells by setting the Content-Type header to "image/*" or using an image file extension. This bypass enables potential server-side code execution, stored XSS, or information disclosure depending on how uploaded files are processed and served.
AI-Powered Analysis
Technical Analysis
The vulnerability identified as CVE-2025-66908 affects the Turms AI-Serving module version 0.10.0-SNAPSHOT and earlier. It arises from improper validation of uploaded files in the OCR image upload functionality. Specifically, the OcrController uses the @FormData annotation to restrict uploads to image files by checking the Content-Type header and file extensions. However, this validation is insufficient because it relies solely on client-provided metadata without verifying the actual file content via magic bytes or file signatures. Consequently, an attacker can craft requests with a Content-Type header set to "image/*" or use image file extensions while uploading malicious files such as executables, scripts, HTML files, or web shells. If these files are processed or served by the server without proper sanitization, it can lead to severe security consequences including server-side code execution, stored cross-site scripting (XSS), or information disclosure. The vulnerability does not require authentication or user interaction, increasing its risk profile. Although no known exploits have been reported in the wild, the flaw presents a significant attack vector due to the common use of OCR modules in AI-driven applications. The lack of a CVSS score necessitates an assessment based on impact and exploitability factors. The vulnerability's root cause is the absence of robust server-side file content validation, a critical oversight in secure file upload implementations.
Potential Impact
For European organizations, the impact of CVE-2025-66908 can be substantial. Organizations using the Turms AI-Serving module for OCR tasks may face risks of unauthorized code execution on their servers if attackers upload malicious files disguised as images. This can lead to full system compromise, data breaches, or persistent cross-site scripting attacks affecting users and internal systems. The vulnerability threatens confidentiality, integrity, and availability of affected systems. Sectors such as finance, healthcare, government, and technology firms that rely on AI and OCR for document processing are particularly vulnerable. Exploitation could result in exposure of sensitive personal or corporate data, disruption of critical services, and reputational damage. Given the ease of exploitation without authentication, attackers could automate attacks at scale. The lack of current known exploits provides a window for proactive mitigation, but the potential impact warrants urgent attention to prevent future incidents.
Mitigation Recommendations
To mitigate CVE-2025-66908, organizations should implement strict server-side validation of uploaded files beyond relying on Content-Type headers and file extensions. This includes verifying file signatures (magic bytes) to confirm the file type matches expected image formats. Employing libraries or tools that perform deep content inspection can prevent malicious files from being accepted. Additionally, restrict upload permissions and isolate upload directories to minimize the impact of any malicious files. Sanitize and validate any user-generated content before processing or serving it to prevent XSS attacks. Implement application-layer firewalls or intrusion detection systems to monitor and block suspicious upload attempts. Regularly update the Turms AI-Serving module to versions where this vulnerability is patched once available. Conduct security code reviews and penetration testing focused on file upload functionalities. Finally, educate developers and administrators about secure file handling best practices to prevent similar issues.
Affected Countries
For access to advanced analysis and higher rate limits, contact root@offseq.com
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- mitre
- Date Reserved
- 2025-12-08T00:00:00.000Z
- Cvss Version
- null
- State
- PUBLISHED
Threat ID: 69456762a90e3c9a1540c4bb
Added to database: 12/19/2025, 2:55:30 PM
Last enriched: 12/19/2025, 3:09:41 PM
Last updated: 12/19/2025, 5:02:46 PM
Views: 6
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Related Threats
CVE-2025-68477: CWE-918: Server-Side Request Forgery (SSRF) in langflow-ai langflow
HighCVE-2025-68457: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in boscop-fr orejime
LowCVE-2025-14809: CWE-1021 Improper Restriction of Rendered UI Layers or Frames in The Browser Company of New York ArcSearch
HighCVE-2025-66580: CWE-94: Improper Control of Generation of Code ('Code Injection') in OpenAgentPlatform Dive
CriticalCVE-2025-65035: CWE-502: Deserialization of Untrusted Data in pluginsGLPI databaseinventory
MediumActions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need enhanced features?
Contact root@offseq.com for Pro access with improved analysis and higher rate limits.