Summary
Grav Login plugin versions 2.7.0 through before 3.9.9 contain an authentication bypass involving remember-me cookie restoration. An attacker who has a valid password may obtain a persistent cookie after the password step and use it to restore a fully authorized session without completing two-factor authentication.
Grav Login plugin versions 2.7.0 through before 3.9.9 contain an authentication bypass involving remember-me cookie restoration. An attacker who has a valid password may obtain a persistent cookie after the password step and use it to restore a fully authorized session without completing two-factor authentication.
Affected context
The issue occurs in Grav deployments using the affected Login plugin versions with two-factor authentication and remember-me functionality enabled. Risk increases when a remember-me cookie issued after password verification can later be restored as a fully authenticated session without requiring the configured second factor.
The issue occurs in Grav deployments using the affected Login plugin versions with two-factor authentication and remember-me functionality enabled. Risk increases when a remember-me cookie issued after password verification can later be restored as a fully authenticated session without requiring the configured second factor.
Exploit preconditions
- Attack surface: Login and remember-me session restoration
- Required access: A valid account password, plus the ability to use or obtain the resulting remember-me cookie
- Trigger point: Restoration of a persistent session through the remember-me mechanism
- Why exploitation is possible: The restored session may be treated as fully authenticated even though two-factor verification was not completed
- Attack surface: Login and remember-me session restoration
- Required access: A valid account password, plus the ability to use or obtain the resulting remember-me cookie
- Trigger point: Restoration of a persistent session through the remember-me mechanism
- Why exploitation is possible: The restored session may be treated as fully authenticated even though two-factor verification was not completed
Why this happens
The underlying flaw is an authentication-state validation failure. The application permits a remember-me restoration flow to promote a password-verified session to a fully authorized state without preserving or rechecking the requirement for a second authentication factor. This behavior maps to CWE-287: Improper Authentication, because the system does not consistently enforce all required authentication steps before granting access.
The underlying flaw is an authentication-state validation failure. The application permits a remember-me restoration flow to promote a password-verified session to a fully authorized state without preserving or rechecking the requirement for a second authentication factor. This behavior maps to CWE-287: Improper Authentication, because the system does not consistently enforce all required authentication steps before granting access.
Potential impact
- An attacker may bypass two-factor authentication for an account whose password is known
- Unauthorized users could gain persistent access to protected account functions
- Compromised remember-me cookies could enable session reuse
- Account data or administrative capabilities could be exposed depending on the affected user's privileges
- An attacker may bypass two-factor authentication for an account whose password is known
- Unauthorized users could gain persistent access to protected account functions
- Compromised remember-me cookies could enable session reuse
- Account data or administrative capabilities could be exposed depending on the affected user's privileges
General mitigation guidance
Mitigation generally focuses on ensuring that every session-restoration path enforces the same authentication requirements as an interactive login.
Common defensive patterns include:
- Treating remember-me restoration as a limited, explicitly tracked authentication state
- Requiring two-factor verification before granting full session privileges
- Binding persistent session tokens to narrowly scoped account and device context where appropriate
- Revoking existing remember-me tokens when authentication settings or account credentials change
- Applying least privilege so bypass of one account does not automatically expose broader administrative functions
- Reducing trust in client-held cookies through secure attributes, rotation, expiration, and server-side validation
Mitigation generally focuses on ensuring that every session-restoration path enforces the same authentication requirements as an interactive login.
Common defensive patterns include:
- Treating remember-me restoration as a limited, explicitly tracked authentication state
- Requiring two-factor verification before granting full session privileges
- Binding persistent session tokens to narrowly scoped account and device context where appropriate
- Revoking existing remember-me tokens when authentication settings or account credentials change
- Applying least privilege so bypass of one account does not automatically expose broader administrative functions
- Reducing trust in client-held cookies through secure attributes, rotation, expiration, and server-side validation
How teams detect issues like this
Organizations can assess for this class of issue through:
- Static analysis and code review of remember-me, session restoration, and two-factor state transitions
- Checks that every authentication path records and enforces pending second-factor status
- Dynamic tests verifying that restored sessions cannot access protected functions before two-factor completion
- Monitoring for session restoration events that lack corresponding second-factor verification
- Policy enforcement requiring secure cookie attributes, bounded token lifetimes, and server-side token revocation
Automated security testing and code review tools may help identify inconsistent authentication-state handling.
Organizations can assess for this class of issue through:
- Static analysis and code review of remember-me, session restoration, and two-factor state transitions
- Checks that every authentication path records and enforces pending second-factor status
- Dynamic tests verifying that restored sessions cannot access protected functions before two-factor completion
- Monitoring for session restoration events that lack corresponding second-factor verification
- Policy enforcement requiring secure cookie attributes, bounded token lifetimes, and server-side token revocation
Automated security testing and code review tools may help identify inconsistent authentication-state handling.

