[Bug] Potential command injection risk in auto_assign_reviewers GitHub Actions workflow
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
調査の方向性
.github/workflows/auto_assign_reviewers.yml の確認から始め、pull_request_target イベントから中間マッピングと shell の評価に至るまで、変更されたファイルのメタデータを追跡します。ファイル名から shell コードを構築しない方法に置き換えて安全でない処理を改め、そのうえで、必要な reviewer の割り当て動作と権限を維持したまま、信頼できない pull request がコマンドをインジェクションできないことを検証します。
索引モデルが issue の本文から書いたものです。
説明
RT-Thread Version
master branch, commit 630f4fa7a37ca99af5952946eea327cf9f1df21c Affected file: .github/workflows/auto_assign_reviewers.yml
Hardware Type/Architectures
Not hardware-specific. This issue affects a GitHub Actions workflow in the repository, not a specific BSP, board, MCU, or CPU architecture.
Develop Toolchain
Other
Describe the bug
This is a security-sensitive GitHub Actions workflow issue. I am intentionally not including the full PoC payload in this public issue. I can provide the detailed validation case privately to the maintainers if needed.
Summary
The affected workflow appears to be:
.github/workflows/auto_assign_reviewers.yml
The workflow processes pull request changed-file metadata in a pull_request_target context. The changed file names are attacker-controlled input. The workflow then stores these file names in an intermediate mapping and later reconstructs shell data structures from that mapping using shell evaluation logic.
If pull request file names are not safely encoded before reaching shell evaluation, specially crafted file names may be interpreted as shell syntax. This can lead to command injection in the GitHub Actions workflow.
Current version checked
I checked the current master branch at:
630f4fa7a37ca99af5952946eea327cf9f1df21c
At this commit, the relevant workflow structure still appears to be present.
Security impact
If exploitable, an attacker who can open or update a pull request may be able to execute shell commands in the affected GitHub Actions workflow context.
This is security-relevant because the workflow runs under pull_request_target and has pull request write permission.
I did not attempt to read, print, exfiltrate, or use any token or secret. I also did not run a destructive test against the project infrastructure.
High-level technical indicators
The risky pattern appears to involve:
pull_request_targetworkflow trigger;- reading changed file names from pull request metadata;
- writing pull request file names into an intermediate mapping without sufficient encoding;
- reconstructing shell variables from that mapping using shell evaluation;
- running the workflow with
pull-requests: writepermission.
I am omitting the exact payload and reproduction filename from this public issue to avoid making the issue directly exploitable.
Suggested remediation
Possible remediation approaches:
- Avoid using shell
evalon data derived from pull request metadata. - Do not construct shell code from pull request file names.
- Treat all pull request file names as untrusted input.
- Use a safe JSON processing path, such as Python
jsonor directjqprocessing, instead of converting JSON data into shell assignments. - Safely encode or reject file names containing shell metacharacters before processing.
- Reduce permissions for jobs that process untrusted pull request metadata.
- Consider splitting the workflow into:
- a low-privilege job that computes reviewer information;
- a separate trusted job that performs pull request write operations only after consuming sanitized output.
Private details
I can provide maintainers with:
- exact source-to-sink explanation;
- affected workflow snippets;
- current commit evidence;
- non-destructive maintainer-side validation steps;
- full PoC details using a harmless marker only.
Please let me know the preferred way to share those details privately.
Other additional context
GitHub Actions workflow environment.
Relevant context:
- GitHub Actions
- pull_request_target event
- ubuntu-22.04 runner
- bash / jq based workflow scripts
- 主要言語
- C
- スター
- 12.4k
- フォーク
- 5.5k
- 平均マージ
- 3日 7時間
- マージ済み PR(30日)
- 79
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
RT-Thread/rt-thread のほかの issue
-
Arch: ARM/AArch64 Doc
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
RT-Thread/rt-thread#12082 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
RT-Thread/rt-thread#11951 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信
-
[Bug] [libc] timer_gettime 拆秒前将总纳秒截断为 uint32_t,剩余时间查询错误再び着手できるかも @Yunlk が 28 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンin progress
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
RT-Thread/rt-thread#11924 · コメント 7 件 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
[Bug] dfs_v2 tmpfs: ftruncate(fd, 0) frees the file buffer but reports success — use-after-free read/write and double free from a legal POSIX call対応中かも @remukisama が 33 日前に担当しました。 オープンin progress
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
RT-Thread/rt-thread#11902 · コメント 4 件 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
[bsp][stm32][bluepill] README「快速上手」缺少重新生成 MDK 工程这一步,按文档操作无法编译通过再び着手できるかも @moment-NEW が 50 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンin progress
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
RT-Thread/rt-thread#11818 · コメント 4 件 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
RT-Thread/rt-thread の issue をすべて見る
似ている issue
-
Builder: a structure opened without calculation data shows the Diffraction (fibre) view by defaultオープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
FriendsofECCE/ECCE#1245 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
apache/nuttx-apps#4108 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
VirtualBox/virtualbox#996 ·
メンテナーはふだん 6 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
trezor/trezor-firmware#8357 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信