GHSA-v84h-653v-4pq9 Some CORS middleware allow untrusted origins

Not scored Published

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-v84h-653v-4pq9?

GHSA-v84h-653v-4pq9 is a vulnerability in github.com/jub0bs/fcors, 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.9.0.

Workarounds

None.

Which versions are affected by GHSA-v84h-653v-4pq9?

3 open source packages ship an affected version, including github.com/jub0bs/fcors.

PackageAffectedFixed in
github.com/jub0bs/fcors GoAll versions0.9.0
github.com/jub0bs/fcors GoAll versions0.9.0
github.com/jub0bs/fcors GoAll versions0.9.0

How do I fix GHSA-v84h-653v-4pq9?

Upgrade github.com/jub0bs/fcors to 0.9.0 or later.

Is GHSA-v84h-653v-4pq9 being exploited?

There is no known exploitation of GHSA-v84h-653v-4pq9 in the wild and no public exploit code.

Sources

Also known as GO-2024-2812.

Is GHSA-v84h-653v-4pq9 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free