{"id":"GHSA-xg75-q3q5-cqmv","summary":"Denial of Service in http-swagger","details":"### 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)\n\n","aliases":["CVE-2022-24863","CVE-2024-25712","GHSA-49w7-5r33-jm9m","GO-2022-0427"],"modified":"2024-03-04T18:35:26Z","published":"2022-04-22T20:55:52Z","database_specific":{"github_reviewed":true,"github_reviewed_at":"2022-04-22T20:55:52Z","nvd_published_at":"2022-04-18T19:15:00Z","cwe_ids":["CWE-400","CWE-755"],"severity":"HIGH"},"references":[{"type":"WEB","url":"https://github.com/swaggo/http-swagger/security/advisories/GHSA-xg75-q3q5-cqmv"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-24863"},{"type":"WEB","url":"https://github.com/swaggo/http-swagger/pull/62"},{"type":"WEB","url":"https://github.com/swaggo/http-swagger/commit/b7d83e8fba85a7a51aa7e45e8244b4173f15049e"},{"type":"WEB","url":"https://cosmosofcyberspace.github.io/improper_http_method_leads_to_xss/poc.html"},{"type":"PACKAGE","url":"https://github.com/swaggo/http-swagger"},{"type":"WEB","url":"https://github.com/swaggo/http-swagger/releases/tag/v1.2.6"}],"affected":[{"package":{"name":"github.com/swaggo/http-swagger","ecosystem":"Go","purl":"pkg:golang/github.com/swaggo/http-swagger"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"1.2.6"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2022/04/GHSA-xg75-q3q5-cqmv/GHSA-xg75-q3q5-cqmv.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"}]}