Unlimited AI Credits from One Integer: New API's Quota Overflow (CVE-2026-71479) and How to Check Your Gateway
New API (QuantumNous/new-api) is a self-hosted, OpenAI-compatible LLM gateway that meters each user's spend as a 64-bit integer quota. In versions up to and including v1.0.0-rc.17, the image count n — plus video duration and token-limit fields — enters the quota math with no upper bound. A large enough value overflows the signed-64-bit charge past 2^63 and it is reinterpreted as a negative number; a negative charge is a credit. CVE-2026-71479, CWE-190/CWE-682, CVSS 9.1 (C:N/I:H/A:H — billing integrity/availability, not code execution). Reported exploited in the wild on 2026-07-06; the maintainer shipped v1.0.0-rc.18 roughly two hours later, bounding quantities (MaxImageN=128) and routing quota math through saturating conversions. We reproduced it against New API's own unmodified image: one dall-e-3 request by a $0.10 account inflated the balance to $16,893,488,147,419.20 with a matching negative-quota consumption log, and the identical request on v1.0.0-rc.18 is rejected. The exact version is readable unauthenticated from the X-New-Api-Version header and GET /api/status.