LOW 3.5

CVE-2021-34428

SessionListener can prevent a session from being invalidated breaking logout

Description

Impact

If an exception is thrown from the SessionListener#sessionDestroyed() method, then the session ID is not invalidated in the session ID manager. On deployments with clustered sessions and multiple contexts this can result in a session not being invalidated. This can result in an application used on a shared computer being left logged in.

There is no known path for an attacker to induce such an exception to be thrown, thus they must rely on an application to throw such an exception. The OP has also identified that during the call to sessionDestroyed, the getLastAccessedTime() throws an IllegalStateException, which potentially contrary to the servlet spec, so applications calling this method may always throw and fail to log out. If such an application was only tested on a non clustered test environment, then it may be deployed on a clustered environment with multiple contexts and fail to log out.

Workarounds

The application should catch all Throwables within their SessionListener#sessionDestroyed() implementations.

Affected Maven artifacts (1)

ArtifactAffected versionsFixed in
org.eclipse.jetty » jetty-server
< 9.4.41>= 10.0.0, < 10.0.3>= 11.0.0, < 11.0.3
9.4.41, 10.0.3, 11.0.3

Blast radius

1affected artifacts
320affected versions
19,113dependent artifacts (est.)
986,082dependent versions

56% of the dependent artifacts (10,876) still pull an affected version in their latest release.

DepthDependent versions
Direct
118,343
2 hops
328,585
3 hops
281,637
4 hops
134,791
5 hops
69,844
6 hops
52,882

Most used dependents

Computed from the dependency graph of build 20261124.0621 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.