Catégories
CVE-2026-64865

Vulnérabilité dans github.com/QuantumNous/new-api (CVE-2026-64865)

Résumé

Vulnérabilité dans github.com/QuantumNous/new-api (CVE-2026-64865). Risque d'opérations non autorisées ou de divulgation. Exploitable via PUT /api/user/self. Atténuation : mise à jour vers 1.0.0-rc.16 ou plus.

Description d'origine

La description telle que publiée par la source (souvent en anglais).

Summary

Authenticated users can repeatedly call PUT /api/user/self with language or sidebar_modules while relay requests are consuming quota. The settings path reads a full User snapshot and writes it back through User.Update(), which refreshes Redis with RedisHSetObj and overwrites the Quota field. This can erase concurrent HINCRBY quota deductions and keep cached balance artificially high, allowing calls far beyond the paid quota.

Impact

A low-privileged authenticated user may bypass quota enforcement and cause financial loss to operators. Authentication and pre-consumption use cached quota, while DB/log usage can continue increasing.

Affected Components

  • controller/user.go: UpdateSelf language/sidebar_modules branches
  • model/user.go: User.Update / UpdateWithTx full snapshot update
  • model/user_cache.go: updateUserCache RedisHSetObj full hash write
  • model/user.go: GetUserQuota reads Redis cache first

Root Cause

Normal billing uses Redis HINCRBY on user:.Quota, while settings updates use a stale full user snapshot to HSET the entire cache hash, including Quota. These two writers race on the same Redis field.

Patches

This issue is fixed in v1.0.0-rc.16. The fix makes user setting updates field-scoped, prevents stale user snapshots from overwriting accounting fields, and keeps generic user cache refreshes from modifying Quota. Quota cache updates are reserved for atomic quota delta paths or explicit quota synchronization paths.

Workarounds

If up…

Source: GitHub Security Advisories (Global) NVD GitHub Advisory

Résumé généré automatiquement

Assemblé par SecPulse à partir des données sources (CVSS, CWE, versions affectées) à l'aide de modèles, sans IA. Vérifiez la description d'origine et les références ci-dessous.

Une vulnérabilité référencée CVE-2026-64865 a été découverte dans github.com/QuantumNous/new-api.
Des attaquants peuvent cibler un point d'entrée spécifique comme PUT /api/user/self à distance pour détourner le produit.
Risque d'opérations non autorisées ou de divulgation.
Action : mettez à jour github.com/QuantumNous/new-api vers 1.0.0-rc.16 ou supérieur.
En cas de doute, contactez votre service informatique ou cherchez « github.com/QuantumNous/new-api CVE-2026-64865 » sur le site de l'éditeur.

CVE-2026-64865 (github.com/QuantumNous/new-api) — CWE-362
Surface d'attaque : PUT /api/user/self
Correctif : 1.0.0-rc.16 — appliquer immédiatement
Contournement : If upgrading immediately is not possible, operators should temporarily restrict or rate-limit PUT /api/user/self and avoid allowing frequent user setting updates while Redis-backed quota cache is enabled.
Plan : 1) Audit SBOM, 2) Mise à jour staging→prod, 3) Surveillance WAF/proxy sur les endpoints affectés, 4) Recherche d'IOC dans les logs.
Réfs : voir GHSA / avis éditeur / version corrigée liés sur cette page.

❓ Quel est le problème

Une vulnérabilité (CWE-362) affecte github.com/QuantumNous/new-api. Les attaquants atteignent le code vulnérable via PUT /api/user/self.

📍 Périmètre concerné

Consultez l'avis de l'éditeur pour les versions affectées de github.com/QuantumNous/new-api. Surface d'attaque : PUT /api/user/self.

🔥 Gravité

Gravité : ?. Risque d'opérations non autorisées ou de divulgation.

🔧 Comment corriger

Mettre à jour vers 1.0.0-rc.16.

🛡️ Contournement

Contournement : If upgrading immediately is not possible, operators should temporarily restrict or rate-limit PUT /api/user/self and avoid allowing frequent user setting updates while Redis-backed quota cache is enabled.

🔍 Détection

Recherchez dans les logs webserver/proxy/WAF des requêtes anormales vers PUT /api/user/self (en-têtes d'auth malformés, méta-caractères SQL). Auditez les fichiers de dépendances pour trouver github.com/QuantumNous/new-api.

Actions de réponse

Étapes concrètes et exemples de commandes que les équipes SOC/SRE doivent exécuter dans l'ordre

  1. 1
    Identify exposure identify
    grep -r 'github.com/QuantumNous/new-api' . | grep -v node_modules

    リポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で github.com/QuantumNous/new-api を grep し、稼働しているサービス・バージョンを把握する。

  2. 2
    Hunt for indicators of compromise detect
    grep 'PUT /api/user/self' /var/log/nginx/access.log | grep -E '(unusual_payload|sqli_pattern)'

    アクセスログで PUT /api/user/self への異常なリクエスト (不正な認証ヘッダ・SQLメタ文字)を過去 30〜90日分捜索。WAF/SIEM があれば該当パスのアラート発火履歴を確認。

  3. 3
    Apply temporary workaround mitigate
    If upgrading immediately is not possible, operators should temporarily restrict or rate-limit PUT /api/user/self and avoid allowing frequent user setting updates while Redis-backed quota cache is enabled.

    パッチが適用されるまでの応急処置として、If upgrading immediately is not possible, operators should temporarily restrict or rate-limit PUT /api/user/self and avoid allowing frequent user setting updates while Redis-backed quota cache is enabled. を実施。回避策の副作用 (機能低下) を確認した上で。

  4. 4
    Apply patch patch
    Upgrade github.com/QuantumNous/new-api to 1.0.0-rc.16

    ステージング環境で 1.0.0-rc.16 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスと、Step 2 で見つけた異常検知の続報チェックを含めること。

  5. 5
    Post-deployment verification verify
    Replay attack against PUT /api/user/self on staging to confirm patch closes the vector

    パッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番では Step 2 と同じログクエリでアラート再発が無いか継続監視。

Paquets affectés

go github.com/QuantumNous/new-api
[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"1.0.0-rc.16"}]}]

Références

Nous utilisons des cookies pour l'analyse d'audience et la mesure publicitaire. Ce réglage s'applique à tous les sites de Game co., Ltd. En savoir plus