Summary
An authentication logic flaw in Daytona allows organization invitations to be accepted or declined by users whose email address matches the invite target but has not been verified.
On OIDC providers that grant sessions before email verification, an attacker can self-register an unverified account with the invited email and join the target organization with the role assigned in the invitation.
Affected context
This issue arises in Daytona deployments that use OIDC identity providers where users can self-sign up and receive a valid session token before verifying their email address.
The vulnerable behavior occurs in the organization invitation acceptance and decline flows, which match the email claim in the OIDC token to the invitation target but fail to require that the email be marked as verified.
Environments that rely on invitations to grant high-privilege roles (e.g., Owner) are particularly exposed when invitations remain pending and can be matched by unverified accounts.
Exploit preconditions
- Attack surface: Organization invitation acceptance and decline endpoints exposed to authenticated OIDC sessions.
- Required access: Ability to create or obtain an OIDC-authenticated session with an email claim matching a pending invitation, without needing that email to be verified.
- Trigger point: Calling the invitation accept (or decline) API while holding a token that contains the same email string as the invitation target.
- Why exploitation is possible: The application trusts the email claim in the OIDC token for invitation matching but does not enforce the email_verified (or equivalent) flag, allowing unverified identities to assume invited roles.
Why this happens
The underlying bug class is an authentication and authorization logic error where identity verification requirements are inconsistent across different workflows.
Daytona correctly enforces email verification during organization creation, but the invitation acceptance and decline paths only validate that the caller's email string matches the target of the invitation, ignoring whether the identity has been verified by the IdP.
This maps to CWE-287 (Improper Authentication) and CWE-863 (Incorrect Authorization) because the system treats possession of an unverified OIDC session as sufficient proof of identity and authorization to join an organization with a potentially privileged role.
Potential impact
- An attacker may join a target organization without completing email verification.
- An attacker could obtain elevated roles (including Owner) within the organization via misused invitations.
- Unauthorized access to projects, agent workflows, and AI-runtime configurations can occur.
- Attackers may change organization settings, invite additional accounts, or modify access controls.
- Compromise of sensitive data processed or stored within the Daytona environment could result.
General mitigation guidance
Effective mitigation focuses on enforcing consistent identity verification and tightening authorization checks around invitation workflows.
Common defensive patterns include:
- Requiring a verified email (or equivalent strong identity attribute) before any invitation-related action, not just during organization creation.
- Explicitly checking the IdP's email_verified flag or analogous claim for all flows that rely on email-based matching.
- Treating invitation acceptance as a privileged action and implementing explicit authorization rules, including role and organization membership checks.
- Avoiding sole reliance on mutable, self-asserted identifiers (like unverified email claims) for security decisions; prefer stable, verified subject identifiers where possible.
- Applying least-privilege principles to invited roles and separating high-privilege invitations from automated or self-service signup paths.
How teams detect issues like this
Detection can focus on identifying inconsistent authentication and authorization patterns tied to email verification.
Helpful strategies include:
- Static analysis or code review to ensure all flows that depend on user identity enforce verification and use consistent checks (e.g., email_verified claim handling).
- Reviewing authorization logic to confirm that role assignment via invitations requires both a verified identity and explicit organization membership validation.
- Monitoring audit logs for invitation acceptances by users whose email status is unverified or recently created, especially for high-privilege roles.
- Implementing policy-based checks in CI/CD pipelines that flag routes performing security-sensitive actions based only on unverified identifiers.

