Spring Data REST SpEL Injection via Map Key in JSON Patch
Spring Data REST is vulnerable to SpEL expression injection through map-typed properties when processing JSON Patch (application/json-patch+json) requests. When a persistent entity exposes a Map-typed property, the JSON Pointer path segment used as the map key is embedded directly into a SpEL expression without sanitization or validation.
Affected versions:
Spring Data REST 3.7.0 through 3.7.19; 4.3.0 through 4.3.16; 4.4.0 through 4.4.14; 4.5.0 through 4.5.11; 5.0.0 through 5.0.5.
Description: CWE-917: Improper Neutralization of Special Elements used in an Expression Language Statement (Expression Language Injection)
Metrics
Version
Base score
Base severity
Vector
3.1
8.1
HIGH
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N
Version:3.1
Base score:8.1
Base severity: HIGH
Vector:
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N
Metrics Other Info
Impacts
CAPEC ID
Description
N/A
An attacker who can issue PATCH requests against a Spring Data REST endpoint with a Map-typed persistent property can inject arbitrary SpEL expressions via the map-key path segment.
CAPEC ID: N/A
Description: An attacker who can issue PATCH requests against a Spring Data REST endpoint with a Map-typed persistent property can inject arbitrary SpEL expressions via the map-key path segment.