CVE-2026-6409: Php Missing Negative Size Check In Buffer Read

A buffer bounds check uses `$this->bufferSize() < $SIZE` without first guarding against negative values of `$SIZE`. If `$SIZE` is derived from untrusted wire data (e.g., a protobuf varint cast to (int)), integer overflow can produce a negative value that always passes the non-negative `bufferSize()` comparison. Subsequent use of a negative size with `substr(

Provally CuratedPublic repositoryHighHigh confidenceVerifiedApache-2.0PHP
greprules fetch cve-2026-6409-php-missing-negative-size-check-in-buffer-read --engine opengrep

Description

A buffer bounds check uses `$this->bufferSize() < $SIZE` without first guarding against negative values of `$SIZE`. If `$SIZE` is derived from untrusted wire data (e.g., a protobuf varint cast to (int)), integer overflow can produce a negative value that always passes the non-negative `bufferSize()` comparison. Subsequent use of a negative size with `substr(