CVE-2021-34428: Jetty server SessionListener Can Prevent A Session Vulnerability

LOW
Advisory Identifier: GHSA-m6cp-vxjx-65j6
CVSS 3.5
CWE-613
Published
Advisory Summary

CVE-2021-34428 is a LOW (CVSS 3.5) sessionlistener can prevent a session vulnerability (CWE-613: Insufficient Session Expiration) affecting Jetty server libraries in the Maven ecosystem. The issue involves sessionlistener can prevent a session from being invalidated breaking logout. Remediation is available by upgrading affected packages to version 9.4.41, 10.0.3, 11.0.3.

CVE-2021-34428 at a Glance

CVE Identifier CVE-2021-34428
GHSA Identifier GHSA-m6cp-vxjx-65j6
Severity LOW
CVSS v3.1 Base Score 3.5
CWE Classification CWE-613: Insufficient Session Expiration
Affected Product Jetty server
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 3.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N).

Attack Vector Physical (AV:P)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2021-34428

To remediate this vulnerability, upgrade all affected Jetty server dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

org.eclipse.jetty:jetty-server fixed: 9.4.41
<dependency>
    <groupId>org.eclipse.jetty</groupId>
    <artifactId>jetty-server</artifactId>
    <version>9.4.41</version>
</dependency>
org.eclipse.jetty:jetty-server fixed: 10.0.3
<dependency>
    <groupId>org.eclipse.jetty</groupId>
    <artifactId>jetty-server</artifactId>
    <version>10.0.3</version>
</dependency>
org.eclipse.jetty:jetty-server fixed: 11.0.3
<dependency>
    <groupId>org.eclipse.jetty</groupId>
    <artifactId>jetty-server</artifactId>
    <version>11.0.3</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=org.eclipse.jetty

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2021-34428, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=org.eclipse.jetty

Analyze the terminal output to locate any version of Jetty server in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 9.4.41), your application is affected.

Note: The mvn dependency:tree -Dincludes=org.eclipse.jetty command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-613: Insufficient Session Expiration, where according to wasc, "insufficient session expiration is when a web site permits an attacker to reuse old session credentials or session ids for authorization.". In Jetty server, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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.

CVE-2021-34428 Affected Jetty server Versions

3 component(s)
Fixed Versions:
9.4.4110.0.311.0.3
Product / Package Ecosystem Affected Versions Fixed Version
org.eclipse.jetty:jetty-server
Maven
< 9.4.41
9.4.41
org.eclipse.jetty:jetty-server
Maven
≥ 10.0.0
< 10.0.3
10.0.3
org.eclipse.jetty:jetty-server
Maven
≥ 11.0.0
< 11.0.3
11.0.3

References

GitHub Advisory / Wiki ADVISORY
https://github.com/eclipse/jetty.project/security/advisories/GHSA-m6cp-vxjx-65j6
NVD — CVE-2021-34428 NVD
https://nvd.nist.gov/vuln/detail/CVE-2021-34428
Jetty server Source Repository REPOSITORY
https://github.com/eclipse/jetty.project
lists.apache.org/thread.html/r67c4f9... WEB
https://lists.apache.org/thread.html/r67c4f90658fde875521c949448c54c98517beecdc7f618f902c620ec@%3Cissues.zookeeper.apache.org%3E
lists.apache.org/thread.html/r8a1a33... WEB
https://lists.apache.org/thread.html/r8a1a332899a1f92c8118b0895b144b27a78e3f25b9d58a34dd5eb084@%3Cnotifications.zookeeper.apache.org%3E
lists.apache.org/thread.html/rbefa05... WEB
https://lists.apache.org/thread.html/rbefa055282d52d6b58d29a79fbb0be65ab0a38d25f00bd29eaf5e6fd@%3Cnotifications.zookeeper.apache.org%3E
lists.apache.org/thread.html/rddbb4f... WEB
https://lists.apache.org/thread.html/rddbb4f8d5db23265bb63d14ef4b3723b438abc1589f877db11d35450@%3Cissues.zookeeper.apache.org%3E
lists.apache.org/thread.html/ref1c16... WEB
https://lists.apache.org/thread.html/ref1c161a1621504e673f9197b49e6efe5a33ce3f0e6d8f1f804fc695@%3Cjira.kafka.apache.org%3E
lists.apache.org/thread.html/rf36f11... WEB
https://lists.apache.org/thread.html/rf36f1114e84a3379b20587063686148e2d5a39abc0b8a66ff2a9087a@%3Cissues.zookeeper.apache.org%3E
Jetty server Security Information SECURITY
https://security.netapp.com/advisory/ntap-20210813-0003
Jetty server Security Information SECURITY
https://www.debian.org/security/2021/dsa-4949
Jetty server Security Information SECURITY
https://www.oracle.com/security-alerts/cpuapr2022.html
Jetty server Security Information SECURITY
https://www.oracle.com/security-alerts/cpujan2022.html
Jetty server Security Information SECURITY
https://www.oracle.com/security-alerts/cpuoct2021.html

Frequently Asked Questions

What is CVE-2021-34428?
CVE-2021-34428 is a security vulnerability in Jetty server involving SessionListener can prevent a session from being invalidated breaking logout under CWE-613: Insufficient Session Expiration.
Which Jetty server versions are affected?
Affected versions include releases prior to 9.4.41, 10.0.3, 11.0.3 across affected packages: org.eclipse.jetty:jetty-server.
What version fixes CVE-2021-34428?
Upgrading to 9.4.41, 10.0.3, 11.0.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is jetty-server affected?
Yes, org.eclipse.jetty:jetty-server is affected in releases prior to 9.4.41, 10.0.3, 11.0.3. Upgrade your dependency to 9.4.41, 10.0.3, 11.0.3 or later.
What is the CVSS score of CVE-2021-34428?
CVE-2021-34428 has a CVSS v3.1 base score of 3.5 (LOW) with vector string CVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N.
What CWE is associated with CVE-2021-34428?
CVE-2021-34428 is classified under CWE-613: Insufficient Session Expiration (According to WASC, "Insufficient Session Expiration is when a web site permits an attacker to reuse old session credentials or session IDs for authorization.").
How can I check Maven dependencies for CVE-2021-34428?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.eclipse.jetty'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-m6cp-vxjx-65j6",
  "modified" : "2022-02-08T21:21:05Z",
  "published" : "2021-06-23T20:23:04Z",
  "aliases" : [ "CVE-2021-34428" ],
  "summary" : "SessionListener can prevent a session from being invalidated breaking logout",
  "details" : "### Impact\nIf 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.\n\nThere 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.\n\n### Workarounds\nThe application should catch all Throwables within their `SessionListener#sessionDestroyed()` implementations.\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.eclipse.jetty:jetty-server"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "9.4.41"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 9.4.40"
    }
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.eclipse.jetty:jetty-server"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "10.0.0"
      }, {
        "fixed" : "10.0.3"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 10.0.2"
    }
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.eclipse.jetty:jetty-server"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "11.0.0"
      }, {
        "fixed" : "11.0.3"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 11.0.2"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/eclipse/jetty.project/security/advisories/GHSA-m6cp-vxjx-65j6"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-34428"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/eclipse/jetty.project"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r67c4f90658fde875521c949448c54c98517beecdc7f618f902c620ec@%3Cissues.zookeeper.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r8a1a332899a1f92c8118b0895b144b27a78e3f25b9d58a34dd5eb084@%3Cnotifications.zookeeper.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/rbefa055282d52d6b58d29a79fbb0be65ab0a38d25f00bd29eaf5e6fd@%3Cnotifications.zookeeper.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/rddbb4f8d5db23265bb63d14ef4b3723b438abc1589f877db11d35450@%3Cissues.zookeeper.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/ref1c161a1621504e673f9197b49e6efe5a33ce3f0e6d8f1f804fc695@%3Cjira.kafka.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/rf36f1114e84a3379b20587063686148e2d5a39abc0b8a66ff2a9087a@%3Cissues.zookeeper.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20210813-0003"
  }, {
    "type" : "WEB",
    "url" : "https://www.debian.org/security/2021/dsa-4949"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/security-alerts/cpuapr2022.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/security-alerts/cpujan2022.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/security-alerts/cpuoct2021.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-613" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-06-22T16:41:00Z",
    "nvd_published_at" : "2021-06-22T15:15:00Z"
  }
}