Gin mishandles a wildcard at the end of an origin string
Published 29 Jun 2024 · Updated 3 Nov 2025
Is your project on an affected github.com/gin-gonic/gin?
Look after several Go apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Affected packages
- Affected
- <1.6.0
- Fixed in
- 1.6.0
go get github.com/gin-gonic/gin@v1.6.0- Affected
- <1.6.0
- Fixed in
- 1.6.0
go get github.com/gin-contrib/cors@v1.6.0Details
parseWildcardRules in Gin-Gonic CORS middleware before 1.6.0 mishandles a wildcard at the end of an origin string, e.g., https://example.community/* is allowed when the intention is that only https://example.com/* should be allowed, and http://localhost.example.com/* is allowed when the intention is that only http://localhost/* should be allowed.
Is GHSA-869c-j7wc-8jqv in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected github.com/gin-gonic/gin, and gives you the command that fixes it.
More advisories for github.com/gin-gonic/gin
- MediumCVE-2023-29401Gin Web Framework does not properly sanitize filename parameter of Context.FileAttachment function · 12 May 2023
- LowCVE-2023-29401Improper handling of filenames in Content-Disposition HTTP header in github.com/gin-gonic/gin · 11 May 2023
- MediumCVE-2023-26125Improper input validation in github.com/gin-gonic/gin · 4 May 2023
- HighCVE-2020-36567Gin's default logger allows unsanitized input that can allow remote attackers to inject arbitrary log lines · 27 Dec 2022
- HighCVE-2020-28483Inconsistent Interpretation of HTTP Requests in github.com/gin-gonic/gin · 23 Jun 2021
- LowCVE-2020-36567Arbitrary log line injection in github.com/gin-gonic/gin · 14 Apr 2021
References
- Advisorynvd.nist.gov/vuln/detail/CVE-2019-25211
- Linkgithub.com/gin-contrib/cors/pull/106
- Linkgithub.com/gin-contrib/cors/pull/57
- Linkgithub.com/gin-contrib/cors/commit/27b723a473efd80d5a498fa9f5933c80204c850d
- Linkgithub.com/gin-contrib/cors/compare/v1.5.0...v1.6.0
- Linkgithub.com/gin-contrib/cors/releases/tag/v1.6.0
- Packagegithub.com/gin-gonic/gin
- Linklists.debian.org/debian-lts-announce/2025/08/msg00024.html
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.