Junglewise Threat Intelligence

pickem terminal escape-sequence injection via unsanitized item text

Severity: high · CVSS 8.6 · Published 2026-08-25

Executive brief

pickem is a CLI component library used to display interactive selection prompts in command-line applications. The library failed to sanitize special control characters and escape sequences from user-supplied text (such as git branch names or filenames), allowing attackers to inject terminal commands. An attacker could silently copy malicious commands into a user's clipboard, manipulate the terminal display to spoof prompts, or trigger other terminal-level attacks, potentially leading to remote code execution when the user performs a paste operation.

Technical details

pickem's rendering pipeline (affecting `select`, `search`, `checkbox`, `searchable-checkbox`, `input` prompts, the public `createFormatter` function, and row metadata) failed to strip ANSI escape sequences and C0/C1/DEL control characters from externally-supplied display text before writing to the terminal. The vulnerability class is improper neutralization of escape sequences (CWE-150). Attack vector is network (or local, depending on how the CLI application sources item text) and requires no authentication, only that a user interact with a pickem prompt containing malicious text. Attackers can achieve terminal write primitives, including OSC 52 clipboard injection (enabling arbitrary command execution via paste), cursor repositioning and screen clearing attacks (to forge UI elements or hide entries), and control-character flooding. The fix, released in version 1.0.7, adds a `sanitizeDisplay()` function that strips all escape sequences except color-only SGR sequences and removes all C0/C1/DEL bytes at the render boundary. The patch is display-only and does not affect returned values.

Affected products

  • calebogden pickem < 1.0.7

Timeline

  • 2026-06-14: disclosed: Advisory published on GitHub
  • 2026-06-14: patched: Version 1.0.7 released with sanitizeDisplay() fix
  • 2026-08-25: advisory: Advisory updated and published to GitHub Advisory Database

References