CVE-2022-2191: Jetty server Jetty SslConnection Does Not Release Vulnerability

HIGH
Advisory Identifier: GHSA-8mpp-f3f7-xc28
CVSS 7.5
CWE-404
Published
Advisory Summary

CVE-2022-2191 is a HIGH (CVSS 7.5) jetty sslconnection does not release vulnerability (CWE-404: Improper Resource Shutdown or Release) affecting Jetty server libraries in the Maven ecosystem. The issue involves jetty sslconnection does not release pooled bytebuffers in case of errors. Remediation is available by upgrading affected packages to version 10.0.10, 11.0.10.

CVE-2022-2191 at a Glance

CVE Identifier CVE-2022-2191
GHSA Identifier GHSA-8mpp-f3f7-xc28
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-404: Improper Resource Shutdown or Release
Affected Product Jetty server
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 7.5

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

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

How to Fix CVE-2022-2191

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: 10.0.10
<dependency>
    <groupId>org.eclipse.jetty</groupId>
    <artifactId>jetty-server</artifactId>
    <version>10.0.10</version>
</dependency>
org.eclipse.jetty:jetty-server fixed: 11.0.10
<dependency>
    <groupId>org.eclipse.jetty</groupId>
    <artifactId>jetty-server</artifactId>
    <version>11.0.10</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-2022-2191, 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 10.0.10), 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-404: Improper Resource Shutdown or Release, where the product does not release or incorrectly releases a resource before it is made available for re-use. 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 `SslConnection` does not release `ByteBuffer`s in case of error code paths. For example, TLS handshakes that require client-auth with clients that send expired certificates will trigger a TLS handshake errors and the `ByteBuffer`s used to process the TLS handshake will be leaked. ### Workarounds Configure explicitly a `RetainableByteBufferPool` with `max[Heap|Direct]Memory` to limit the amount of memory that is leaked. Eventually the pool will be full of "active" entries (the leaked ones) and will provide `ByteBuffer`s that will be GCed normally. _With embedded-jetty_ ``` java int maxBucketSize = 1000; long maxHeapMemory = 128 * 1024L * 1024L; // 128 MB long maxDirectMemory = 128 * 1024L * 1024L; // 128 MB RetainableByteBufferPool rbbp = new ArrayRetainableByteBufferPool(0, -1, -1, maxBucketSize, maxHeapMemory, maxDirectMemory); server.addBean(rbbp); // make sure the ArrayRetainableByteBufferPool is added before the server is started server.start(); ``` _With jetty-home/jetty-base_ Create a `${jetty.base}/etc/retainable-byte-buffer-config.xml` ``` xml <?xml version="1.0"?> <!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_10_0.dtd"> <Configure id="Server" class="org.eclipse.jetty.server.Server"> <Call name="addBean"> <Arg> <New class="org.eclipse.jetty.io.ArrayRetainableByteBufferPool"> <Arg type="int"><Property name="jetty.byteBufferPool.minCapacity" default="0"/></Arg> <Arg type="int"><Property name="jetty.byteBufferPool.factor" default="-1"/></Arg> <Arg type="int"><Property name="jetty.byteBufferPool.maxCapacity" default="-1"/></Arg> <Arg type="int"><Property name="jetty.byteBufferPool.maxBucketSize" default="1000"/></Arg> <Arg type="long"><Property name="jetty.byteBufferPool.maxHeapMemory" default="128000000"/></Arg> <Arg type="long"><Property name="jetty.byteBufferPool.maxDirectMemory" default="128000000"/></Arg> </New> </Arg> </Call> </Configure> ``` And then reference it in `${jetty.base}/start.d/retainable-byte-buffer-config.ini` ``` etc/retainable-byte-buffer-config.xml ``` ### References https://github.com/eclipse/jetty.project/issues/8161 ### For more information * Email us at [security@webtide.com](mailto:security@webtide.com)

CVE-2022-2191 Affected Jetty server Versions

2 component(s)
Fixed Versions:
10.0.1011.0.10
Product / Package Ecosystem Affected Versions Fixed Version
org.eclipse.jetty:jetty-server
Maven
≥ 10.0.0
< 10.0.10
10.0.10
org.eclipse.jetty:jetty-server
Maven
≥ 11.0.0
< 11.0.10
11.0.10

References

Frequently Asked Questions

What is CVE-2022-2191?
CVE-2022-2191 is a security vulnerability in Jetty server involving Jetty SslConnection does not release pooled ByteBuffers in case of errors under CWE-404: Improper Resource Shutdown or Release.
Which Jetty server versions are affected?
Affected versions include releases prior to 10.0.10, 11.0.10 across affected packages: org.eclipse.jetty:jetty-server.
What version fixes CVE-2022-2191?
Upgrading to 10.0.10, 11.0.10 (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 10.0.10, 11.0.10. Upgrade your dependency to 10.0.10, 11.0.10 or later.
What is the CVSS score of CVE-2022-2191?
CVE-2022-2191 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2022-2191?
CVE-2022-2191 is classified under CWE-404: Improper Resource Shutdown or Release (The product does not release or incorrectly releases a resource before it is made available for re-use.).
How can I check Maven dependencies for CVE-2022-2191?
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-8mpp-f3f7-xc28",
  "modified" : "2022-08-11T21:31:50Z",
  "published" : "2022-07-07T20:55:37Z",
  "aliases" : [ "CVE-2022-2191" ],
  "summary" : "Jetty SslConnection does not release pooled ByteBuffers in case of errors",
  "details" : "### Impact\n`SslConnection` does not release `ByteBuffer`s in case of error code paths.\nFor example, TLS handshakes that require client-auth with clients that send expired certificates will trigger a TLS handshake errors and the `ByteBuffer`s used to process the TLS handshake will be leaked.\n\n### Workarounds\nConfigure explicitly a `RetainableByteBufferPool` with `max[Heap|Direct]Memory` to limit the amount of memory that is leaked.\nEventually the pool will be full of \"active\" entries (the leaked ones) and will provide `ByteBuffer`s that will be GCed normally.\n\n_With embedded-jetty_\n\n``` java\nint maxBucketSize = 1000;\nlong maxHeapMemory = 128 * 1024L * 1024L; // 128 MB\nlong maxDirectMemory = 128 * 1024L * 1024L; // 128 MB\nRetainableByteBufferPool rbbp = new ArrayRetainableByteBufferPool(0, -1, -1, maxBucketSize, maxHeapMemory, maxDirectMemory);\n\nserver.addBean(rbbp); // make sure the ArrayRetainableByteBufferPool is added before the server is started\nserver.start();\n```\n\n_With jetty-home/jetty-base_\n\nCreate a `${jetty.base}/etc/retainable-byte-buffer-config.xml`\n\n``` xml\n<?xml version=\"1.0\"?>\n<!DOCTYPE Configure PUBLIC \"-//Jetty//Configure//EN\" \"https://www.eclipse.org/jetty/configure_10_0.dtd\">\n\n<Configure id=\"Server\" class=\"org.eclipse.jetty.server.Server\">\n  <Call name=\"addBean\">\n    <Arg>\n      <New class=\"org.eclipse.jetty.io.ArrayRetainableByteBufferPool\">\n        <Arg type=\"int\"><Property name=\"jetty.byteBufferPool.minCapacity\" default=\"0\"/></Arg>\n        <Arg type=\"int\"><Property name=\"jetty.byteBufferPool.factor\" default=\"-1\"/></Arg>\n        <Arg type=\"int\"><Property name=\"jetty.byteBufferPool.maxCapacity\" default=\"-1\"/></Arg>\n        <Arg type=\"int\"><Property name=\"jetty.byteBufferPool.maxBucketSize\" default=\"1000\"/></Arg>\n        <Arg type=\"long\"><Property name=\"jetty.byteBufferPool.maxHeapMemory\" default=\"128000000\"/></Arg>\n        <Arg type=\"long\"><Property name=\"jetty.byteBufferPool.maxDirectMemory\" default=\"128000000\"/></Arg>\n      </New>\n    </Arg>\n  </Call>\n</Configure>\n```\n\nAnd then reference it in `${jetty.base}/start.d/retainable-byte-buffer-config.ini`\n\n```\netc/retainable-byte-buffer-config.xml\n```\n\n\n### References\nhttps://github.com/eclipse/jetty.project/issues/8161\n\n### For more information\n* Email us at [security@webtide.com](mailto:security@webtide.com)\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.eclipse.jetty:jetty-server"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "10.0.0"
      }, {
        "fixed" : "10.0.10"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.eclipse.jetty:jetty-server"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "11.0.0"
      }, {
        "fixed" : "11.0.10"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/eclipse/jetty.project/security/advisories/GHSA-8mpp-f3f7-xc28"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-2191"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/eclipse/jetty.project/issues/8161"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/eclipse/jetty.project"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20220909-0003"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-404" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-07-07T20:55:37Z",
    "nvd_published_at" : "2022-07-07T21:15:00Z"
  }
}