Summary
AVideo contains an authentication bypass caused by stale caching of empty database results during email two-factor authentication. An attacker who has a valid password may be able to access an account from a new device without successfully completing the email-based confirmation step.
Affected context
The vulnerability occurs in AVideo authentication flows that use sqlDAL result caching while processing email two-factor authentication for new devices. It becomes risky when an empty cached result is reused after the underlying data has changed, preventing the confirmation-code hash from being generated or validated as intended.
Exploit preconditions
- Attack surface: AVideo login and new-device email two-factor authentication workflow
- Required access: A valid account password; access to the account's email is not necessarily required for the bypass condition
- Trigger point: Authentication from a device that requires email-based confirmation
- Why exploitation is possible: sqlDAL can retain an empty result set, while writeSql does not invalidate that cached result, causing confirmation-code hash generation or lookup to operate on stale data
Why this happens
The underlying defect is inconsistent cache invalidation between database writes and cached reads. When an empty query result remains cached after related authentication data is written, later logic may incorrectly conclude that the confirmation-code record or hash is unavailable. This behavior maps to CWE-287: Improper Authentication, because the application can grant access without reliably enforcing a required authentication factor.
Potential impact
- An attacker with a valid password may bypass email-based two-factor authentication
- Unauthorized access to an account may occur from an untrusted or new device
- Account data and user-controlled content could be exposed or modified
- Compromised accounts could be used for further abuse within the application
General mitigation guidance
Mitigation generally focuses on making authentication state consistent and ensuring that every required factor is independently verified before access is granted.
Common defensive patterns include:
- Invalidate or refresh cached authentication results whenever related records are created, updated, or deleted
- Avoid treating cached empty results as authoritative when authentication state may have changed
- Perform confirmation-code generation and verification against a consistent transactional data view
- Fail closed when a required second-factor record or validation result is missing
- Apply least privilege to authenticated sessions and require reauthentication for sensitive account changes
- Reduce trust in client-controlled device and session indicators
How teams detect issues like this
Organizations can look for this class of issue through:
- Static analysis and code review checks for database writes that do not invalidate related caches
- Tests that exercise empty-result caching followed by record creation or update
- Authentication integration tests covering new devices, repeated attempts, expired codes, and concurrent requests
- Monitoring for successful logins where the expected second-factor verification event is absent
- Policy enforcement requiring fail-closed behavior and independent verification of all configured authentication factors
Automated review tools may help identify inconsistent cache lifecycle handling and authentication branches that proceed after missing validation state.

