{"id":"CVE-2022-24863","aliases":["CVE-2022-24863","GHSA-49w7-5r33-jm9m","GHSA-xg75-q3q5-cqmv","GO-2022-0427"],"related":["CVE-2024-25712"],"kind":"vulnerability","state":"published","title":"Denial of service in http-swagger","summary":"http-swagger is an open source wrapper to automatically generate RESTful API documentation with Swagger 2.0. In versions of http-swagger prior to 1.2.6 an attacker may perform a denial of service attack consisting of memory exhaustion on the host system. The cause of the memory exhaustion is down to improper handling of http methods. Users are advised to upgrade. Users unable to upgrade may to restrict the path prefix to the \"GET\" method as a workaround.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"http-swagger is an open source wrapper to automatically generate RESTful API documentation with Swagger 2.0. In versions of http-swagger prior to 1.2.6 an attacker may perform a denial of service attack consisting of memory exhaustion on the host system. The cause of the memory exhaustion is down to improper handling of http methods. Users are advised to upgrade. Users unable to upgrade may to restrict the path prefix to the \"GET\" method as a workaround.","source":"cvelist"},{"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.","format":"markdown","source":"ghsa"},{"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 es un wrapper de código abierto para generar automáticamente la documentación de la API RESTful con Swagger versión  2.0. En versiones de http-swagger anteriores a 1.2.6 un atacante puede llevar a cabo un ataque de denegación de servicio consistente en el agotamiento de la memoria del sistema anfitrión. La causa del agotamiento de la memoria es debido al manejo inapropiado de los métodos http. Es recomendado a usuarios actualizar. Los usuarios que no puedan actualizar pueden restringir el prefijo de la ruta al método \"GET\" como medida de mitigación","source":"nvd"}],"published":"2022-04-18T19:00:22.000Z","modified":"2026-06-17T04:32:41.120Z","severity":{"scorer":"GitHub_M","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"},"severities":[{"scorer":"GitHub_M","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":"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:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:L/Au:N/C:N/I:N/A:C","score":7.8,"rating":"HIGH"}],"cwes":["CWE-79","CWE-400","CWE-755"],"affected":[{"ranges":[{"version":"< 1.2.6","status":"affected"}],"vendor":"swaggo","product":"http-swagger","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://github.com/swaggo/http-swagger/security/advisories/GHSA-xg75-q3q5-cqmv","tags":["third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/swaggo/http-swagger/pull/62","tags":["fix","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/swaggo/http-swagger/commit/b7d83e8fba85a7a51aa7e45e8244b4173f15049e","tags":["patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/swaggo/http-swagger/releases/tag/v1.2.6","tags":["release-notes","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-25712","tags":["advisory"],"sources":["ghsa"]},{"url":"https://cosmosofcyberspace.github.io/improper_http_method_leads_to_xss/poc.html","tags":["web"],"sources":["ghsa","go"]},{"url":"https://github.com/swaggo/http-swagger","tags":["package"],"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":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2025-04-23T15:55:32.422Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-24863","url":"https://www.cve.org/CVERecord?id=CVE-2022-24863","licence":"CVE Terms of Use","modified":"2025-04-23T18:34:13.994Z"},{"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-2022-24863","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-24863","licence":"Public domain","modified":"2026-06-17T04:32:41.120Z"}],"updatedAt":"2026-11-25T22:58:10.821Z","epss":{"score":0.0244,"percentile":0.84751,"date":"2026-12-01T12:00:22.000Z"}}