Skip to main content

CVE-2026-71479 — New API: Integer overflow in QuantumNous/new-api

CRITICAL

New API: Integer overflow in quota billing yields negative charges (self-crediting)

Published August 17, 2026Updated August 18, 2026Source: OSV

What Should I Do?

Address in Next Maintenance Window

Low exploitation probability (0.65%). Schedule for your next planned update.

Does your project use an affected github.com/QuantumNous/new-api version?

Paste your go.sum to check it for CVE-2026-71479 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.

Check my go.sum

Summary

Summary

Multiple billing paths multiplied user-controlled quantity parameters into the quota calculation without an upper bound or overflow-safe integer conversion. A crafted extreme value (e.g. image n = 18446744073686646784, a wrapped-negative accepted by a *uint field) makes conversions like int(float64(quota) * n) wrap past the int64/int32 range into a large negative quota. The negative quota takes effect at settlement (not at pre-consume), where it is equivalent to crediting the user's balance — turning a small positive balance into an enormous one.

Timeline(UTC+8)

This vulnerability was confirmed exploited in the wild. Response timeline (UTC+8):

  • 2026-07-06 23:00 — Community user @lihui12388 reported that their deployment had been exploited via this vulnerability (large negative consumption entries in logs and abnormally inflated balances). We confirmed in-the-wild exploitation and started an emergency response immediately.
  • 2026-07-07 01:17 — Emergency fix released as v1.0.0-rc.18, roughly 2 hours after the report.
  • 2026-07-07 (next day) — Given the confirmed active exploitation, we publicly disclosed the vulnerability and the fixed version to the community the following day so that all operators could upgrade and audit promptly.
  • 2026-07-07 13:19 — v1.0.0-rc.19 released with additional observability (quota-saturation warning logs) to help operators audit and monitor abuse.

Preconditions

This is not a zero-balance freebie. The attacker must hold an account whose wallet balance is > 0 and at least covers the request's normal (un-inflated) pre-consume amount — the pre-consume gate rejects userQuota <= 0 and insufficient balance with HTTP 403. Quantity multipliers (n, duration, ...) are not applied at pre-consume; the overflow only manifests at settlement, flipping the charge negative and crediting the balance.

Severity escalates when the deployment enables any feature that grants free starting balance, because the required positive balance is then obtained at zero cost and at scale: check-in rewards (CheckinSetting.Enabled), invite rebates (QuotaForInviter / QuotaForInvitee), or new-user quota gifts (QuotaForNewUser). With self-registration on by default and any of these enabled, an attacker can register (or mass-register) to obtain seed balance for free, then inflate it via a single crafted request — effectively unauthenticated exploitation.

Impact

A low-privilege user with a positive balance can massively inflate their own balance with a single crafted request (negative settlement = credit), violating billing integrity. Sustained abuse can drain the operator's prepaid upstream funds and render billing/service unavailable. Exploitation in the wild has been confirmed (see Timeline above).

Root cause

Single root cause: user-controlled multipliers lacked upper-bound validation before entering quota math, and the float/decimal-to-int conversions lacked saturation. Because *uint accepts huge positive values (a wrapped negative), a >= 0 check is insufficient — an explicit upper bound is required.

Fix

Fixed via defense-in-depth: (1) upper-bound validation at request ingress (400 on violation), (2) local clamping of the same quantities on validation-bypass paths (passthrough/metadata/multipart), and (3) centralized saturating conversions in common/quota_math.go that clamp to int32 and never wrap. Saturation events are additionally audited on the related consume/task log under admin_info.quota_saturation (admin-only) and via request-correlated backend warnings.

Advisory Timeline

  • First published August 17, 2026 (101 days ago).
  • Last revised August 18, 2026 — 1 day after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Go
Update github.com/QuantumNous/new-api to 1.0.0-rc.18 or later
go get github.com/QuantumNous/new-api@v1.0.0-rc.18

After upgrading, scan your dependencies again to confirm the vulnerability is resolved.

Affected Packages (1)

Affects 1 ecosystem: Go (1).

PackageFixed In
github.com/QuantumNous/new-api Go · Affected: All versions1.0.0-rc.18

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 9.1 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
High
Availability
High

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H

Frequently Asked Questions

What is CVE-2026-71479?
New API: Integer overflow in quota billing yields negative charges (self-crediting). This vulnerability has been assigned a severity rating of CRITICAL (CVSS score: 9.1/10).
How do I check if my project is affected by CVE-2026-71479?
CVE-2026-71479 affects github.com/QuantumNous/new-api. It has a 0.6% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-71479 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
9.1

Maximum impact if exploited, often with little effort or access required.

EPSS Score (30-day exploit probability)
0.65%
EPSS percentile: 45.6

This is a below-median EPSS score — only 45.6% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.

Also Known As

GHSA-8r8v-xf7q-rcpr
GO-2026-6242

Related CVEs

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my go.sum