LowGO-2024-2955CVE-2019-25211GHSA-869c-j7wc-8jqv

Gin mishandles a wildcard in the origin string in github.com/gin-contrib/cors

Published 2 Jul 2024 · Updated 2 Jul 2024

Is your project on an affected github.com/gin-contrib/cors?

Private repo? Upload its lockfile instead, or connect GitHub to check every repo.

Look after several Go apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie

Affected package

Affected
<1.6.0
Fixed in
1.6.0
Update to the fixed version for your release line, for example:go get github.com/gin-contrib/cors@v1.6.0

Details

Gin-Gonic CORS middleware mishandles a wildcard at the end of an origin string. Examples: https://example.community/* is accepted by the origin string https://example.com/* and http://localhost.example.com/* is accepted by the origin string http://localhost/* .

Is GO-2024-2955 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-contrib/cors, and gives you the command that fixes it.

References

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.