CVE-2026-6839: Cpp Signed Unsigned Overflow Check Bypass

Comparing a signed element count to an unsigned size limit (e.g., `SIZE_MAX / size`) without an explicit cast can cause improper type promotion or truncation. This allows malicious inputs to bypass integer overflow protection on certain architectures, leading to undersized memory allocations and subsequent out-of-bounds read/write accesses. Explicitly cast t

Provally CuratedPublic repositoryHighMedium confidenceVerifiedApache-2.0C++
greprules fetch cve-2026-6839-cpp-signed-unsigned-overflow-check-bypass --engine opengrep

Description

Comparing a signed element count to an unsigned size limit (e.g., `SIZE_MAX / size`) without an explicit cast can cause improper type promotion or truncation. This allows malicious inputs to bypass integer overflow protection on certain architectures, leading to undersized memory allocations and subsequent out-of-bounds read/write accesses. Explicitly cast t