T09 · Insecure Skill Coding Practices
- Location
scripts/scrape_fb.py:11- Finding
Apify credentials are exposed through command-line arguments
- Content
View full analysis
2 else None FB_URL = sys.argv[1] if len(sys.argv) > 1 else None ``` The documented invocation explicitly places the credential on the command line: ```bash python3 scripts/scrape_fb.py "" "" ``` ### Technical Analysis The Apify API token is supplied through `argv`. Command-line arguments can be retained in shell history, captured by process-monitoring or observability systems, and exposed to other local users who have permission to inspect processes. Although sending an Apify token to Apify is necessary for the declared scraping functionality, accepting that token through a command-line argument is not necessary and creates avoidable local exposure. ### Attack Path 1. A user follows the documented command and supplies an Apify token as the second argument. 2. The complete command is saved in shell history or observed through process inspection. 3. A local attacker or log reader extracts the token. 4. The attacker reuses the token against Apify APIs until it is revoked or expires. ### Impact Assessment A compromised token may permit unauthorized actor runs, access to account-associated Apify resources subject to the token's permissions, consumption of paid platform resources, and exposure of datasets accessible with that token. This does not directly grant local code execution or Facebook Page access. ]]>- Remediation
View remediation
