Severity:

HIGH RISK

(7.5)

Authentication Bypass via Path-Based Exemptions (CWE-863) in Prefect 3.6.19 Control Plane Endpoints

CVE-2026-3514

Analyzed

Vulnerability type

Category:

Authentication Bypass

CWE:

CWE-863

Impact:

Unauthorized Access to Sensitive Data and Control Plane Resources

Severity:

HIGH RISK

(7.5)

CVSS version:

3.0

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Prefect 3.6.19 contains an authentication bypass where middleware skips auth checks for any URL path ending in health or ready, originally intended only for liveness/readiness probes.

An attacker who can create Prefect resources with names ending in health or ready can then access those resources without authentication, potentially exposing sensitive configuration data such as API keys and database credentials stored in Prefect Variables.

Affected context

This vulnerability occurs in Prefect 3.6.19 deployments where:

  • HTTP authentication middleware uses simple suffix matching to exempt health and readiness endpoints from authentication.
  • User-controlled resource identifiers (names or paths) are incorporated into URL routes.
  • Variables, flows, work pools, work queues, and deployments are reachable via HTTP APIs that share the same middleware.

Under these conditions, any resource whose name causes its URL to end with health or ready may unintentionally fall under the health-check exemption logic and be served without authentication.

Exploit preconditions

  • Attack surface: Prefect API/Orion HTTP endpoints exposed to a network (intranet or internet).
  • Required access: Ability to reach the Prefect API and create or influence the naming of resources (e.g., flows, variables, work pools, work queues, deployments).
  • Trigger point: Issuing HTTP requests to URLs whose paths end with health or ready, constructed via attacker-controlled resource names.
  • Why exploitation is possible: The authentication middleware applies a coarse-grained rule that treats any path ending with health or ready as a probe endpoint, skipping normal authentication checks. Because resource names are embedded in these paths, an attacker can craft names that cause sensitive endpoints to be misclassified as health/readiness endpoints.

Why this happens

The underlying issue is improper authorization logic (CWE-863) caused by conflating endpoint semantics with URL suffix patterns.

Instead of explicitly whitelisting dedicated health and readiness routes, the middleware uses a generic rule: if the URL path ends with health or ready, skip authentication.

Since resource names are user-controlled and incorporated into the path, this pattern allows untrusted input to influence access control decisions.

Conceptually, the bug is an insecure authorization check that bases trust on path string matching rather than on the actual handler, route metadata, or explicit policy, allowing sensitive endpoints to be treated as public health probes.

Potential impact

  • Unauthorized reading of Prefect Variables that may contain API keys, database credentials, and other secrets.
  • Unauthorized access to details of flows, deployments, work pools, and work queues, revealing internal architecture and operational metadata.
  • Potential modification or misuse of orchestration resources (depending on which operations are exposed on the affected endpoints).
  • Facilitation of broader compromise of connected systems via stolen credentials and tokens.
  • Increased ability for attackers to perform reconnaissance on job scheduling and deployment configurations.

General mitigation guidance

Effective mitigation focuses on tightening authorization logic and reducing reliance on fragile URL patterns:

  • Replace suffix-based exemptions with explicit whitelists for well-defined health and readiness routes that are not influenced by user-controlled path segments.
  • Separate health/readiness probes onto distinct routes or even a dedicated service or port with clearly scoped access control.
  • Ensure that all resource-specific endpoints (variables, flows, work pools, work queues, deployments) always enforce authentication and authorization, regardless of naming.
  • Treat resource names as untrusted input and avoid using them directly in authorization decisions; instead, use stable route identifiers and explicit permission checks.
  • Apply the principle of least privilege to Prefect service accounts and associated secrets so that exposed information is minimized if an endpoint is accidentally left unauthenticated.

How teams detect issues like this

Detection can be approached through both code-centric and operational techniques:

  • Static analysis and code review:
  • Search middleware and routing logic for broad pattern-based exemptions (e.g., endswith("health"), endswith("ready"), or similar string checks) that bypass authentication.
  • Flag any authorization decisions that depend solely on URL string patterns rather than explicit route configuration or permission rules.
  • Review API route definitions to ensure health/readiness handlers are clearly separated from resource-management endpoints.
  • Automated security testing:
  • Use API fuzzing or integration tests that create resources with specially crafted names and then probe for unauthenticated access to their endpoints.
  • Add regression tests that verify all variable and control-plane endpoints enforce authentication regardless of resource naming.
  • Runtime monitoring:
  • Analyze access logs for unauthenticated requests to non-standard paths ending with health or ready.
  • Configure WAF or API gateways to alert on suspicious path patterns that resemble internal resource URLs but appear as health endpoints.

Sources

SourceLink
github.comgithub.com/prefecthq/prefect/commit/e21617125335025b4b27e7d6f0ca028e8e8f3b79
huntr.comhuntr.com/bounties/c540e5e1-f74f-44f4-bfa0-9764ff6daa75

Frequently asked

questions

Exploitability depends on exposure of the Prefect API and the ability for an attacker to create or control resource names. In environments where the API is reachable from untrusted networks and users can register resources, the issue can be exploited remotely.

Initial exploitation of the bypass itself does not require valid credentials for the affected endpoints, but the attacker typically needs some level of ability to create or influence resource names. In some deployments, that capability may already be available to low-privileged or external users.

The safest pattern is to remove generic suffix-based exemptions and introduce explicit, route-level policies: only dedicated, fixed health and readiness endpoints should be unauthenticated, and all resource-management APIs must always enforce proper authentication and authorization.

Use explicit access-control rules tied to route definitions and permission models, avoid basing authorization on URL string patterns or user-controlled values, enforce security reviews for middleware that bypasses auth, and incorporate automated tests that verify no sensitive endpoints are exposed without authentication.

Find out what's already
exploitable in your codebase.