Executive brief
Gravity is a programming language runtime that includes a JSON parser for deserializing data. An integer overflow vulnerability in the JSON parser allows remote attackers to cause a denial of service (SIGILL crash) or data corruption by providing JSON input with excessively long digit sequences in numeric literals.
Technical details
The vulnerability is a signed 64-bit integer overflow (CWE-190) in the vendored udp json-parser component, specifically in the json_parse_ex function within src/utils/gravity_json.c at line 1126. The parser accumulates integer values digit-by-digit using the formula (accumulator * 10) + digit_value, which overflows when processing JSON integers with more than 19 significant decimal digits. The same unchecked pattern exists in the exponent accumulator. The integer overflow is undefined behavior in C and triggers SIGILL in sanitized builds, while non-sanitized builds may silently store corrupted values. Attack vectors include direct calls to json_parse() API and indirect calls through gravity_vm_loadbuffer() when deserializing untrusted compiled bytecode. The vulnerability was patched in version 0.9.8 (commit 9b337c3eae5833c3956bed1fc01c21c14fd443f2).
Affected products
- marcobambini Gravity up to 0.9.7
Timeline
- 2026-08-04: disclosed: Issue #447 opened on GitHub
- 2026-09-14: patched: Version 0.9.8 released with fix (commit 9b337c3eae5833c3956bed1fc01c21c14fd443f2)
- 2026-09-14: advisory: CVE-2026-90715 published