fix(registry): route unsafe_install_pipeline base64 through hasBase64DecodedShell - #5603
Conversation
…DecodedShell Replace the stale bounded-window base64 regex with the shared helper so bundled flags (-di), sudo prefixes, and pipe-chain passthroughs trip the critical flag the same way curl/wget already does. Closes JSONbored#5591 Co-authored-by: Cursor <cursoragent@cursor.com>
|
Warning ⏸️ LoopOver review result - manual review recommendedReview updated: 2026-07-27 18:38:57 UTC
Review summary Nits — 3 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5603 +/- ##
=======================================
Coverage 96.42% 96.42%
=======================================
Files 529 529
Lines 16314 16321 +7
Branches 3734 3734
=======================================
+ Hits 15731 15738 +7
Misses 195 195
Partials 388 388
🚀 New features to boost your workflow:
|
Summary
base64 … | sh|bashregex insubmission-risk.jswithhasBase64DecodedShellfromcommand-safety-lib.js, sounsafe_install_pipelinecatches the same evasions the shared helper already handles for shell-safety triage.#5556curl/wget pattern: scan line-by-line and double-quoted interiors via a smallhasUnsafeBase64DecodedShellwrapper (bundled flags,sudo, pipe-chain passthroughs).command-safety-lib.jsuntouched (out of scope); curl/wget /iex/ powershell / destructive-rmbranches unchanged.Closes #5591
Submission Source
No visual impactare included when relevant.Schema and Quality Checks
viewCount,copyCount,popularityScore)Quality Evidence
Changed surface:
packages/registry/src/submission-risk.js—hasUnsafeBase64DecodedShellreplaces the stale base64 regextests/submission-risk-invariants.test.ts— fix: unsafe_install_pipeline base64-decode check is a stale regex that misses -di, sudo, and pipe-chain evasions #5591 true-positives + non-shell negativeExpected behavior / before→after flag results:
echo cGF5 | base64 -d | bashecho cGF5 | base64 --decode | shecho cGF5 | base64 -di | bashecho cGF5 | base64 -d | sudo -E bashecho cGF5 | base64 -d | cat | bashecho cGF5 | base64 -d | jq .Invariants: curl/wget,
iex,powershell -encodedcommand, and destructivermbranches ofunsafe_install_pipelineare untouched.command-safety-lib.jsis not modified.Screenshots: No visual impact — registry risk-detection correctness only; no routes/UI.
Validation
pnpm exec vitest run tests/submission-risk-invariants.test.ts— 72 passedpnpm exec vitest run tests/command-safety-lib.test.ts tests/command-safety.test.ts tests/command-safety-posix-shell.test.ts— 90 passedpnpm exec vitest run tests/non-ui-branch-matrix.test.ts— 20 passedpnpm build— passedpnpm validate:clean— passedpnpm exec prettier --checkon touched files — cleantrunk check --upstream origin/main— no issuesgit diff --check/node --check packages/registry/src/submission-risk.js— cleanNotes
hasPipeToShellInstall); this PR applies the same wiring pattern to the base64 branch.required-pr-gateauto-close before retry as fix(registry): detect bundled base64 decode flags in shell safety scan #4923), fix(web): escape compatibility-matrix CSV header client labels #5600 (CI failing → LoopOver close). This PR: two-file focused diff, one-shot commit, local trunk + build + focused tests green before open, no post-open pushes.command-safety-lib.jsleft untouched per issue out-of-scope.