Tainted flow: 'DEFAULT_CONFIG' from os.environ.get (line 29, credential/environment) → open (file write)
Medium
- Category
- Data Flow
- Content
def save_config(cfg): os.makedirs(os.path.dirname(DEFAULT_CONFIG), exist_ok=True) with open(DEFAULT_CONFIG, "w", encoding="utf-8") as f: json.dump(cfg, f, ensure_ascii=False, indent=2) try: os.chmod(DEFAULT_CONFIG, 0o600) # 凭据敏感,仅本人可读- Confidence
- 82% confidence
- Finding
- The config file path is taken from the NOTIFY_CONFIG environment variable and then written without validation. In environments where an attacker can influence process environment or invocation context, this can redirect credential-bearing output to an unintended file path, causing credential disclosure, overwriting sensitive user files, or symlink-based abuse.
