CVE-2019-12437: Silverstripe CSRF Protection Bypass via GraphQL
8.8
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.42614%
CWE
Published
5/24/2022
Updated
2/7/2024
KEV Status
No
Technology
PHP
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
silverstripe/graphql | composer | >= 2.0.0, < 2.0.5 | 2.0.5 |
silverstripe/graphql | composer | >= 3.1.0, < 3.1.2 | 3.1.2 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stemmed from inadequate mutation operation detection in CSRFMiddleware. The pre-patch version used a simple regex pattern match looking for 'mutation' at the beginning of the query. This could be bypassed by placing fragments or other syntax elements before the mutation. The patch replaced this with a three-stage check (string presence, start position regex, and full AST parsing), confirming the original function's regex-based approach was insufficient. The commit diff shows the vulnerable regex check was removed from process() and replaced with isMutation(), which handles edge cases properly.