Tainted flow: 'token_file' from os.environ.get (line 52, credential/environment) → open (file write)
Medium
- Category
- Data Flow
- Content
else: flow = InstalledAppFlow.from_client_secrets_file(creds_file, SCOPES) creds = flow.run_local_server(port=0) with open(token_file, "w") as f: f.write(creds.to_json()) return creds- Confidence
- 86% confidence
- Finding
- The OAuth token cache path is taken from the GOOGLE_TOKEN_FILE environment variable and written to without validation. In an agent or multi-tenant runtime, a caller who can influence environment configuration could cause credential material to be written to an unintended location, potentially overwriting sensitive files or exposing refresh tokens in insecure paths.
