The shell snapshot is hashed, then reopened to source it

オープン
#256 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
52/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
bash, typescript
領域
cli, security

調査の方向性

Read the fork change in PR #255, especially commits 8c443d04d3 and b1c5e383c2, and trace pin_snapshot through run_setup. Reproduce the timeout-triggered rebuild and inspect how the snapshot is hashed and sourced. Done means the session executes the exact bytes that were hashed, so a file swap cannot leave snapshotChanged false.

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

説明

The fork's pin_snapshot hashes the shell snapshot, then source reopens the file by path. A writer that lands between the two during a core rebuild gets its bytes sourced under a hash that says nothing changed, so snapshotChanged stays false and the gate keeps reviewing.

rebuild (after a timeout) ─▶ hash snapshot ─▶ (writer swaps file) ─▶ source <path> ─▶ baseline taken
                                             ▲ window: the start of run_setup

Exploiting it needs a write to $TMPDIR/omp-shell-snapshots-<uid>/ racing a core rebuild, which the agent can force with a timeout. The window is the gap between two syscalls, not a review round trip.

Fix: read the snapshot bytes once and source exactly those bytes (feed them to the session as a script rather than source '<path>'), so the pin and the sourced text cannot diverge.

Found by the Opus security review of the fork change for https://github.com/STRML/omp-classifier/pull/255 (fork commits 8c443d04d3 and b1c5e383c2).

主要言語
TypeScript
スター
1
フォーク
1
平均マージ
49分
マージ済み PR(30日)
82

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

STRML/omp-classifier のほかの issue

STRML/omp-classifier の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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