Katalog CWE

CWE-130 · Słabość

Improper Handling of Length Parameter Inconsistency

Abstrakcja
Bazowa
Status
Niekompletny
Dodano
19 lipca 2006
Ostatnia zmiana
11 grudnia 2025

Podatności CVE z tą słabościąPełny wpis na cwe.mitre.org ↗

Opis

The product parses a formatted message or structure, but it does not handle or incorrectly handles a length field that is inconsistent with the actual length of the associated data.

If an attacker can manipulate the length parameter associated with an input such that it is inconsistent with the actual length of the input, this can be leveraged to cause the target application to behave in unexpected, and possibly, malicious ways. One of the possible motives for doing so is to pass in arbitrarily large input to the application. Another possible motivation is the modification of application state by including invalid data for subsequent properties of the application. Such weaknesses commonly lead to attacks such as buffer overflows and execution of arbitrary code.

Inne nazwy

length manipulation
length tampering

Skutki

  • Confidentiality, Integrity

    Read Memory; Modify Memory; Varies by Context

Zapobieganie

  • Implementation

    When processing structured incoming data containing a size field followed by raw data, ensure that you identify and resolve any inconsistencies between the size field and the actual size of the data.

  • Implementation

    Do not let the user control the size of the buffer.

  • Implementation

    Validate that the length of the user-supplied data is consistent with the buffer size.

Przykłady podatności

Słabość nadrzędna

Może prowadzić do

Kiedy powstaje

Dotyczy

C, C++, Not Language-Specific, Not Technology-Specific

Uwagi

This probably overlaps other categories including zero-length issues.

Wpis z katalogu CWE 4.20.