Workspace confirmation emits the raw working directory to the terminal #82
Labels
No labels
bug
cannot reproduce
duplicate
enhancement
help wanted
invalid
need info
need triage
need verification
not a bug
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
claudiomaradonna/azkaban#82
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
bin/azkabanbuilds the default-workspace confirmation with the rawworking directory (
bin/azkaban:248at01e9109):read -pwrites the prompt to the terminal, and the terminal interpretsescape sequences inside it. Nothing bounds the displayed
current_directoryto printable characters.Scenario
A tool the user runs — unpacking an archive, a clone, a generated cache
— creates a directory whose name carries terminal control bytes, e.g.
mkdir $'proj\e]0;PWNED\a'. Launchingazkaban codexfrom inside itwith no workspace argument prints the confirmation and emits the name
verbatim, so the crafted name writes to the terminal: it can rewrite the
window title, or inject text into the terminal's stream through the
connected terminal's escape protocol.
Severity is low: it needs the user to start a client interactively in a
crafted directory, and the target is the user's own terminal.
Smallest fix
Bound the value shown in the prompt to printable characters, keeping the
untouched path for everything else. The display is only ever printed,
while the workspace choice uses the real
current_directory:and interpolate
displayin the prompt only.Scope
The launcher's other confirmations interpolate only a tag validated
against
^[a-z0-9]+([._-][a-z0-9]+)*$and the literalDockerfile.<client>names, so they do not reach this.Seen at
01e9109while security-reviewing #81; the prompt predates thatchange and the finding is outside it.