Skip to content
Heist/ feed
Back to feed
UnratedFix available

Non-idiomatic use of iterators leads to use after free

Type: advisorySources: OSV

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()`.

Products
cassandra-cpp
Affected versions
Not specified
Fixed versions
3.0.0
CVEs
CVE-2024-27284
Confirmed fixed CVEs
Not specified
Updated in this feed
30 Oct 2026, 08:40 UTC · Revision 1

Source evidence

Non-idiomatic use of iterators leads to use after free

core-osv · Original source

Published 28 Feb 2024, 12:00 UTC

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()`.

osv:RUSTSEC-2024-0017

cassandra-cpp

Fixed versions: 3.0.0

Complete source record
{
  "id": "3343740ae2aa74738e877d6c9b7314296f5c0fdc64ad20892e0698eed59ef387",
  "url": "https://osv.dev/vulnerability/RUSTSEC-2024-0017",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Non-idiomatic use of iterators leads to use after free",
    "summary": "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()`.",
    "evidence": "osv:RUSTSEC-2024-0017",
    "products": [
      {
        "name": {
          "value": "cassandra-cpp",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "3.0.0",
            "evidence": "/affected/0/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "unknown",
    "structured": {
      "id": "RUSTSEC-2024-0017",
      "aliases": [
        "CVE-2024-27284",
        "GHSA-x9xc-63hg-vcfq",
        "RUSTSEC-2024-0017"
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "SEMVER",
              "events": [
                {
                  "introduced": "0.0.0-0"
                },
                {
                  "fixed": "3.0.0"
                }
              ]
            }
          ],
          "package": {
            "name": "cassandra-cpp",
            "purl": "pkg:cargo/cassandra-cpp",
            "ecosystem": "crates.io"
          },
          "database_specific": {
            "cvss": null,
            "source": "https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2024-0017.json",
            "categories": [
              "memory-corruption",
              "memory-exposure"
            ],
            "informational": "unsound"
          },
          "ecosystem_specific": {
            "affects": {
              "os": [],
              "arch": [],
              "functions": []
            },
            "affected_functions": null
          }
        }
      ],
      "modified": "2026-10-12T18:00:02.666994476Z",
      "provider": "osv",
      "references": [
        "https://crates.io/crates/cassandra-cpp",
        "https://rustsec.org/advisories/RUSTSEC-2024-0017.html",
        "https://github.com/Metaswitch/cassandra-rs/commit/ae054dc8044eac9c2c7ae2b1ab154b53ca7f8df7"
      ],
      "provider_metadata": {
        "license": "CC0-1.0"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2024-27284",
        "evidence": "/aliases"
      }
    ],
    "security_relevant": true,
    "severity_evidence": null
  },
  "source_id": "core-osv",
  "document_id": 306322,
  "published_at": "2024-02-28T12:00:00+00:00"
}