Patrowl Intel
Sign in
Back to feed

CVE-2022-2191

Published Jul 7, 2022

Summary

Jetty SslConnection does not release pooled ByteBuffers in case of errors

Impact

SslConnection does not release ByteBuffers 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 ByteBuffers 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 ByteBuffers that will be GCed normally.

With embedded-jetty

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

Affected

Weaknesses

CWE-404CWE-664

CVSS details

  • v3.17.5CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

MITRE ATT&CK

Inferred

Where this vulnerability fits in an attack

Initial Access Impact

Exploits & references 1 exploit · 6 references

Timeline

  1. PublishedJul 7, 2022

Potentially impacted assets

See if this affects your attack surface

Latest trending attack

Criticaltoday

Django - SQL Injection in range & in Lookups

Django is an open-source Python web framework. Its ORM builds SQL queries from model filters and lookups. CVE-2026-132092 Queries that use the `range` and `in` lookups are subject to SQL injection when they involve column aliases or key transforms containing percent signs. For `__range`, the flaw is reachable when more than two right-hand-side values are passed. For `__in`, it is reachable when a bilateral transform is used. Exploitation happens over the network through any application endpoint that passes attacker-controlled values into such a lookup. Affected versions are Django 6.1 before 6.1.4, 6.0 before 6.0.11, and 5.2 before 5.2.20, plus the main development branch. Earlier, unsupported series (5.1.x, 5.0.x and 4.2.x) were not evaluated and may also be affected. Fixed versions are 6.1.4, 6.0.11 and 5.2.20. The fix makes the `range` lookup require exactly two right-hand-side values. Percent signs in column aliases and key transforms have been deprecated since Django 6.0, with removal scheduled for 2028. The Django project rates the issue High severity. It was reported by Cristian Panaro.

Take 15 minutes to discover the Patrowl EASM platform with our experts

The intelligence behind this page, applied to your own exposure: your assets discovered, matched to these signals, prioritised by the same score.

  • European Investment Bank
  • MGEN Solution
  • Forvis Mazars
  • Colas
  • Heetch
  • Xplor