GHSA-vhxv-fg4m-p2w8 Some CORS middleware allow untrusted origins
CORS middleware incorrectly allows untrusted origins when multiple patterns share a suffix, enabling cross-origin attacks.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is GHSA-vhxv-fg4m-p2w8?
GHSA-vhxv-fg4m-p2w8 is a vulnerability in github.com/jub0bs/cors, published on 3 May 2024. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Official description
Impact
Some CORS middleware (more specifically those created by specifying two or more origin patterns whose hosts share a proper suffix) incorrectly allow some untrusted origins, thereby opening the door to cross-origin attacks from the untrusted origins in question.
For example, specifying origin patterns https://foo.com and https://bar.com (in that order) would yield a middleware that would incorrectly allow untrusted origin https://barfoo.com.
Patches
Patched in v0.1.3.
Workarounds
None.
Which versions are affected by GHSA-vhxv-fg4m-p2w8?
3 open source packages ship an affected version, including github.com/jub0bs/cors.
| Package | Affected | Fixed in |
|---|---|---|
github.com/jub0bs/cors Go | All versions | 0.1.3 |
github.com/jub0bs/cors Go | All versions | 0.1.3 |
github.com/jub0bs/cors Go | All versions | 0.1.3 |
How do I fix GHSA-vhxv-fg4m-p2w8?
Upgrade github.com/jub0bs/cors to 0.1.3 or later.
Is GHSA-vhxv-fg4m-p2w8 being exploited?
There is no known exploitation of GHSA-vhxv-fg4m-p2w8 in the wild and no public exploit code.
Sources
Also known as GO-2024-2813.