E2 shell arm matches one `env | grep` spelling: a second grep flag, quotes, or egrep all evade "Env Variable Harvesting"
メンテナーはふだん 4 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 半日
- 初心者へのやさしさ
- 78/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 領域
- security, testing-qa
調査の方向性
src/skillspector/nodes/analyzers/static_patterns_data_exfiltration.py:73 から始め、次に tests/unit/test_patterns.py の 150-255 行付近にある E2 ケースを確認します。再現手順で説明されている shell の表記と除外条件のカバレッジを追加し、必要に応じて用意されている fixture を使用します。対応している env/printenv のフィルタリング形式が E2 を発生させ、PATH と負のフィルターの例が発生させないことが完了の条件です。
索引モデルが issue の本文から書いたものです。
説明
Summary
Rule E2 (Data Exfiltration / Env Variable Harvesting) has a shell arm for env | grep, but it accepts exactly one flag (-i) followed by a bare keyword. A second flag, combined flags, a quoted pattern, or egrep all evade it. The README defines E2 as "enumerating, copying, or searching environment data to collect secrets"; the missed spellings are the searching case.
#329 and #441 cover the Python os.environ path. This is the shell path and is independent of both.
Environment
- SkillSpector v2.11.0 (commit
7805bb9), installed withuv tool install git+https://github.com/NVIDIA/skillspector.git skillspector scan <dir> --no-llm --format json(static-only, deterministic)- macOS 15 (Darwin 25.6.0), Python 3.13 runtime
Reproduction
One SKILL.md with one fenced bash block. Only the marked line varies between runs.
| spelling | E2 fires |
|---|---|
env | grep secret |
yes, 0.8 |
env | grep -i -E 'token|key|secret' > /tmp/ctx.txt |
no |
env | grep -iE "aws_|secret" |
no |
env | grep --ignore-case token |
no |
env | egrep -e password -e token |
no |
printenv | grep -i secret |
yes, but only because the line contains the substring env | grep -i secret |
The second row is the shape a harvester would write: case-insensitive, alternation over several names, redirected to a file for a later upload. In a skill that goes on to POST that file, the scan reports E1, E3, PE3 and SC2 on the surrounding lines and nothing on the harvest line itself.
Cause
src/skillspector/nodes/analyzers/static_patterns_data_exfiltration.py:73:
(r"env\s*\|\s*grep\s+(?:-i\s+)?(?:key|secret|token|password)", 0.8),
(?:-i\s+)? consumes one -i and nothing else, and the keyword has to follow as a bare word, so a quote or a second flag ends the match. Nothing in tests/unit/test_patterns.py pins a shell spelling; the E2 cases there (lines 150-255) are all Python.
Expected behavior
The shell arm should key on the behavior (the environment piped through a filter for secret-looking names) rather than on one flag layout: env or printenv as the source, grep, egrep or fgrep as the filter, any flags, optional quoting, and the keyword anywhere in the pattern argument. env | grep PATH and env | grep -v SECRET should still pass.
I have a fix with tests and a fixture ready to open against this issue.
- 主要言語
- Python
- スター
- 23.2k
- フォーク
- 2k
- 平均マージ
- 5日 9時間
- マージ済み PR(30日)
- 121
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
NVIDIA/SkillSpector のほかの issue
-
TM1 flags the HTTP verb DELETE in REST route tables despite the pattern comment saying it avoids them対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
NVIDIA/SkillSpector#832 ·
メンテナーはふだん 4 日以内に返信
-
RP1 `npx` pattern matches across line breaks, so a line ending in "npx" plus the next word becomes a command対応中かも @agentsope が 33 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
NVIDIA/SkillSpector#639 · コメント 2 件 ·
メンテナーはふだん 4 日以内に返信
-
Quoted version metadata creates a false missing-file reference and changes score 0 from SAFE to CAUTION対応中かも @goodhee が 49 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
NVIDIA/SkillSpector#524 · コメント 2 件 ·
メンテナーはふだん 4 日以内に返信
-
compare_scan_accuracy: editable-dependency file:// URL resolves to "C:\C:\..." on Windows対応中かも @mohgupta-ship-it が 53 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
NVIDIA/SkillSpector#485 · コメント 4 件 ·
メンテナーはふだん 4 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
NVIDIA/SkillSpector#444 · コメント 2 件 ·
メンテナーはふだん 4 日以内に返信
NVIDIA/SkillSpector の issue をすべて見る
似ている issue
-
priority middle
難易度 1/5 1時間未満 初心者へのやさしさ 62/100
KATO-Hiro/AtCoderClans#12940 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 76/100
huggingface/huggingface_hub#5283 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 1/5 1時間未満 初心者へのやさしさ 86/100
メンテナーはふだん 1 日以内に返信
-
bug example
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
メンテナーはふだん 1 日以内に返信