← Back to CVE Explorer

CVE-2025-64076

Full vulnerability record from the local CVENow database.

Description

Multiple vulnerabilities exist in cbor2 through version 5.7.0 in the decode_definite_long_string() function of the C extension decoder (source/decoder.c): (1) Integer Underflow Leading to Out-of-Bounds Read (CWE-191, CWE-125): An incorrect variable reference and missing state reset in the chunk processing loop causes buffer_length to not be reset to zero after UTF-8 character consumption. This results in subsequent chunk_length calculations producing negative values (e.g., chunk_length = 65536 - buffer_length), which are passed as signed integers to the read() method, potentially triggering unlimited read operations and resource exhaustion. (2) Memory Leak via Missing Reference Count Release (CWE-401): The main processing loop fails to release Python object references (Py_DECREF) for chunk objects allocated in each iteration. For CBOR strings longer than 65536 bytes, this causes cumulative memory leaks proportional to the payload size, enabling memory exhaustion attacks through repeated processing of large CBOR payloads. Both vulnerabilities can be exploited remotely without authentication by sending specially-crafted CBOR data containing definite-length text strings with multi-byte UTF-8 characters positioned at 65536-byte chunk boundaries. Successful exploitation results in denial of service through process crashes (CBORDecodeEOF exceptions) or memory exhaustion. The vulnerabilities affect all applications using cbor2's C extension to process untrusted CBOR data, including web APIs, IoT data collectors, and message queue processors. Fixed in commit 851473490281f82d82560b2368284ef33cf6e8f9 pushed with released version 5.7.1.

Severity
HIGH
CVSS score
7.5 (v3.1)
Vulnerability status
Analyzed
Source identifier
Published
2025-11-18 18:16:14.263000
Last modified
2026-11-05 14:10:00.273000
View original CVE JSON
{
  "id": "CVE-2025-64076",
  "sourceIdentifier": "[email protected]",
  "published": "2025-11-18T18:16:14.263",
  "lastModified": "2026-11-05T14:10:00.273",
  "vulnStatus": "Analyzed",
  "cveTags": [],
  "descriptions": [
    {
      "lang": "en",
      "value": "Multiple vulnerabilities exist in cbor2 through version 5.7.0 in the decode_definite_long_string() function of the C extension decoder (source/decoder.c): (1) Integer Underflow Leading to Out-of-Bounds Read (CWE-191, CWE-125): An incorrect variable reference and missing state reset in the chunk processing loop causes buffer_length to not be reset to zero after UTF-8 character consumption. This results in subsequent chunk_length calculations producing negative values (e.g., chunk_length = 65536 - buffer_length), which are passed as signed integers to the read() method, potentially triggering unlimited read operations and resource exhaustion. (2) Memory Leak via Missing Reference Count Release (CWE-401): The main processing loop fails to release Python object references (Py_DECREF) for chunk objects allocated in each iteration. For CBOR strings longer than 65536 bytes, this causes cumulative memory leaks proportional to the payload size, enabling memory exhaustion attacks through repeated processing of large CBOR payloads. Both vulnerabilities can be exploited remotely without authentication by sending specially-crafted CBOR data containing definite-length text strings with multi-byte UTF-8 characters positioned at 65536-byte chunk boundaries. Successful exploitation results in denial of service through process crashes (CBORDecodeEOF exceptions) or memory exhaustion. The vulnerabilities affect all applications using cbor2's C extension to process untrusted CBOR data, including web APIs, IoT data collectors, and message queue processors. Fixed in commit 851473490281f82d82560b2368284ef33cf6e8f9 pushed with released version 5.7.1."
    },
    {
      "lang": "es",
      "value": "Múltiples vulnerabilidades existen en cbor2 hasta la versión 5.7.0 en la función decode_definite_long_string() del decodificador de la extensión C (source/decoder.c): (1) Desbordamiento negativo de enteros (Integer Underflow) que conduce a lectura fuera de límites (Out-of-Bounds Read) (CWE-191, CWE-125): Una referencia de variable incorrecta y una falta de reinicio de estado en el bucle de procesamiento de fragmentos hacen que buffer_length no se reinicie a cero después del consumo de caracteres UTF-8. Esto resulta en que los cálculos subsiguientes de chunk_length produzcan valores negativos (p. ej., chunk_length = 65536 - buffer_length), los cuales se pasan como enteros con signo al método read(), lo que podría desencadenar operaciones de lectura ilimitadas y agotamiento de recursos. (2) Fuga de memoria por falta de liberación del contador de referencias (Memory Leak via Missing Reference Count Release) (CWE-401): El bucle de procesamiento principal no libera referencias de objetos Python (Py_DECREF) para los objetos de fragmento asignados en cada iteración. Para cadenas CBOR de más de 65536 bytes, esto causa fugas de memoria acumulativas proporcionales al tamaño de la carga útil, lo que permite ataques de agotamiento de memoria mediante el procesamiento repetido de grandes cargas útiles CBOR. Ambas vulnerabilidades pueden ser explotadas remotamente sin autenticación enviando datos CBOR especialmente diseñados que contengan cadenas de texto de longitud definida con caracteres UTF-8 multibyte posicionados en los límites de fragmentos de 65536 bytes. La explotación exitosa resulta en denegación de servicio a través de fallos de proceso (excepciones CBORDecodeEOF) o agotamiento de memoria. Las vulnerabilidades afectan a todas las aplicaciones que utilizan la extensión C de cbor2 para procesar datos CBOR no confiables, incluyendo APIs web, recolectores de datos IoT y procesadores de colas de mensajes. Corregido en el commit 851473490281f82d82560b2368284ef33cf6e8f9 publicado con la versión 5.7.1."
    }
  ],
  "affected": [
    {
      "source": "[email protected]",
      "affectedData": [
        {
          "vendor": "n/a",
          "product": "n/a",
          "versions": [
            {
              "version": "n/a",
              "status": "affected"
            }
          ]
        }
      ]
    }
  ],
  "metrics": {
    "cvssMetricV31": [
      {
        "source": "[email protected]",
        "type": "Secondary",
        "cvssData": {
          "version": "3.1",
          "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
          "baseScore": 7.5,
          "baseSeverity": "HIGH",
          "attackVector": "NETWORK",
          "attackComplexity": "LOW",
          "privilegesRequired": "NONE",
          "userInteraction": "NONE",
          "scope": "UNCHANGED",
          "confidentialityImpact": "NONE",
          "integrityImpact": "NONE",
          "availabilityImpact": "HIGH"
        },
        "exploitabilityScore": 3.9,
        "impactScore": 3.6
      }
    ],
    "ssvcV203": [
      {
        "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
        "ssvcData": {
          "timestamp": "2025-11-19T13:54:52.352278Z",
          "id": "CVE-2025-64076",
          "options": [
            {
              "exploitation": "poc"
            },
            {
              "automatable": "no"
            },
            {
              "technicalImpact": "partial"
            }
          ],
          "role": "CISA Coordinator",
          "version": "2.0.3"
        }
      }
    ]
  },
  "weaknesses": [
    {
      "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
      "type": "Secondary",
      "description": [
        {
          "lang": "en",
          "value": "CWE-191"
        }
      ]
    }
  ],
  "configurations": [
    {
      "nodes": [
        {
          "operator": "OR",
          "negate": false,
          "cpeMatch": [
            {
              "vulnerable": true,
              "criteria": "cpe:2.3:a:agronholm:cbor2:*:*:*:*:*:python:*:*",
              "versionEndIncluding": "5.7.0",
              "matchCriteriaId": "AE04A1BB-A030-4607-9B76-8CFEC625F070"
            }
          ]
        }
      ]
    }
  ],
  "references": [
    {
      "url": "https://github.com/agronholm/cbor2/commit/851473490281f82d82560b2368284ef33cf6e8f9",
      "source": "[email protected]",
      "tags": [
        "Patch"
      ]
    },
    {
      "url": "https://github.com/agronholm/cbor2/issues/264",
      "source": "[email protected]",
      "tags": [
        "Exploit",
        "Issue Tracking"
      ]
    },
    {
      "url": "https://github.com/agronholm/cbor2/pull/265",
      "source": "[email protected]",
      "tags": [
        "Exploit",
        "Issue Tracking",
        "Patch"
      ]
    }
  ]
}