/

CVE-2026-42855

Severity:

HIGH RISK

(7.5)

Improper Authentication in arduino-esp32 WebServer Digest

CVE-2026-42855

Analyzed

Vulnerability type

Category:

Improper Authentication

CWE:

CWE-287

Impact:

Authentication Bypass and Unauthorized Resource Access

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

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

Summary

The arduino-esp32 WebServer Digest authentication implementation computes the authentication hash using the URI provided in the client's Authorization header without checking that it matches the actual requested URI.

An attacker who has any valid digest response for one protected resource (URI-A) can reuse that response to access a different protected resource (URI-B), effectively bypassing per-URI access control in affected configurations.

Affected context

This vulnerability affects ESP32-based applications built with arduino-esp32 that:

  • Use the built-in WebServer (or compatible) component
  • Rely on HTTP Digest authentication for protecting endpoints
  • Expect per-URI or per-resource authorization decisions

The issue manifests when servers assume that a valid Digest response is bound to the specific requested URI, while the implementation only validates the digest against the URI string included in the Authorization header, not the actual requested path.

Exploit preconditions

  • Attack surface: HTTP endpoints on ESP32 devices protected by Digest authentication.
  • Required access: Ability to capture, obtain, or generate at least one valid Digest authentication response for any protected URI on the target device (e.g., via legitimate credentials, shoulder surfing, intercepted traffic where TLS is absent, or reuse of one known challenge/response pair).
  • Trigger point: Sending an HTTP request to a different protected URI (URI-B) while including a Digest Authorization header computed for some other URI (URI-A).
  • Why exploitation is possible: The server computes and verifies the Digest response using the URI value supplied inside the Authorization header, instead of enforcing that it matches the actual requested URI. Because the server does not bind the authentication proof to the concrete resource being accessed, a valid digest for one path can be replayed against another.

Why this happens

The underlying bug is a logic flaw in how Digest authentication is implemented. HTTP Digest authentication is designed so that the request URI is part of the hash computation, binding the proof-of-knowledge to a specific resource. In the affected implementation, the server trusts the URI field embedded in the client's Authorization header without cross-checking it against the actual request target.

This breaks the fundamental assumption that the server-side verification uses the server's own understanding of the requested URI. As a result, the proof is no longer resource-specific. This maps to CWE-287: Improper Authentication, where an authentication mechanism fails to adequately validate an asserted identity or proof, allowing users to be authenticated for resources they did not explicitly prove authorization for.

Potential impact

  • Bypass of per-resource access controls, allowing access to protected endpoints using a digest response from a different URI.
  • Unauthorized access to administrative or configuration endpoints that are intended to be more restricted than other authenticated resources.
  • Exposure or manipulation of sensitive configuration data, device state, or sensor/actuator controls managed by the protected URIs.
  • Escalation of impact when high-privilege operations (e.g., firmware updates, device resets, or network configuration changes) are exposed on separate URIs but rely on the same Digest authentication realm.

General mitigation guidance

Effective mitigation focuses on correctly binding authentication proofs to the specific resource being accessed and limiting the trust placed in client-supplied fields.

Pattern-level mitigations include:

  • Ensuring the server uses its own canonical representation of the requested URI when computing and validating Digest authentication hashes, rather than trusting the URI field in the Authorization header.
  • Normalizing and strictly deriving all authentication inputs (method, URI, realm, nonce, etc.) from server-side state, not from the client-provided header values when those differ from the actual request.
  • Designing access control such that sensitive operations are protected by multiple layers (e.g., per-URI checks, role-based permissions, and potentially secondary confirmation steps) instead of relying solely on a single Digest check.
  • Applying the principle of least privilege to authenticated users and keeping high-impact management endpoints logically and physically separated (e.g., bound to different paths, ports, or interfaces).
  • Favoring modern and less error-prone authentication mechanisms where appropriate, such as token-based schemes bound to explicit scopes or capabilities associated with individual endpoints.

How teams detect issues like this

Detection of this class of flaw revolves around verifying that authentication and authorization logic correctly binds to the requested resource and does not over-trust client-controlled parameters.

High-level strategies include:

  • Code-level review: Examine Digest authentication implementations to confirm that the server uses the actual requested URI (e.g., from the HTTP request line or server routing layer) in the hash computation and does not simply copy the URI from the Authorization header.
  • Static analysis rules: Configure rules to flag uses of client-supplied values (such as headers or query params) being used directly as inputs to authentication or signature verification routines without server-side canonicalization.
  • Security test cases: Implement automated tests where valid Digest responses for one URI are replayed against different URIs, validating that the server correctly rejects mismatches.
  • Policy enforcement: Incorporate secure coding guidelines for authentication implementations into code review checklists and CI pipelines, optionally backed by automated tools that search for custom authentication logic that does not validate all expected inputs.

Sources

SourceLink
github.comgithub.com/espressif/arduino-esp32/security/advisories/GHSA-28hv-fwm3-rpcq

Frequently asked

questions

Yes. Any remote client that can reach a Digest-protected endpoint and obtain a valid Digest response for one URI can attempt to reuse that response against other protected URIs on the same device.

The attacker needs access to at least one valid Digest response for any protected resource. This might come from possessing legitimate credentials, obtaining a captured challenge/response exchange on unencrypted connections, or otherwise gaining access to a valid Authorization header value. Once they have such a response, they may leverage it to access other protected URIs.

The core fix is to ensure that the server derives all inputs to the Digest verification from its own view of the request. Specifically, it should compute and verify the hash using the actual requested URI and HTTP method, ignoring mismatched client-supplied URI values in the Authorization header. This re-establishes the binding between the proof-of-knowledge and the target resource.

Prevention depends on treating authentication logic as security-critical: avoid custom shortcuts, strictly separate client-controlled data from verification inputs, and adopt well-reviewed reference implementations. Enforce code review standards that require binding authentication proofs to server-side request metadata, add automated tests for cross-URI replay attempts, and favor mature, standardized libraries or frameworks for authentication rather than ad-hoc implementations.

Find out what's already
exploitable in your codebase.