CVE-2022-24863: Github.com/swaggo/http swagger Denial of Service Vulnerability
HIGHCVE-2022-24863 is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-755: Improper Handling of Exceptional Conditions) affecting Github.com/swaggo/http swagger libraries in the Go ecosystem. The issue involves denial of service in http-swagger. Remediation is available by upgrading affected packages to version 1.2.6.
CVE-2022-24863 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).
How to Fix CVE-2022-24863
To remediate this vulnerability, upgrade all affected Github.com/swaggo/http swagger dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/swaggo/http-swagger to 1.2.6
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/swaggo/http-swagger
How to Check if You Are Affected
To determine whether your application is affected by CVE-2022-24863, inspect your project dependencies for Github.com/swaggo/http swagger:
inspect dependencies for github.com/swaggo/http-swagger
Analyze the terminal output to locate any version of Github.com/swaggo/http swagger in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.2.6), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-755: Improper Handling of Exceptional Conditions, where the product does not handle or incorrectly handles an exceptional condition. In Github.com/swaggo/http swagger, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2022-24863 Affected Github.com/swaggo/http swagger Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/swaggo/http-swagger
|
Go |
< 1.2.6
|
1.2.6
|
References
Frequently Asked Questions
What is CVE-2022-24863?
Which Github.com/swaggo/http swagger versions are affected?
What version fixes CVE-2022-24863?
Is github.com/swaggo/http-swagger affected?
What is the CVSS score of CVE-2022-24863?
What CWE is associated with CVE-2022-24863?
How can I check Go dependencies for CVE-2022-24863?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-xg75-q3q5-cqmv",
"modified" : "2024-03-04T18:35:26Z",
"published" : "2022-04-22T20:55:52Z",
"aliases" : [ "CVE-2022-24863" ],
"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",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/swaggo/http-swagger"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.2.6"
} ]
} ]
} ],
"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"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-400", "CWE-755" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-04-22T20:55:52Z",
"nvd_published_at" : "2022-04-18T19:15:00Z"
}
}