CVE-2026-41730
Executive Summary
CVE-2026-41730 is a medium-severity information disclosure vulnerability in Spring Data REST. The flaw causes the full exception cause chain to be serialized into HTTP error response bodies. This exposes persistence-layer internals, such as database schema details, SQL queries, and ORM mapping information, to HTTP clients. While the CVSS score is 5.3, the risk is elevated in environments where error responses are logged or cached, as it can lead to further reconnaissance attacks.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability affects the Spring Data REST library, which is distributed via Maven Central. Organizations using affected versions should verify their dependency trees and update to patched versions once available. No known supply chain attacks have been reported, but the exposure of internal details could aid attackers in crafting targeted exploits.
CVSS Breakdown & Threat Level
- CVSS Score: 5.3 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: None
- Scope: Unchanged
- Confidentiality Impact: Low
- Integrity Impact: None
- Availability Impact: None
The threat level is medium due to the low confidentiality impact, but the information disclosed can be highly valuable for attackers conducting reconnaissance.
Deep Dive & Mechanics
Spring Data REST automatically exposes JPA repositories as RESTful endpoints. When an exception occurs (e.g., validation error, database constraint violation), the framework serializes the entire exception chain into the HTTP response body. This includes nested exceptions, stack traces, and persistence-layer details.
Example of exposed information:
- Database table and column names
- SQL query fragments
- ORM entity class names
- Connection pool details
- Internal file paths
The vulnerability exists in the RepositoryRestExceptionHandler class, which catches exceptions and converts them to ResponseEntity objects without sanitizing the exception message chain.
Vulnerable vs. Patched Code
Vulnerable Code (Spring Data REST < 5.0.6):
@ExceptionHandler
public ResponseEntity<Object> handleException(Exception ex, WebRequest request) {
// Directly uses exception message chain
String message = ex.getMessage();
Throwable cause = ex.getCause();
while (cause != null) {
message += "\nCaused by: " + cause.getMessage();
cause = cause.getCause();
}
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(message);
}
Patched Code (Spring Data REST >= 5.0.6):
@ExceptionHandler
public ResponseEntity<Object> handleException(Exception ex, WebRequest request) {
// Sanitizes exception message to avoid exposing internals
String message = "An internal error occurred. Please contact support.";
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(message);
}
The patched version replaces the full exception chain with a generic error message, preventing information leakage.
Exploitation & Lab Setup
Red Team
Prerequisites:
- A vulnerable Spring Data REST application (e.g., Spring Boot with
spring-boot-starter-data-restand JPA) - Access to an endpoint that triggers an exception (e.g., invalid input, malformed request)
Exploitation Steps:
- Identify a Spring Data REST endpoint (e.g.,
/api/entities). - Send a request that causes a persistence-layer exception (e.g., invalid JSON, constraint violation).
- Observe the HTTP response body for detailed error information.
Example Request:
curl -X POST http://target:8080/api/users \
-H "Content-Type: application/json" \
-d '{"username": "test", "email": "invalid-email"}'
Expected Response (Vulnerable):
{
"error": "Validation failed for property 'email': invalid email format",
"cause": "javax.validation.ConstraintViolationException: email must be a valid email address",
"stackTrace": "at com.example.UserController.saveUser(UserController.java:25)..."
}
Blue Team
Detection:
- Monitor HTTP responses for stack traces or database details in error bodies.
- Look for requests that trigger 500 errors with verbose error messages.
Mitigation:
- Apply the patch once available.
- Configure a global error handler to sanitize responses.
- Use a Web Application Firewall (WAF) to block responses containing stack traces.
Indicators of Compromise (IOCs)
- HTTP 500 responses containing:
Caused by:javax.persistence.org.hibernate.SQLExceptionConstraintViolationException
- Unusual error messages revealing database schema or file paths.
Detection Engineering
YARA Rule
rule CVE_2026_41730_Spring_Data_REST_Info_Leak {
meta:
description = "Detects HTTP responses containing Spring Data REST exception chain leakage"
author = "Valters IT"
date = "2026-01-01"
reference = "CVE-2026-41730"
strings:
$s1 = "Caused by:" ascii wide
$s2 = "javax.persistence." ascii wide
$s3 = "org.hibernate." ascii wide
$s4 = "ConstraintViolationException" ascii wide
condition:
any of ($s*) and filesize < 10KB
}
Sigma Rule
title: Spring Data REST Exception Chain Leakage
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects HTTP 500 responses with verbose error details from Spring Data REST
author: Valters IT
date: 2026-01-01
logsource:
category: webserver
product: generic
detection:
selection:
status: 500
response_body|contains:
- 'Caused by:'
- 'javax.persistence.'
- 'org.hibernate.'
condition: selection
falsepositives:
- Legitimate debugging endpoints
level: medium
Suricata Rule
alert http any any -> any any (msg:"CVE-2026-41730 Spring Data REST Exception Chain Leakage"; flow:to_client; content:"HTTP/1.1 500"; http_response_line; content:"Caused by:"; http_response_body; content:"javax.persistence."; http_response_body; sid:1000001; rev:1;)
Remediation & Mitigation
- Patch: Update Spring Data REST to version 5.0.6 or later once available.
- Workaround: Implement a custom
@ControllerAdviceto sanitize error responses. - Configuration: Set
server.error.include-stacktrace=neverinapplication.properties. - Monitoring: Enable logging of all 500 errors and review for sensitive data exposure.
- WAF: Deploy rules to block responses containing stack traces or database details.
Valters IT
Securing Digital Frontiers