Tainted flow: 'SESSION_PATH' from os.environ.get (line 9, credential/environment) → open (file write)
Medium
- Category
- Data Flow
- Content
def save_session(data): with open(SESSION_PATH, 'w', encoding='utf-8') as f: if yaml is None: f.write(dump_yaml_fallback(data)) else:- Confidence
- 94% confidence
- Finding
- SESSION_PATH is derived from MEMORY_ROOT, which comes from an environment variable, and is written without validation or confinement. If an attacker can influence the runtime environment, they can redirect writes to arbitrary filesystem locations, causing file overwrite, corruption, or clobbering of sensitive files reachable by the process.
