Env Variable Harvesting
- Category
- Data Exfiltration
- Confidence
- 70% confidence
- Finding
Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.
- Content
python import os,subprocess,uuid,zipfile from core import * def git(repo,*args,limit=10*1024*1024): env={k:v for k,v in os.environ.items() if not k.startswith('GIT_')}; env['GIT_TERMINAL_PROMPT']='0'; env['GIT_OPTIONAL_LOCKS']='0' p=subprocess.run(['git','--no-optional-locks','-c','core.fsmonitor=false','-c','core.hooksPath=/dev/null','-C',str(repo),*args],capture_output=True,timeout=45,env=env) if p.returncode: raise ValueError('Git operation failed: '+args[0]) if len(p.stdout)>limit: raise ValueError('Git output exceeds limit')
