Intel

AIKIDO-2026-182491

virtualenv is vulnerable to Carriage Return Line Feed (CRLF) Injection

Carriage Return Line Feed (CRLF) InjectionGHSA-9h9j-4vrj-gf7g Published 5 days ago

37

Low Risk

This Affects:

PYTHONvirtualenv
0.0.1 - 21.7.10
Fixed in 21.7.11
Are you affected? Scan for Free

TL;DR

pyvenv.cfg is a line-based format with no escape syntax, and PyEnvCfg.write() wrote values verbatim while reading parsed the file with str.splitlines(), which recognizes boundaries beyond \n such as \r, \v, and U+2028. A prompt value containing one of those boundaries becomes additional configuration lines, and because reading is last-wins, it overrides keys written earlier such as home, which tooling reads to locate the base interpreter. The prompt is reachable via --prompt, the VIRTUALENV_PROMPT environment variable, or the config file. The fix collapses every recognized line boundary to a space before serializing each value.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and your --prompt value, the VIRTUALENV_PROMPT environment variable, or your config file's prompt setting comes from an untrusted or externally influenced source.

Background info

virtualenv is vulnerable to Carriage Return Line Feed (CRLF) Injection in versions 0.0.1 - 21.7.10.

How to fix this

Upgrade the virtualenv library to the patch version.

Are You Affected?

Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.

Free. No credit card required.

Aikido Platform