Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS14Zzc1LXEzcTUtY3Ftds0_qA

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:

Permalink: https://github.com/advisories/GHSA-xg75-q3q5-cqmv
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS14Zzc1LXEzcTUtY3Ftds0_qA
Source: GitHub Advisory Database
Origin: Unspecified
Severity: High
Classification: General
Published: about 2 years ago
Updated: about 2 months ago


CVSS Score: 7.5
CVSS vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Identifiers: GHSA-xg75-q3q5-cqmv, CVE-2022-24863
References: Repository: https://github.com/swaggo/http-swagger
Blast Radius: 22.3

Affected Packages

go:github.com/swaggo/http-swagger
Dependent packages: 481
Dependent repositories: 932
Downloads:
Affected Version Ranges: < 1.2.6
Fixed in: 1.2.6
All affected versions: 1.0.0, 1.1.1, 1.1.2, 1.2.0, 1.2.1, 1.2.5
All unaffected versions: 1.2.6, 1.2.7, 1.2.8, 1.3.0, 1.3.1, 1.3.2, 1.3.3, 1.3.4