T09 · Insecure Skill Coding Practices
- Location
instagram_scraper.py:45- Finding
Documentation Encourages Hardcoded Instagram Credentials
- Content
View full analysis
Vulnerability Details
File Location:
instagram_scraper.py:45-46;README.md:44
Vulnerability Type: Plaintext credential storage and unnecessary authenticated access
Risk Level: MediumVulnerable Code
instagram_scraper.py:45-46:python # Optional: uncomment and add credentials to access private accounts # L.login("your_username", "your_password")README.md:44:markdown - If you get 403 errors, add login credentials to the script (see scraper comments)Technical Analysis
The documentation instructs users to insert an Instagram username and password directly into the source code. If followed, this stores reusable account credentials as plaintext in a file that may be copied, committed to source control, included in backups, shared for troubleshooting, or read by other users and processes with filesystem access.
Authenticated access also exceeds the Skill's declared minimum privilege. The Skill is documented as retrieving captions from public posts and reels, for which an Instagram password should not ordinarily be required. The suggested login path could extend the script from public-content retrieval to authenticated or private-content access.
The currently active implementation does not contain real credentials and does not invoke
L.login; the risk arises from the explicit setup guidance and commented credential template.Attack Path
- Instagram returns a
403or otherwise blocks an anonymous request. - The user follows the README and uncommented source-code example.
- The user inserts a real Instagram username and password into
instagram_scraper.py. - The modified file is committed, backed up, copied, shared, or accessed by another local user or process.
- The exposed credentials are recovered and used to access the Instagram account.
- Depending on the account's permissions, the exposed authenticated session may also permit access to content una ...[truncated 439 chars]
- Instagram returns a
- Remediation
View remediation
Remediation Suggestions
- Remove the recommendation to place usernames and passwords directly in source code.
- Preserve anonymous, public-only access as the default and documented operating mode.
- If authenticated access is intentionally supported, clearly document that it expands the Skill's permissions and data-access scope.
- Obtain explicit user consent before enabling authenticated retrieval.
- Load credentials from a dedicated secret manager or protected environment variables rather than source files.
- Prefer a protected Instaloader session file so the account password is not repeatedly handled by the script.
- Restrict any session file to the owning user, such as with filesystem mode
0600. - Ensure source files, logs, exceptions, and command-line arguments never expose credentials or session tokens.
- Recommend a dedicated, least-privileged account if Instagram authentication is unavoidable.
