CVE-2026-116816: Cpp Unvalidated Hex Parse Used As Array Index

A value parsed by std::stoi()/std::stol()/std::stoll() with base 16 is used as an array or container index without validating the parsed characters with std::isxdigit. Base-16 std::stoi() accepts a leading '-' sign and throws std::invalid_argument on non-hex characters, so attacker-controlled text shaped like "<0xXX>" but containing a sign or non-hex charact

Provally CuratedPublic repositoryHighMedium confidenceVerifiedApache-2.0C++
greprules fetch cve-2026-116816-cpp-unvalidated-hex-parse-used-as-array-index --engine opengrep

Description

A value parsed by std::stoi()/std::stol()/std::stoll() with base 16 is used as an array or container index without validating the parsed characters with std::isxdigit. Base-16 std::stoi() accepts a leading '-' sign and throws std::invalid_argument on non-hex characters, so attacker-controlled text shaped like "<0xXX>" but containing a sign or non-hex charact