pyk: arbitrary Python module import from untrusted `kbuild.toml`
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 15/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 活発
- 技術スタック
- python
- 領域
- build-system, security
調査の方向性
Start at Source.from_dict in pyk/src/pyk/kbuild/project.py (around line 27), which builds PackageSource from the [dependencies] table, then read PackageSource.resolve (around line 49), which calls importlib.resources.files on the package name. Done means the untrusted package string is validated or restricted to installed or locked distributions, with tests covering a malicious kbuild.toml. The suggested fix also touches the _NODES/_PROOF_TYPES allow-lists, which needs maintainer input.
索引モデルが issue の本文から書いたものです。
説明
Summary
PackageSource.resolve imports a Python package named by an untrusted kbuild.toml (kbuild.toml is data fetched/build-time config from the project being processed), giving arbitrary code execution in the pyk process when resolving that package.
1 finding(s) (1 LOW) — line-anchor verified at commit 4a46d1231473.
Findings
| Severity | ID | Location | Summary |
|---|---|---|---|
| LOW | pyk-tools-004 |
pyk/src/pyk/kbuild/project.py:49 |
PackageSource.resolve imports an arbitrary Python module from untrusted kbuild.toml |
Details
pyk-tools-004 — `PackageSource.resolve` imports an arbitrary Python module from untrusted `kbuild.toml` (pyk/src/pyk/kbuild/project.py:49)
Trigger (as reviewed): Source.from_dict (pyk/src/pyk/kbuild/project.py:27) builds PackageSource(dct['package']) from the [dependencies] table of a kbuild.toml with no allow-list or format validation. importlib.resources.files(name) imports the named module (and can import submodules) to locate it, executing its top-level code.
Impact (as reviewed): Cloning an untrusted K project and running kbuild kompile / kbuild which (or any pyk caller of Project.load) triggers import of an attacker-chosen module name, giving arbitrary code execution under the caller's privileges via import side effects. The dependency 'package' is treated as a plain string but is actually an import directive.
Deep review: reachability=REACHABLE-FROM-UNTRUSTED; exploitability=EXPLOITABLE; red-team=VERIFIABLE-UNKNOWN.
Suggested fix
Enforce the declared _NODES/_PROOF_TYPES allow-lists before globals()/locals() dispatch, restrict PackageSource.resolve to installed/locked distributions, and shlex-quote generated bug-report scripts.
From a static audit of this repository at commit 4a46d1231473b599c699160132fd6e76a5c46406 (master). Every location above was verified against the source at that revision; no exploit code was run against this repository or its infrastructure.
- 主要言語
- Python
- スター
- 605
- フォーク
- 165
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
runtimeverification/k のほかの issue
-
難易度 4/5 1週間以上 初心者へのやさしさ 15/100
runtimeverification/k#4973 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 15/100
runtimeverification/k#4972 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 22/100
runtimeverification/k#4971 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 15/100
runtimeverification/k#4970 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 18/100
runtimeverification/k#4968 ·
runtimeverification/k の issue をすべて見る
似ている issue
-
[BUG]: Compliance rules never see Unity Catalog views as views対応中かも @wagnercsantos が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
databrickslabs/ontos#1348 ·
メンテナーはふだん 3 日以内に返信
-
`forum_pr_poster` action will always return `none` when checking for pre-existing feedback threads, even if a feedback thread already exists.対応中かも @pgmzeta が今日担当しました。 オープンE-Verified P-Major
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
goonstation/goonstation#28259 ·
メンテナーはふだん 2 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
woonstadrotterdam/monumenten#70 ·
メンテナーはふだん 15 日以内に返信
-
binding:python bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
The Browser tab fails with a Wayland error when Open Terminal runs from a Wayland desktop sessionオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
open-webui/open-terminal#210 ·