The vulnerability (CVE-2026-113725 / GHSA-vxj4-q4g9-crj7) is an OS command injection in virtualenv's bash activation script. The root cause is in src/virtualenv/activation/bash/activate.sh, in the block that prepends the environment name to the PS1 prompt variable.
Bash processes PS1 in two passes each time it draws the prompt: (1) a decode pass that interprets backslash prompt escapes (turning \\ into \ and \$ into $ or # for root), and (2) an expansion pass that performs parameter expansion, command substitution, and arithmetic expansion. Since version 21.13.0, the script escaped backslashes, dollar signs, and backticks in the environment name, but only for the second (expansion) pass. A backslash in the name (e.g., a\$(touch PWNED)) undoes that escaping during the first decode pass, so the $(...) command substitution runs each time bash draws the prompt.
The fix (commit c3104e02474b652832a9bbaae79f6e1696296932) splits the combined BASH/ZSH branch into separate branches and adds a second round of escaping for bash specifically, so both passes leave the name literal. zsh does no decode pass, so it keeps the single escaping.
The vulnerable code is the top-level sourced body of the activate.sh script (there is no named function wrapping the PS1 logic — the script is sourced directly into the user's shell). The relevant vulnerable code is the _VIRTUAL_PROMPT escaping block and the PS1=... assignment. In a runtime profile, this would appear as the activate script being sourced (the script itself, not a named function). The only named function in the file is deactivate, which is not involved in this vulnerability.