Summary
A session caching flaw in Daytona allows sandbox previews that are switched from public to private to remain temporarily accessible without authentication.
During this window, previously public previews can still be reached by unauthenticated users due to stale visibility state, increasing the risk of unintended data exposure.
Affected context
The vulnerability occurs in Daytona's sandbox preview visibility handling, specifically when a preview is transitioned from public to private.
Environments that rely on cached visibility or authorization state, and do not immediately invalidate or re-check this state upon policy changes, are susceptible.
It primarily affects deployments where previews contain sensitive or proprietary data that should only be accessible to authenticated or authorized users.
Exploit preconditions
- Attack surface: HTTP endpoints serving sandbox previews.
- Required access: Ability to reach the preview URL over the network (e.g., knowing or guessing the link).
- Trigger point: A sandbox preview that was public is switched to private while its visibility state remains cached.
- Why exploitation is possible: The authorization and visibility checks rely on stale cached data, so access decisions do not immediately reflect the updated private state.
Why this happens
This issue stems from improper session and cache invalidation when access control policies change, aligning with CWE-613 (Insufficient Session Expiration) and CWE-863 (Incorrect Authorization).
The system continues to rely on a cached representation of sandbox visibility after it has been updated, failing to promptly expire or refresh that state.
Abstractly, the insecure pattern is an authorization decision based on outdated state rather than the current policy at the time of each request.
Potential impact
- Unauthenticated users may temporarily access sandbox previews that were intended to be private.
- Sensitive data, AI-generated code, or workflow artifacts could be exposed to unintended parties.
- Leakage of internal logic or proprietary models used within sandboxed workflows.
- Potential compliance violations where access controls must be enforced immediately upon change.
General mitigation guidance
Mitigation focuses on making authorization decisions strongly consistent with current policy and invalidating cached visibility state whenever it changes.
Common patterns include:
- Ensuring caches related to access control or visibility are invalidated or updated atomically with policy changes.
- Performing authorization checks against the current datastore state on each request, or using short-lived cache entries for sensitive controls.
- Designing session and preview access tokens so they expire promptly when underlying visibility changes.
- Minimizing reliance on long-lived cache entries for security-critical decisions and favoring explicit re-validation for access-controlled resources.
How teams detect issues like this
Detection typically involves:
- Reviewing code for authorization decisions that depend on cached visibility or session state without timely invalidation.
- Using static analysis or linters to flag security-sensitive logic that bypasses fresh permission checks.
- Implementing runtime logging for policy changes and subsequent access, then analyzing for requests that succeed after a resource is marked private.
- Applying security testing and regression tests that simulate changes from public to private and verify that unauthorized access is immediately blocked.

