Spring Data MongoDB - SpEL Expression Injection via Annotated Query Parameter Binding
Spring Data MongoDB contains a SpEL (Spring Expression Language) expression injection vulnerability. The issue occurs during parameter binding when a user-defined repository query method is annotated with @Query and utilizes a capture-all placeholder.
Affected versions:
Spring Data MongoDB 5.0.0 through 5.0.5; 4.5.0 through 4.5.11; 4.4.0 through 4.4.14; 4.3.0 through 4.3.16; 4.2.0 through 4.2.15; 4.1.0 through 4.1.14; 4.0.0 through 4.0.15; 3.4.0 through 3.4.19.
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:H/PR:N/UI:N/S:U/C:H/I:H/A:H
Version:3.1
Base score:8.1
Base severity: HIGH
Vector:
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
Metrics Other Info
Impacts
CAPEC ID
Description
N/A
An attacker who can supply unsanitized input to a @Query or @Aggregation repository method using a capture-all placeholder can inject arbitrary SpEL expressions and execute unintended logic.
CAPEC ID: N/A
Description: An attacker who can supply unsanitized input to a @Query or @Aggregation repository method using a capture-all placeholder can inject arbitrary SpEL expressions and execute unintended logic.