{"id":2616,"cve":"CVE-2026-113732","cve_url":"https:\/\/www.cvedetails.com\/cve\/CVE-2026-113732\/","cwe":"CWE-78","cwe_number":78,"cwe_url":"https:\/\/cwe.mitre.org\/data\/definitions\/78","cvss_score":7.8,"published":"2026-10-20","owasp":"A03 Injection","odc":"Interface","cdc":"Incorrect Interface","category":"Input Validation and Sanitization","subcategory":"Command Injection","scope":"Local","impact":"Arbitrary Code Execution","summary":"Fish shell activation allows command injection via crafted path or prompt containing backslash\u2011quote.","permalink":"https:\/\/netpack.pt\/vaitp\/vulnerability\/CVE-2026-113732\/","description":"virtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.2, FishActivator inherits ViaTemplateActivator.quote(), which uses POSIX shlex.quote() even though fish interprets backslashes and single quotes differently. An attacker-influenced environment path, --prompt, or VIRTUALENV_PROMPT value containing a backslash before a quote can therefore terminate the generated fish literal and execute command substitution when the user sources activate.fish. This issue is fixed in version 21.14.2.","solution":"Upgrade virtualenv to version\u202f21.14.2\u202for later.","affected_component":"Python","fixed_by_upgrading":true,"vulnerable_code":"import shlex\nimport os\n\nclass ViaTemplateActivator:\n    def quote(self, s: str) -> str:\n        # VULNERABLE: uses POSIX quoting for fish, allowing injection via backslash\n        return shlex.quote(s)\n\nclass FishActivator(ViaTemplateActivator):\n    def generate_activate_script(self, env_path: str, prompt: str = None) -> str:\n        parts = [\"set -gx VIRTUAL_ENV\", self.quote(env_path)]\n        if prompt:\n            parts.append(\"set -gx VIRTUAL_ENV_PROMPT\")\n            parts.append(self.quote(prompt))\n        return \" \".join(parts)\n\ndef create_activation(env_path: str, prompt: str = None):\n    activator = FishActivator()\n    script = activator.generate_activate_script(env_path, prompt)\n    return script\n","patched_code":"import os\n\nclass ViaTemplateActivator:\n    def quote(self, s: str) -> str:\n        # fallback POSIX quoting (not used by FishActivator)\n        import shlex\n        return shlex.quote(s)\n\nclass FishActivator(ViaTemplateActivator):\n    # FIX: use fish\u2011compatible quoting to neutralize backslashes and single quotes\n    def quote(self, s: str) -> str:\n        # fish quoting: wrap in single quotes and escape internal single quotes\n        escaped = s.replace(\"'\", \"'\\\\''\")\n        return f\"'{escaped}'\"\n\n    def generate_activate_script(self, env_path: str, prompt: str = None) -> str:\n        parts = [\"set -gx VIRTUAL_ENV\", self.quote(env_path)]\n        if prompt:\n            parts.append(\"set -gx VIRTUAL_ENV_PROMPT\")\n            parts.append(self.quote(prompt))\n        return \" \".join(parts)\n\ndef create_activation(env_path: str, prompt: str = None):\n    activator = FishActivator()\n    script = activator.generate_activate_script(env_path, prompt)\n    return script\n","payload_needed":true,"payload":null,"payload_status":"model_refused","published_fix":[{"repository":"pypa\/virtualenv","commit_url":"https:\/\/github.com\/pypa\/virtualenv\/commit\/3bddeaf8d02c3ee7f576503efb082f8f494cfcab","commit_subject":"Merge commit from fork","units":[{"file":"src\/virtualenv\/activation\/fish\/__init__.py","function":null}]}],"references":null}