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_uricallback 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_uriparameters.
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_urias 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_uriand 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 ashttps://trusted.example.com@attacker.com/...can pass the pattern check while actually sending the authorization code toattacker.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_urivalues 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(andhttponly in tightly controlled development environments). - Avoid reflecting arbitrary
redirect_uriparameters; 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_uriparameters 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_urimisuse into CI/CD pipelines.

