Runtime cache does not enforce Project directory permissions and ownership
メンテナーはふだん 1 日以内に返信
@pheus がすでに取り組んでいます。
2026年11月6日 から。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 52/100
調査の方向性
Start by reading netbox_scripts/runtime/cache.py, especially _ensure_private_root() and materialize_revision(), then inspect the storage code used by store.write_revision(). Reproduce the reported umask and permissive-directory cases and check the Project, staging, and lock file modes and ownership. Done means new directories and lock files have private permissions, unsafe existing Project directories are rejected, and a verified published revision cannot be replaced.
索引モデルが issue の本文から書いたものです。
説明
Plugin Version
v0.0.1
NetBox Version
v4.7.1
Python Version
3.12
Steps to Reproduce
Using one account in NetBox's Django shell (python manage.py shell):
- Prepare a valid revision containing
example.pyand write it to anInMemoryStorageusingnetbox_scripts.storage.store.write_revision(). - Create a temporary cache root and set its permissions to
0755withchmod(). - Set the process umask to
0002and callnetbox_scripts.runtime.cache.materialize_revision()with that root. Restore the previous umask in afinallyblock. - Inspect
<root>/<storage_key>/and its.<digest>.lockfile. - Create a second cache root with permissions
01777. Inside it, create<storage_key>/and set its permissions to0777. - Materialize the same revision using the second root.
Expected Behavior
New Project and staging directories are created with private permissions.
Before using an existing Project directory, the plugin checks that it belongs to the NetBox account or root and rejects permissions that let other accounts modify its contents.
The published revision remains protected from replacement after verification.
Observed Behavior
In the first case, the Project directory is created with permissions 0775 and the lock file with 0664. Project and staging directory creation follows the process umask.
In the second case, materialization succeeds inside the existing 0777 Project directory.
Source inspection shows that _ensure_private_root() checks the cache root and its ancestors, but the Project directory is accepted through mkdir(exist_ok=True) without checking its owner or permissions.
When another local account can traverse the cache path, writable Project directories allow it to replace the published revision directory despite the revision's read-only permissions.
The default cache root, when created by the plugin with permissions 0700, prevents other accounts from reaching these directories. The exposure requires a cache location that other accounts can traverse.
- 主要言語
- Python
- スター
- 8
- フォーク
- 0
- 平均マージ
- 11時間 22分
- マージ済み PR(30日)
- 40
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
netbox-community/netbox-scripts のほかの issue
-
app: scripts Bucket: Improve status: backlog type: documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
netbox-community/netbox-scripts#80 ·
メンテナーはふだん 1 日以内に返信
-
app: scripts Bucket: KTLO severity: low status: backlog type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
netbox-community/netbox-scripts#76 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Raise the minimum NetBox version to v4.7.5対応中かも @pheus が 3 日前に担当しました。 オープンapp: scripts Bucket: KTLO status: backlog type: housekeeping
netbox-community/netbox-scripts#123 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
A committed run is reported as unfinished when its events cannot be queued対応中かも @pheus が 3 日前に担当しました。 オープンapp: scripts Bucket: KTLO severity: low status: accepted type: bug
netbox-community/netbox-scripts#122 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Failed post-commit callback reports committed changes as reverted and drops events対応中かも @pheus が 3 日前に担当しました。 オープンapp: scripts Bucket: KTLO severity: low status: accepted type: bug
netbox-community/netbox-scripts#121 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
netbox-community/netbox-scripts の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
bigbio/sdrf-pipelines#372 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
521xueweihan/HelloGitHub#4297 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
aws-samples/sample-per-model-bedrock#822 ·
メンテナーはふだん 1 日以内に返信
-
area:study-data p2-high ready-for-agent type:chore
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
fderuiter/deruiter.dev#3706 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
awslabs/visual-asset-management-system#1234 ·
メンテナーはふだん 1 日以内に返信