GO-2024-2604

Source
https://pkg.go.dev/vuln/GO-2024-2604
Import Source
https://vuln.go.dev/ID/GO-2024-2604.json
JSON Data
https://api.test.osv.dev/v1/vulns/GO-2024-2604
Aliases
Published
2024-03-11T18:58:48Z
Modified
2024-05-20T16:03:47Z
Summary
CORS Filter bypass in github.com/zeromicro/go-zero
Details

The CORS Filter feature in go-zero allows users to specify an array of domains allowed in the CORS policy. However, the isOriginAllowed function uses strings.HasSuffix to check the origin, which can lead to a bypass via a domain like "evil-victim.com". This vulnerability is capable of breaking CORS policy and thus allowing any page to make requests and retrieve data on behalf of other users.

Database specific
{
    "review_status": "REVIEWED",
    "url": "https://pkg.go.dev/vuln/GO-2024-2604"
}
References
Credits
    • cokeBeer

Affected packages

Go / github.com/zeromicro/go-zero

Package

Name
github.com/zeromicro/go-zero
View open source insights on deps.dev
Purl
pkg:golang/github.com/zeromicro/go-zero

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
1.4.4

Ecosystem specific

{
    "imports": [
        {
            "path": "github.com/zeromicro/go-zero/rest/internal/cors",
            "symbols": [
                "isOriginAllowed"
            ]
        }
    ]
}