You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
E2 shell arm matches one env | grep spelling: a second grep flag, quotes, or egrep all evade "Env Variable Harvesting" #482
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 with uv tool install git+https://github.com/NVIDIA/skillspector.git
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.
(?:-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.
Implementation is in progress in PR #483, covering grep flags, quoting, and egrep variants in shell environment-harvesting detection. Keeping this issue open until the PR merges and the evasion/control matrix passes on main.
Activity
rng1995 commentedon Sep 16, 2026
Implementation is in progress in PR #483, covering grep flags, quoting, and egrep variants in shell environment-harvesting detection. Keeping this issue open until the PR merges and the evasion/control matrix passes on
main.rng1995 commentedon Oct 4, 2026
PR-state snapshot checked on 2026-10-04:
Keeping this issue open: the relevant implementation is not merged. Check/review status is a point-in-time snapshot, not a claim of merge readiness.