CVE-2024-40627: Fastapi OPA is an opensource fastapi middleware which includes auth flow
Affects fastapiSource GCVE Database
Not known to be exploited · CVSS 5.8 Medium.
Data as of 24 Nov 2026, 19:27 UTC
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:NExploitation evidence
Disclosed: evidence found.
CVE published 15 Jul 2024
Detectable: no evidence on record.
No public nuclei template indexed
Weaponized: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 23 Nov 2026.
What to do
Affected software
| Product | Affected | Fixed in |
|---|---|---|
Ubuntu 26.10fastapipkg:deb/ubuntu/fastapi?arch=source&distro=stonkingOther threats | Affected
| Fixed in– |
Ubuntu 26.04 LTSfastapipkg:deb/ubuntu/fastapi?arch=source&distro=resoluteOther threats | Affected
| Fixed in– |
Ubuntu 25.10fastapipkg:deb/ubuntu/fastapi?arch=source&distro=questingOther threats | Affected
| Fixed in– |
Ubuntu 24.04 LTSfastapipkg:deb/ubuntu/fastapi?arch=source&distro=nobleOther threats | Affected
| Fixed in– |
Ubuntu 22.04 LTSfastapipkg:deb/ubuntu/fastapi?arch=source&distro=jammyOther threats | Affected
| Fixed in– |
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
Description
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.
References
- ubuntu.com/security/CVE-2024-40627 (opens in a new tab)
- cve.org/CVERecord?id=CVE-2024-40627 (opens in a new tab)
- github.com/busykoala/fastapi-opa/security/advisories/GHSA-5f5c-8rvc-j8wf (opens in a new tab)
- github.com/busykoala/fastapi-opa/commit/9588109ff651f7ffc92687129c4956126443fb8c (opens in a new tab)
- github.com/busykoala/fastapi-opa/blob/6dd6f8c87e908fe080784a74707f016f1422b58a/fastapi_opa/opa/opa_middleware.py (opens in a new tab)