Go Vulnerability Database
GO-2022-0619
Authorization bypass in github.com/emicklei/go-restful, go-restful/v2 and go-restful/v3
Details
CORS filters that use an AllowedDomains configuration parameter can match domains outside the specified set, permitting an attacker to avoid the CORS policy.
The AllowedDomains configuration parameter is documented as a list of allowed origin domains, but values in this list are applied as regular expression matches. For example, an allowed domain of "example.com" will match the Origin header "example.com.malicious.domain".
Affected packages
| Ecosystem | Package | Affected versions |
|---|---|---|
| Go | github.com/emicklei/go-restful | All versions before 2.16.0+incompatible (fixed in 2.16.0+incompatible) |
| Go | github.com/emicklei/go-restful/v2 | From 2.7.1, no fix listed |
| Go | github.com/emicklei/go-restful/v3 | From 3.0.0 before 3.8.0 (fixed in 3.8.0) |