CVE-2022-24863
Denial of service in http-swagger
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.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- None
- Integrity
- None
- Availability
- High
Exploit likelihood
What each source reports
CVE List Score used
7.5
Denial of service in http-swagger
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.
- Record
CVE-2022-24863- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-400
- Updated
- 2026-11-02
EUVDEUVD-2022-1868
7.5
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.
- Record
EUVD-2022-1868- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-xg75-q3q5-cqmv
7.5
Denial of Service in http-swagger
Impact
Allows an attacker to perform a DOS attack consisting of memory exhaustion on the host system.
Patches
Yes. Please upgrade to v1.2.6.
Workarounds
A workaround is to restrict the path prefix to the "GET" method. As shown below
func main() {
r := mux.NewRouter()
r.PathPrefix("/swagger/").Handler(httpSwagger.Handler(
httpSwagger.URL("http://localhost:1323/swagger/doc.json"), //The url pointing to API definition
httpSwagger.DeepLinking(true),
httpSwagger.DocExpansion("none"),
httpSwagger.DomID("#swagger-ui"),
)).Methods(http.MethodGet)
References
Reporter dongguangli from https://www.huoxian.cn/ company
For more information
If you have any questions or comments about this advisory:
- Open an issue in http-swagger
- Record
GHSA-xg75-q3q5-cqmv- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-400, CWE-755
- Updated
- 2026-11-02
NVD
7.5
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.
- Record
CVE-2022-24863- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - CVSS 2.0
- 7.8 High
AV:N/AC:L/Au:N/C:N/I:N/A:C - Weakness
- CWE-400, CWE-755
- Updated
- 2026-11-02
OSV
7.5
Denial of service in http-swagger
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.
- Record
CVE-2022-24863- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-400
- Updated
- 2026-11-02
OSVCVE-2024-25712
6.1
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.
- Record
CVE-2024-25712- CVSS 3.1
- 6.1 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N - Updated
- 2026-11-02
OSVGHSA-49w7-5r33-jm9m
6.1
http-swagger XSS via PUT requests
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.
- Record
GHSA-49w7-5r33-jm9m- CVSS 3.1
- 6.1 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N - Weakness
- CWE-79
- Updated
- 2026-11-02
OSVGHSA-xg75-q3q5-cqmv
7.5
Denial of Service in http-swagger
Impact
Allows an attacker to perform a DOS attack consisting of memory exhaustion on the host system.
Patches
Yes. Please upgrade to v1.2.6.
Workarounds
A workaround is to restrict the path prefix to the "GET" method. As shown below
func main() {
r := mux.NewRouter()
r.PathPrefix("/swagger/").Handler(httpSwagger.Handler(
httpSwagger.URL("http://localhost:1323/swagger/doc.json"), //The url pointing to API definition
httpSwagger.DeepLinking(true),
httpSwagger.DocExpansion("none"),
httpSwagger.DomID("#swagger-ui"),
)).Methods(http.MethodGet)
References
Reporter dongguangli from https://www.huoxian.cn/ company
For more information
If you have any questions or comments about this advisory:
- Open an issue in http-swagger
- Record
GHSA-xg75-q3q5-cqmv- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-400, CWE-755
- Updated
- 2026-11-02
OSVGO-2022-0427 No score
Unprotected file upload in github.com/swaggo/http-swagger
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.
- Record
GO-2022-0427- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
github.com/swaggo/http-swaggerGo |
before 1.2.6 | 1.2.6 |
github.com/swaggo/http-swaggerGo From an advisory covering 2 CVEs |
before 1.2.6 | 1.2.6 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, facts | ||
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2022-24863 is a high vulnerability (CVSS 7.5) in Http-swagger Project Http-swagger, published April 18, 2022. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 2.44%, the 84th percentile. Fixed in github.com/swaggo/http-swagger 1.2.6.
References
github.com/swaggo/http-swagger/security/advisories/GHSA-xg75-q3q5-cqmv
github.com/swaggo/http-swagger/pull/62
github.com/swaggo/http-swagger/commit/b7d83e8fba85a7a51aa7e45e8244b4173f15049e
github.com/swaggo/http-swagger/releases/tag/v1.2.6
nvd.nist.gov/vuln/detail/CVE-2022-24863
cosmosofcyberspace.github.io/improper_http_method_leads_to_xss/poc.html
Show 6 moreShow less
github.com/advisories/GHSA-xg75-q3q5-cqmv
github.com/CVEProject/cvelistV5/tree/main/cves/2022/24xxx/CVE-2022-24863.json
github.com/CVEProject/cvelistV5/tree/main/cves/2024/25xxx/CVE-2024-25712.json
nvd.nist.gov/vuln/detail/CVE-2024-25712
github.com/swaggo/http-swagger
github.com/swaggo/http-swagger/issues/61