Tainted flow: 'CONFIG_PATH' from os.getenv (line 17, credential/environment) → pathlib.Path.write_text (file write)
Medium
- Category
- Data Flow
- Content
def save_config(config): CONFIG_PATH.write_text(json.dumps(config, ensure_ascii=False, indent=2), encoding="utf-8") def auth_set(api_key=None):- Confidence
- 91% confidence
- Finding
- CONFIG_PATH is derived from an environment variable and then written without validation, so an attacker controlling the process environment could redirect writes to arbitrary filesystem locations accessible to the running user. In this script, that risk is more significant because the file may contain an API key, turning the write into both arbitrary file modification and credential exposure.
