CVE-2024-27284
JSON

7.5high

cassandra-rs non-idiomatic use of iterators leads to use after free

Severity
7.5high CVSS:3.1 by GitHub_M
Exploit likelihood
0.82% (higher than 58% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-x9xc-63hg-vcfqRUSTSEC-2024-0017

Description

cassandra-rs is a Cassandra (CQL) driver for Rust. Code that attempts to use an item (e.g., a row) returned by an iterator after the iterator has advanced to the next item will be accessing freed memory and experience undefined behaviour. The problem has been fixed in version 3.0.0.

Affected

Product or packageVersionsReported by
Metaswitch cassandra-rs< 3.0.0CVE List
cassandra-rs cassandra-rsbefore 3.0.0CVE List
cassandra-cpp (crates.io)before 3.0.0, from 0.0.0-0 before 3.0.0GitHub Advisory Database, RustSec Advisory Database
cassandra-rs_project cassandra-rsbefore 3.0.0NVD

All scores

GitHub_M7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
GitHub7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NVD7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Classification

CWE-416

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.

What each source says

CVE List

cassandra-rs is a Cassandra (CQL) driver for Rust. Code that attempts to use an item (e.g., a row) returned by an iterator after the iterator has advanced to the next item will be accessing freed memory and experience undefined behaviour. The problem has been fixed in version 3.0.0.

GitHub Advisory Database
Impact

Code that attempts to use an item (e.g., a row) returned by an iterator after the iterator has advanced to the next item will be accessing freed memory and experience undefined behaviour. Code that uses the item and then advances the iterator is unaffected. This problem has always existed.

This is a use-after-free bug, so it's rated high severity. If your code uses a pre-3.0.0 version of cassandra-rs, and uses an item returned by a cassandra-rs iterator after calling next() on that iterator, then it is vulnerable. However, such code will almost always fail immediately - so we believe it is unlikely that any code using this pattern would have reached production. For peace of mind, we recommend you upgrade anyway.

Patches

The problem has been fixed in version 3.0.0. Users should upgrade to ensure their code cannot use the problematic pattern.

Workarounds

Ensure all usage fits the expected pattern. For example, use get_first_row() rather than an iterator, or completely process an item before advancing the iterator with next().

References

None.

RustSec Advisory Database

Code that attempts to use an item (e.g., a row) returned by an iterator after the iterator has advanced to the next item will be accessing freed memory and experience undefined behaviour. Code that uses the item and then advances the iterator is unaffected. This problem has always existed.

This is a use-after-free bug, so it's rated high severity. If your code uses a pre-3.0.0 version of cassandra-rs, and uses an item returned by a cassandra-rs iterator after calling next() on that iterator, then it is vulnerable. However, such code will almost always fail immediately - so we believe it is unlikely that any code using this pattern would have reached production. For peace of mind, we recommend you upgrade anyway.

Patches

The problem has been fixed in version 3.0.0 (commit 299e6ac50f87eb2823a373baec37b590a74994ee). Users should upgrade to ensure their code cannot use the problematic pattern. There is an upgrade guide in the project README.

Workarounds

Ensure all usage fits the expected pattern. For example, use get_first_row() rather than an iterator, or completely process an item before advancing the iterator with next().

NVD (es)

cassandra-rs es un controlador Cassandra (CQL) para Rust. El código que intenta utilizar un elemento (por ejemplo, una fila) devuelto por un iterador después de que el iterador haya avanzado al siguiente elemento accederá a la memoria liberada y experimentará un comportamiento indefinido. El problema se solucionó en la versión 3.0.0.

References

Sources

SourceRecordLicence
CVE ListCVE-2024-27284 changed 2024-08-12CVE Terms of Use
GitHub Advisory DatabaseGHSA-x9xc-63hg-vcfq changed 2026-09-10CC-BY-4.0
RustSec Advisory DatabaseRUSTSEC-2024-0017 changed 2026-10-12CC0-1.0
NVDCVE-2024-27284 changed 2026-06-17Public domain