CVE-2024-40627OpaMiddleware does not filter HTTP OPTIONS requests
Fastapi OPA is an opensource fastapi middleware which includes auth flow. HTTP `OPTIONS` requests are always allowed by `OpaMiddleware`, even when they lack authentication, and are passed through directly to the application. `OpaMiddleware` allows all HTTP `OPTIONS` requests without evaluating it against any policy. If an application provides different responses to HTTP `OPTIONS` requests based on an entity existing (such as to indicate whether an entity is writable on a system level), an unauthenticated attacker could discover which entities exist within an application. This issue has been addressed in release version 2.0.1. All users are advised to upgrade. There are no known workarounds for this vulnerability.
What to do
Fixed builds are available from PyPI: see the table below for the fixed version per release.
Ubuntu has not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.10 | fastapi | Fix pending | UBUNTU-CVE-2024-40627 | |
| Ubuntu 26.04 | fastapi | Under investigation | UBUNTU-CVE-2024-40627 | |
| Ubuntu 25.10 | fastapi | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2024-40627 | |
| Ubuntu 24.04 | fastapi | Under investigation | UBUNTU-CVE-2024-40627 | |
| Ubuntu 22.04 | fastapi | Under investigation | UBUNTU-CVE-2024-40627 | |
| PyPI library | fastapi-opa | Fixed | 2.0.1 | PYSEC-2026-1361 |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- busykoala fastapi-opa: affected: < 2.0.1
References
- https://github.com/busykoala/fastapi-opa/security/advisories/GHSA-5f5c-8rvc-j8wf
- https://github.com/busykoala/fastapi-opa/commit/9588109ff651f7ffc92687129c4956126443fb8c
- https://github.com/busykoala/fastapi-opa/blob/6dd6f8c87e908fe080784a74707f016f1422b58a/fastapi_opa/opa/opa_middleware.py#L79-L80
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.