Unauthenticated Endpoint

ID

unauthenticated_endpoint

Severity

high

Remediation Complexity

medium

Remediation Risk

high

Remediation Effort

medium

Family

API2:2023 - Broken Authentication

CWE

CWE-306

Resource

authentication

Language

any

Description

Reports HTTP endpoints that declare no authentication requirement. The endpoint inventory carries each endpoint’s authentication evidence (annotations, middleware chain, OpenAPI security: block, framework-level filters); when none of those are present, and the endpoint’s path is not in the allowlist of legitimately public routes (/health, /metrics, /actuator/, /.well-known/, …), the endpoint is flagged.

This is the canonical OWASP API2:2023 — Broken Authentication signal at the endpoint-shape level.

Rationale

An endpoint that does not require authentication is reachable by any client on the network, with no audit trail tied to a user identity. For endpoints handling business data this is a direct path to enumeration, scraping, abuse, and data exfiltration — every public, unauthenticated finding is reachable from the internet the moment the service is exposed.

Unauthenticated endpoints often slip in unintentionally — a missing @PreAuthorize, a route added before the auth middleware was registered, a removed annotation during a refactor, an OpenAPI spec where the global security: was overridden to security: [] for a single operation and never restored. Static endpoint review is the only reliable way to surface them before a release.

Remediation

Add an authentication requirement at the endpoint, controller, or service level using the framework’s standard mechanism — annotation, middleware, OpenAPI security: block, or a global filter that denies-by-default and only allow-lists explicit public routes.

  • Spring / Spring Boot: @PreAuthorize, @Secured, @RolesAllowed, or method security in SecurityConfig.

  • ASP.NET Core: [Authorize] on the controller or action.

  • JAX-RS: @RolesAllowed / @DenyAll / SecurityContext check.

  • Express / NestJS / Fastify / Koa / Hono: an authentication middleware (passport, express-jwt, NestJS Guard, …) registered before the handler.

  • FastAPI / Flask: a Depends(…​) / before_request authentication callback.

  • OpenAPI / Swagger: a security: requirement on the operation or globally.

If the endpoint is genuinely public (health checks, marketing landing pages, OAuth callback URLs, …), add its path to the detector’s publicPaths allowlist so the finding stops firing.

Configuration

The detector accepts one configurable parameter:

  • publicPaths — list of Ant-style glob patterns whose endpoints are exempt. Built-in defaults (/health, /metrics, /actuator/, /.well-known/) always apply; entries here are added on top.

Unless your project has additional well-known public paths, you typically do not need to configure this detector.

References