Credential Access
- Category
- Privilege Escalation
- Confidence
- 89% confidence
- Finding
The skill searches upward from both the current working directory and the script directory to locate and automatically load the nearest .env file. In an agent or multi-project environment, this can cause the skill to ingest unintended credentials from a parent directory, enabling credential confusion, accidental cross-project account access, or use of attacker-planted configuration if the working directory is influenced.
- Content
python starts = [Path.cwd(), Path(__file__).resolve().parent] for start in starts: for directory in (start, *start.parents): env_file = directory / ".env" if env_file in seen: continue seen.add(env_file)
