CVE-2022-24124: SQL Injection in Casdoor
7.5
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.98301%
CWE
Published
2/1/2022
Updated
2/3/2023
KEV Status
No
Technology
Go
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
github.com/casdoor/casdoor | go | < 1.13.1 | 1.13.1 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The pre-patch version of GetSession
in object/adapter.go
used unsanitized user input (field parameter) to construct SQL queries via fmt.Sprintf("%s like ?", util.SnakeString(field))
. This allowed SQL injection through special characters in the 'field' parameter. The patch added a filterField()
check with a regex (^[A-Za-z0-9]+$) to validate()
the field parameter, confirming the original vulnerability. Multiple API endpoints (like get-organizations
) relied on this function, making it the root cause.