BaseIncomplete

CWE-130Improper Handling of Length Parameter Inconsistency

Category: other

Description

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.

Common consequences· 1

  • Confidentiality / Integrity — Read Memory, Modify Memory, Varies by Context

Potential mitigations· 3

  • [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.

Related CAPEC attack patterns· 1

CAPEC-47

References

  1. https://cwe.mitre.org/data/definitions/130.html

Exploits (incoming)1

TypeTargetConfidenceTier
AttackPatternBuffer Overflow via Parameter Expansioncapec-47100%live

(incoming)9

TypeTargetConfidenceTier
VulnerabilityMongoDB and MongoDB Server Improper Handling of Length Parameter Inconsistency Vulnerabilitycve-2025-148470%live
VulnerabilityCVE-2026-22046cve-2026-220460%live
VulnerabilityCVE-2026-22047cve-2026-220470%live
VulnerabilityCVE-2026-22255cve-2026-222550%live
VulnerabilityCVE-2026-22861cve-2026-228610%live
VulnerabilityCVE-2026-35547cve-2026-355470%live
VulnerabilityCVE-2026-41898cve-2026-418980%live
VulnerabilityCVE-2026-5367cve-2026-53670%live
KEVEntryMongoDB and MongoDB Server Improper Handling of Length Parameter Inconsistency Vulnerabilitykev-cve-2025-148470%live

Related by meaning· 6

Nearest entities by semantic similarity across the cs-graph corpus.

CWE
Buffer Access with Incorrect Length Value
CWE
Incorrect Calculation of Buffer Size
CWE
Integer Overflow to Buffer Overflow
CWE
Improper Neutralization
CWE
Buffer Access Using Size of Source Buffer
CWE
Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')
Sourced from MITRE CWE 4.20. Curated for EU compliance use cases by Adam Lundqvist, Founder at SQUR.