{"id":"CVE-2024-25712","aliases":["CVE-2024-25712","GHSA-49w7-5r33-jm9m","GHSA-xg75-q3q5-cqmv","GO-2022-0427"],"related":["CVE-2022-24863"],"kind":"vulnerability","state":"published","title":"http-swagger XSS via PUT requests","summary":"http-swagger before 1.2.6 allows XSS via PUT requests, because a file that has been uploaded (via httpSwagger.WrapHandler and *webdav.memFile) can subsequently be accessed via a GET request. NOTE: this is independently fixable with respect to CVE-2022-24863, because (if a solution continued to allow PUT requests) large files could have been blocked without blocking JavaScript, or JavaScript could have been blocked without blocking large files.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"http-swagger before 1.2.6 allows XSS via PUT requests, because a file that has been uploaded (via httpSwagger.WrapHandler and *webdav.memFile) can subsequently be accessed via a GET request. NOTE: this is independently fixable with respect to CVE-2022-24863, because (if a solution continued to allow PUT requests) large files could have been blocked without blocking JavaScript, or JavaScript could have been blocked without blocking large files.","source":"cvelist"},{"lang":"en","text":"### Impact\nAllows an attacker to perform a DOS attack consisting of memory exhaustion on the host system.\n\n### Patches\nYes. Please upgrade to v1.2.6.\n\n### Workarounds\nA workaround is to restrict the path prefix to the \"GET\" method. As shown below\n```\nfunc main() {\n\tr := mux.NewRouter()\n\n\tr.PathPrefix(\"/swagger/\").Handler(httpSwagger.Handler(\n\t\thttpSwagger.URL(\"http://localhost:1323/swagger/doc.json\"), //The url pointing to API definition\n\t\thttpSwagger.DeepLinking(true),\n\t\thttpSwagger.DocExpansion(\"none\"),\n\t\thttpSwagger.DomID(\"#swagger-ui\"),\n\t)).Methods(http.MethodGet)\n```\n\n### References\nReporter dongguangli from https://www.huoxian.cn/ company\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [http-swagger](https://github.com/swaggo/http-swagger/issues)","format":"markdown","source":"ghsa"},{"lang":"en","text":"The httpSwagger package's HTTP handler provides WebDAV read/write access to an in-memory filesystem. An attacker can exploit this to cause memory exhaustion by uploading many files, XSS attacks by uploading malicious files, or other unexpected behaviors.","format":"markdown","source":"go"},{"lang":"es","text":"http-swagger anterior a 1.2.6 permite XSS a través de solicitudes PUT, porque posteriormente se puede acceder a un archivo que se ha subido (a través de httpSwagger.WrapHandler y *webdav.memFile) a través de una solicitud GET. NOTA: esto se puede solucionar de forma independiente con respecto a CVE-2022-24863, porque (si una solución continuara permitiendo solicitudes PUT) los archivos grandes podrían haberse bloqueado sin bloquear JavaScript, o JavaScript podría haberse bloqueado sin bloquear archivos grandes.","source":"nvd"}],"published":"2022-04-22T20:55:52.000Z","modified":"2026-06-17T07:16:27.340Z","severity":{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},"severities":[{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"}],"cwes":["CWE-79","CWE-400","CWE-755"],"affected":[{"ranges":[{"version":"n/a","status":"affected"}],"source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.2.6"}],"ecosystem":"Go","package":"github.com/swaggo/http-swagger","purl":"pkg:golang/github.com/swaggo/http-swagger","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.2.6"}],"ecosystem":"Go","package":"github.com/swaggo/http-swagger","purl":"pkg:golang/github.com/swaggo/http-swagger","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.2.6"}],"ecosystem":"Go","package":"github.com/swaggo/http-swagger","purl":"pkg:golang/github.com/swaggo/http-swagger","source":"go"},{"ranges":[{"status":"affected","fixed":"1.2.6"}],"vendor":"http-swagger_project","product":"http-swagger","cpe":"cpe:2.3:a:http-swagger_project:http-swagger:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://cosmosofcyberspace.github.io/improper_http_method_leads_to_xss/poc.html","tags":["exploit","third-party-advisory","web","x-transferred"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/swaggo/http-swagger/releases/tag/v1.2.6","tags":["release-notes","web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-25712","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/swaggo/http-swagger/pull/62","tags":["fix","web"],"sources":["ghsa","go"]},{"url":"https://github.com/swaggo/http-swagger/commit/b7d83e8fba85a7a51aa7e45e8244b4173f15049e","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/swaggo/http-swagger","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/swaggo/http-swagger/security/advisories/GHSA-xg75-q3q5-cqmv","tags":["web"],"sources":["ghsa"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-24863","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/swaggo/http-swagger/issues/61","tags":["report"],"sources":["go"]}],"credits":[],"assigner":"mitre","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2024-02-29T20:18:05.878Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-25712","url":"https://www.cve.org/CVERecord?id=CVE-2024-25712","licence":"CVE Terms of Use","modified":"2025-06-16T18:20:18.592Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-49w7-5r33-jm9m","url":"https://github.com/advisories/GHSA-49w7-5r33-jm9m","licence":"CC-BY-4.0","modified":"2025-01-16T19:57:08.000Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-xg75-q3q5-cqmv","url":"https://github.com/advisories/GHSA-xg75-q3q5-cqmv","licence":"CC-BY-4.0","modified":"2024-03-04T18:35:26.000Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2022-0427","url":"https://pkg.go.dev/vuln/GO-2022-0427","licence":"CC-BY-4.0","modified":"2024-05-20T16:03:47.000Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-25712","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-25712","licence":"Public domain","modified":"2026-06-17T07:16:27.340Z"}],"updatedAt":"2026-11-25T22:58:37.169Z","epss":{"score":0.00561,"percentile":0.48015,"date":"2026-12-01T12:00:22.000Z"}}