Pin Hugging Face commit revisions for AuK weight downloads and eliminate post-download SHA TOCTOU

オープン 初心者向け
#18,141 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
62/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
git, huggingface, javascript, node.js, python
領域
ai, backend, security

調査の方向性

server/services/voice/aukRuntime.js から始めます。21〜24 行目付近の AUK_WEIGHT_SOURCES には、リポジトリごとに 40 文字の 16 進数リビジョンが必要です。81〜87 行目付近の Python の snapshot_download 呼び出しでは、それを sys.argv[3] として受け取るようにしてください。次に、2 つ目の HfApi().model_info(repo).sha の参照を削除し、固定したリビジョンを portos-source.json に書き込みます。server/services/voice/aukRuntime.test.js を更新し、すべてのダウンロードが 40 文字の 16 進数リビジョンを渡し、同じ値を記録することを検証してください。テストが通り、model_info の呼び出しが残っていなければ完了です。

索引モデルが issue の本文から書いたものです。

説明

area:voice better-dependency-freedom dependencies effort:low in-progress model:medium plan planner:gemini-4-neon-high priority:2 security

Problem

server/services/voice/aukRuntime.js pins the AuK git checkout (AUK_REVISION at line 18), private uv, and hash-locked Python packages (auk-mlx at line 76), but AUK_WEIGHT_SOURCES (aukRuntime.js:21-24) omits commit revision pins for tencent/AuK-Flash and Qwen/Qwen2.5-Omni-3B. At lines 81-87 it runs snapshot_download(repo_id=repo, local_dir=str(dest)) against floating main, then makes a separate post-download HfApi().model_info(repo).sha call to stamp portos-source.json (TOCTOU mismatch risk).

Impact

New AuK setups pull unreviewed floating main model files from two external Hugging Face repositories directly into auk_mlx.convert despite locking the git repo and Python closure, and the post-download model_info call can record a different SHA than the snapshot actually downloaded.

Decided Fix

Add an immutable 40-char hex revision field to each entry in AUK_WEIGHT_SOURCES (server/services/voice/aukRuntime.js:21-24), pass it as sys.argv[3] into snapshot_download(repo_id=repo, revision=rev, local_dir=str(dest)) (aukRuntime.js:81-87), and write that exact rev directly into portos-source.json instead of making a second post-download HfApi().model_info(repo).sha query. Update server/services/voice/aukRuntime.test.js to verify the pinned revision argument.

Affected Files

  • server/services/voice/aukRuntime.js
  • server/services/voice/aukRuntime.test.js

Acceptance Criteria

  • Each entry in AUK_WEIGHT_SOURCES in server/services/voice/aukRuntime.js declares an immutable 40-char hex Hugging Face commit SHA (revision).
  • startAukSetup passes revision=sys.argv[3] directly to snapshot_download(repo_id=repo, revision=rev, local_dir=str(dest)) and writes that exact pinned revision to portos-source.json without a second post-download HfApi().model_info(repo) network call.
  • server/services/voice/aukRuntime.test.js asserts that every AuK weight download passes a 40-char hex revision to snapshot_download and records that same revision.

Origin: PortOS better-dependency-freedom baseline audit (2026-11-24) · Severity: 6/10

主要言語
JavaScript
スター
38
フォーク
32
平均マージ
20分
マージ済み PR(30日)
996

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

atomantic/PortOS のほかの issue

atomantic/PortOS の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。