CVE-2024-40627
Medium · 5.8CVSS
5.8
EPSS
0.6%
Published
Jul 15, 2024
CISA due date
—
Cloudanix analysis
A web authentication component failed to check certain requests, letting outsiders quietly learn whether specific items exist inside an application.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- Low
- Impact
- Data Exposure
- Component
- Application
- Class
- Authorization Bypass
- Remediation
- Upgrade
- Effort
- Low
- Patch risk
- Low
What it actually does
OpaMiddleware in fastapi-opa permits all unauthenticated HTTP OPTIONS requests to bypass policy evaluation and reach the application directly, enabling response-based inference of entity existence.
Why it matters to the business
Attackers can silently enumerate sensitive resources or data entities without credentials, increasing the risk of targeted follow-on attacks; the issue affects open-source middleware used in authentication flows with no ransomware association or high exploit activity.
How an attack unfolds
An attacker identifies applications using the vulnerable middleware and issues unauthenticated OPTIONS requests against endpoints whose responses differ based on whether an entity exists; differing replies reveal the presence of writable or protected objects without triggering authentication checks.
How to fix it
Upgrade busykoala/fastapi-opa to commit 9588109ff651f7ffc92687129c4956126443fb8c (release 2.0.1) or later; no workarounds exist.
How to confirm the fix worked
Confirm middleware version is at or above the fixed commit, then verify that OPTIONS requests without valid authentication now receive the same policy enforcement as other methods.
Typical attack path
- Map target endpoints protected by fastapi-opa middleware
- Issue HTTP OPTIONS requests lacking any authentication headers or tokens
- Compare response status, headers, or body length across multiple entities
- Catalog discovered entities for subsequent authenticated exploitation attempts
How to detect it
Search web server or application logs for high volumes of OPTIONS requests lacking Authorization headers or tokens, especially to endpoints that previously varied responses by entity presence.
What your security team should do
- Immediately upgrade all instances of fastapi-opa to the patched release
- Audit application endpoints that return entity-existence indicators via OPTIONS
- Add logging for unauthenticated OPTIONS traffic to detect enumeration attempts
- Review downstream dependents of the affected package for inherited exposure
The record
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.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| PyPI | fastapi-opa | 0 | 2.0.1 |
| Ubuntu:22.04:LTS | fastapi | 0 | No fix |
| Ubuntu:24.04:LTS | fastapi | 0 | No fix |
| Ubuntu:24.10 | fastapi | 0 | No fix |
| Ubuntu:25.04 | fastapi | 0 | No fix |
| Ubuntu:25.10 | fastapi | 0 | No fix |
Related vulnerabilities
- CVE-2026-89173 Smart Video Intercom System developed by Kingdom Communication Associated has a Sensitive… CWE-204
- CVE-2026-9161 Observable response discrepancy vulnerability in DernekPlus Website Template allows… CWE-204
- CVE-2026-19205 Observable response discrepancy vulnerability in GastroMenum GastroMenum Web Panel allows… CWE-204
- CVE-2026-19080 Observable response discrepancy vulnerability in Menulux Software Inc. CWE-204
- CVE-2026-78584 Observable Response Discrepancy (CWE-204) in the Kibana Osquery feature can lead to… CWE-204
- CVE-2026-84307 Filament is a collection of full-stack components for accelerated Laravel development. CWE-204
- CVE-2026-66002 Frappe is a full-stack web application framework. CWE-204
- CVE-2026-54739 Lemmy is a link aggregator and forum for the fediverse. CWE-204