Skip to content

Bash prompt values can change meaning under older compatibility modes (POSIX) #23058

Open

Description

@hroncok

Summary

Hello uv folks.

In Fedora, we have triaged several already disclosed CVEs from pypa/virtualenv as they were reported to the uv package as well (reasons not important, happy to explain). With LLM (Claude Sonnet 5) I have found that CVE-2026-113723 is reproducible in uv 0.13.6 on Fedora Linux.

pypa/virtualenv@5f48d71

uv's bash/zsh activate script never implements any of the backslash/dollar/backtick escaping virtualenv progressively added for its PS1-embedded prompt value; it splices the attacker-controlled --prompt value (or venv directory name) directly into a double-quoted shell assignment, so command substitution in that value runs immediately when the script is sourced, under both bash and zsh.

uv venv --prompt 'x$(touch /tmp/PWNED)y' venv
bash -c 'source venv/bin/activate'
ls /tmp/PWNED   # command ran immediately at source time, not on prompt redraw 

I have reported this to security at astral.sh but this does not constitute vulnerability within uv’s attacker and threat models, hence I am reporting this as a regular bug.

Platform

Fedora Linux

Version

0.13.6

Python version

any

Activity

  1. added
    bug
    on Nov 2, 2026
  2. hroncok commented on Nov 2, 2026

    @hroncok
    Author

    Same reproducer applies to CVE-2026-113725 fix in pypa/virtualenv@c3104e0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions