ADVISORIES

GitHub Advisory Database

GHSA-869c-j7wc-8jqv

Gin mishandles a wildcard at the end of an origin string

Details

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.

Affected packages

EcosystemPackageAffected versions
Gogithub.com/gin-gonic/gin
All versions before 1.6.0 (fixed in 1.6.0)
Gogithub.com/gin-contrib/cors
All versions before 1.6.0 (fixed in 1.6.0)

References