/

CVE-2026-28512

Severity:

HIGH RISK

(7.1)

Open Redirect / Unvalidated Redirects in Pocket ID OIDC

CVE-2026-28512

Analyzed

Vulnerability type

Category:

Open Redirect / Unvalidated Redirects

CWE:

CWE-601

Impact:

Authorization Code / Token Theft via Open Redirect

Severity:

HIGH RISK

(7.1)

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

Pocket ID, an OIDC provider for passkey-based authentication, contained a flaw in its callback URL validation logic where crafted redirect_uri values using URL userinfo (@) could bypass legitimate callback pattern checks.

If an attacker can convince a user to follow a malicious authorization link, the resulting authorization code may be sent to an attacker-controlled host, enabling token theft and account compromise.

Affected context

This vulnerability affects Pocket ID instances acting as an OpenID Connect provider where:

  • Clients rely on Pocket ID to validate redirect_uri callback URLs.
  • Callback validation is implemented using simple pattern or prefix checks.
  • The OIDC authorization flow delivers authorization codes via redirects based on client-supplied redirect_uri parameters.

The issue occurs specifically when URL parsing and validation do not correctly handle userinfo components (user@host) in the authority section, allowing a malicious host to appear as a valid callback.

Exploit preconditions

  • Attack surface: Public OIDC authorization endpoint that accepts redirect_uri as a parameter.
  • Required access: Ability to get a victim user to click or be redirected to a crafted authorization URL (e.g., via phishing, malicious site, or injected links).
  • Trigger point: The OIDC authorization flow where Pocket ID validates the redirect_uri and subsequently redirects the browser with an authorization code.
  • Why exploitation is possible: The callback validation logic checks that the redirect_uri "looks like" a legitimate client URL but fails to correctly interpret userinfo and host boundaries; a URL such as https://trusted.example.com@attacker.com/... can pass the pattern check while actually sending the authorization code to attacker.com.

Why this happens

The underlying bug is an improper validation of redirect URLs, mapping to CWE-601: URL Redirection to Untrusted Site.

Instead of performing strict, component-aware URL validation (scheme, host, port, path, and optional parameters), the implementation likely relied on string-based or prefix checks that did not correctly handle userinfo in the authority segment.

Attackers exploited this mismatch by embedding the trusted domain in the userinfo portion (user@host), causing the code to treat the URL as acceptable while the browser interprets the real network endpoint as the attacker's host.

This is a logic error in how URLs are parsed and validated before being used in security-sensitive redirects within the OIDC authorization flow.

Potential impact

  • Theft of OIDC authorization codes that may be exchangeable for access tokens or ID tokens.
  • Hijacking of user sessions or impersonation of victims on relying-party applications.
  • Exposure of sensitive identity attributes contained in tokens (depending on client configuration).
  • Facilitation of broader phishing or credential-stealing campaigns using seemingly legitimate login flows.
  • Undermining trust in the authentication layer and weakening SSO security across integrated services.

General mitigation guidance

Effective mitigation centers on robust, component-aware URL validation and tight control of redirect endpoints:

  • Parse redirect_uri values using a standards-compliant URL parser and validate individual components (scheme, host, port, and path) rather than using string matching.
  • Enforce an allowlist of exact redirect URIs (or strictly normalized variants) registered per client, avoiding loose prefix or substring checks.
  • Explicitly reject URLs containing userinfo (user@host) if not explicitly required, as they are rarely needed for OIDC callbacks.
  • Restrict allowed schemes to https (and http only in tightly controlled development environments).
  • Avoid reflecting arbitrary redirect_uri parameters; require them to match pre-registered values for each client.
  • Apply the principle of least privilege on tokens (scopes, audiences, lifetimes) so that even stolen tokens have constrained impact.

These patterns help ensure that authorization responses are only ever sent to trusted, pre-registered callback endpoints.

How teams detect issues like this

Organizations can detect and monitor this vulnerability class using a combination of review and testing techniques:

  • Static analysis & code review:
  • Look for application flows where user-supplied URLs (e.g., redirect_uri, return_to, next) are passed directly into redirect operations.
  • Flag uses of simple string operations (e.g., startsWith, contains, regex only on prefixes) for URL validation instead of proper URL parsing.
  • Verify that redirect targets are checked against a strict allowlist of pre-registered URIs, not domain substrings.
  • Security testing:
  • Perform targeted tests with crafted URLs using userinfo (https://trusted.example.com@attacker.com/...) to see if the service follows them.
  • Include malformed or edge-case URLs (missing schemes, mixed case, encoded characters) to assess normalization and validation robustness.
  • Operational monitoring:
  • Log and monitor redirect_uri parameters used in authorization requests and investigate unusual domains or patterns.
  • Alert on redirects to domains outside known, registered callback domains.
  • Automated tooling:
  • Integrate SAST/DAST tools that include rules for open redirect detection and OIDC redirect_uri misuse into CI/CD pipelines.

Sources

SourceLink
github.comgithub.com/pocket-id/pocket-id/commit/3a339e33191c31b68bf57db907f800d9de5ffbc8
github.comgithub.com/pocket-id/pocket-id/security/advisories/GHSA-9h33-g3ww-mqff

Frequently asked

questions

Yes. An attacker can remotely exploit this issue by crafting a malicious authorization URL and tricking users into visiting it. No direct network access to the server beyond normal web access is required.

The attacker does not need authenticated access to the OIDC provider itself; they primarily need the ability to deliver a crafted redirect_uri authorization link to a victim (for example via phishing emails, malicious websites, or injected links in existing applications).

The safest pattern is to enforce strict, parser-based validation of redirect_uri values against a pre-registered allowlist per client, rejecting any URLs that do not exactly match or that contain unexpected components like userinfo or unsupported schemes.

Future implementations should treat redirect-related parameters as highly sensitive, use robust URL parsing libraries, avoid ad-hoc string checks, and require that all redirect endpoints be explicitly registered and validated. Embedding security checks into code review guidelines, automated testing, and CI policies helps prevent regressions in redirect handling logic.

Find out what's already
exploitable in your codebase.