Miggo Logo

CVE-2021-34428: SessionListener can prevent a session from being invalidated breaking logout

3.5

CVSS Score
3.1

Basic Information

EPSS Score
0.6523%
Published
6/23/2021
Updated
2/1/2023
KEV Status
No
Technology
TechnologyJava

Technical Details

CVSS Vector
CVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
org.eclipse.jetty:jetty-servermaven<= 9.4.409.4.41
org.eclipse.jetty:jetty-servermaven>= 10.0.0, <= 10.0.210.0.3
org.eclipse.jetty:jetty-servermaven>= 11.0.0, <= 11.0.211.0.3

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from improper exception handling during session invalidation. The Session.invalidate() method and its call stack (including SessionHandler.doInvalidate()) are responsible for: 1) Notifying SessionListeners 2) Removing the session ID from the session manager. If any SessionListener's sessionDestroyed() method throws an exception before the session ID removal occurs, the invalidation process aborts prematurely. The patched versions (9.4.41+/10.0.3+/11.0.3+) would contain try-catch blocks around listener notifications to ensure session ID removal happens regardless of listener exceptions. These functions appear in stack traces during logout attempts when listeners throw exceptions.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

### Imp**t I* *n *x**ption is t*rown *rom t** `S*ssionList*n*r#s*ssion**stroy**()` m*t*o*, t**n t** s*ssion I* is not inv*li**t** in t** s*ssion I* m*n***r. On **ploym*nts wit* *lust*r** s*ssions *n* multipl* *ont*xts t*is **n r*sult in * s*ssion n

Reasoning

T** vuln*r**ility st*ms *rom improp*r *x**ption **n*lin* *urin* s*ssion inv*li**tion. T** `S*ssion.inv*li**t*()` m*t*o* *n* its **ll st**k (in*lu*in* `S*ssion**n*l*r.*oInv*li**t*()`) *r* r*sponsi*l* *or: *) Noti*yin* `S*ssionList*n*rs` *) R*movin* t*