-
CVSS Score
-| 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 |
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.