Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Security: predictable /tmp/nc_exit_status in postdetails - symlink clobber and TOCTOU

クローズ 初心者向け
#4,956 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

関連するプルリクエストがすでにマージされています。

  • #5035 @dgibbs64 による — マージ済み

評価

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

調査の方向性

lgsm/modules/command_postdetails.sh の 63-65 行目付近から始め、termbin.com を呼び出し、/tmp/nc_exit_status に書き込み、それを読み戻すコマンドグループを調べてください。./gameserver pd を実行し、終了ステータスの処理が、予測可能な共有一時パスや書き込み/読み取りの競合状態に依存しなくなっていることを確認してください。

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

説明

Security report (responsible disclosure)

Predictable /tmp/nc_exit_status file in postdetails — symlink clobber + write/read race

Affected: lgsm/modules/command_postdetails.sh:63-65

	nc -w 10 termbin.com 9999
	echo $? > /tmp/nc_exit_status
} | tr -d '\n\0')
nc_exit_status=$(cat /tmp/nc_exit_status)

Two problems:

  1. Fixed world-writable path with no mktemp/O_EXCL/noclobber: a local attacker pre-creates /tmp/nc_exit_status as a symlink to a victim-owned file (e.g. ~/.bashrc). Next time the victim runs ./gameserver pd, the redirect truncates the target with 0\n — arbitrary file clobber as the victim user (CWE-59/CWE-377).
  2. TOCTOU between write and read: an attacker can swap the file contents between line 63 and line 65 to corrupt the status logic; the file is also shared across concurrent LGSM instances.
Suggested fix

Drop the temp file entirely:

nc -w 10 termbin.com 9999
nc_exit_status=$?

…inside the same command group, or use mktemp under ${tmpdir} if the split is required.

Fix

Implemented in PR #5035: https://github.com/GameServerManagers/LinuxGSM/pull/5035 (merged into develop for v26.4.0).

主要言語
Shell
スター
4.9k
フォーク
870
平均マージ
22時間 21分
マージ済み PR(30日)
93

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

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

GameServerManagers/LinuxGSM のほかの issue

GameServerManagers/LinuxGSM の issue をすべて見る

似ている issue

Shell/Bash の issue をもっと見る

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

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