CVE-2024-40427: Px4 Unbounded Struct Write

A structure length field is used in a write() operation alongside its expected data buffer without checking if the length is bounded by the buffer's true size. Doing so allows an attacker to control the struct fields and write out-of-bounds stack memory, causing a buffer overflow (CWE-120/CWE-121). Verify that the length field is checked against the maximum

Provally CuratedPublic repositoryHighMedium confidenceVerifiedApache-2.0C++
greprules fetch cve-2024-40427-px4-unbounded-struct-write --engine opengrep

Description

A structure length field is used in a write() operation alongside its expected data buffer without checking if the length is bounded by the buffer's true size. Doing so allows an attacker to control the struct fields and write out-of-bounds stack memory, causing a buffer overflow (CWE-120/CWE-121). Verify that the length field is checked against the maximum