T09 · Insecure Skill Coding Practices
- Location
scripts/scrape_x_v9.py:27- Finding
Hard-Coded X.com Bearer Token in Source Code
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a coherent X.com tweet scraper, but it asks users to export live login cookies and performs authenticated scraping without enough safety disclosure or containment.
Review before installing. Only use this skill if you are comfortable exporting X.com login cookies; treat the cookie file like a password, keep it out of source control, restrict local access, delete it after use, and consider revoking the browser session afterward. Use a dedicated low-risk account or isolated profile, back up seed JSON files before running because scripts can overwrite them, and install dependencies in an isolated environment with pinned versions where possible.
scripts/scrape_x_v9.py:27Hard-Coded X.com Bearer Token in Source Code
README_EN.md:26Unpinned Playwright Dependency and Browser Artifact Installation
scripts/scrape_x_scroll.py:290Undefined Profile URL Causes DOM-Scroll Strategy Failure and Potential Data Loss
The description omits important operational behaviors such as use of exported authentication cookies and local state persistence. That mismatch can mislead a user or agent into handling sensitive session material and writing artifacts to disk without understanding the security implications, which is more serious than a mere feature-description inconsistency.
The description omits important operational behaviors such as use of exported authentication cookies and local state persistence. That mismatch can mislead a user or agent into handling sensitive session material and writing artifacts to disk without understanding the security implications, which is more serious than a mere feature-description inconsistency.
The description omits important operational behaviors such as use of exported authentication cookies and local state persistence. That mismatch can mislead a user or agent into handling sensitive session material and writing artifacts to disk without understanding the security implications, which is more serious than a mere feature-description inconsistency.
The README advertises large-scale collection of tweet history and states that the tooling uses real browsers to bypass anti-scraping protections, yet it omits any warning about privacy, account integrity, platform policy, or operational risk. That omission is security-relevant because users may run the skill without understanding that aggressive automation and anti-detection behavior can trigger account restrictions, leak browsing/session state, or facilitate abusive data collection.
The README instructs users to export X.com login cookies and use them with a scraping workflow that explicitly aims to bypass anti-scraping protections, but it provides no warning about the sensitivity of session cookies or the risk of account takeover if those cookies are exposed. In this context, session cookies function like credentials, and normalizing their export increases the chance they are mishandled, reused insecurely, or committed to disk without protection.
The README instructs users to export live X.com login cookies and store them in a local JSON file, but provides no warning that these cookies are bearer-equivalent authentication secrets. If mishandled, shared, committed to source control, or accessed by other local processes, they could enable account takeover or unauthorized access to the user's X.com session.
The skill documents capabilities that clearly require network access plus local file read/write, but it does not declare any tool scope or permission boundaries. In an agent ecosystem, this increases the chance that an operator or orchestrator will invoke the skill with broader access than intended, making data collection and local persistence less transparent and harder to govern.
The skill instructs users to export X.com cookies from a browser and save them to disk, effectively handling session credentials in portable form without any warning about sensitivity, theft risk, or account compromise. If those JSON cookie files are exposed, reused by another process, or committed to source control, an attacker could hijack the X account session and access or act as the user.
The workflow explicitly instructs users to export authenticated X.com cookies to a local JSON file but provides no warning that these cookies are sensitive session credentials. If mishandled, leaked, or reused by other tools, they can enable account hijacking or unauthorized access to the user's X.com session. In the context of a scraping skill, this is more dangerous because the workflow normalizes credential export as part of routine operation, increasing the chance users will store or share the file insecurely.
The script silently loads authentication cookies from disk and injects them into a Playwright browser context, causing subsequent requests to run under the user's X account session. In a skill context, this is sensitive because it reuses account credentials without an explicit warning, consent gate, or validation of cookie provenance, increasing the chance of unintended account-linked activity or misuse of stolen session material.
The script performs automated authenticated scraping against X.com, including repeated searches and scrolling-driven collection, without any explicit operator warning that external requests and account-associated actions will occur. In an agent skill, that lack of transparency is security-relevant because users may unknowingly trigger high-volume network activity tied to their account, with risks including account restriction, privacy issues, and collection of more data than intended.
The module docstring says the skill will start from the earliest tweets and search forward chronologically, and the gen_chunks docstring says it generates chunks from the earliest account date to today. In reality, gen_chunks ignores the discovered oldest tweet date and hard-codes the search start at 2025-07-01, so the documented behavior contradicts the implemented date range.
The script overwrites the user-supplied seed JSON file in place after merging results, with no backup, confirmation, or separate output target. In an automation/agent setting, this can cause silent data loss or corruption of an input dataset, especially if the supplied path points to an important file or a shared artifact expected to remain immutable.
The header documentation says the script 'opens a user homepage' and simulates scrolling, implying a profile-based workflow. In code, the first major collection phase uses search URLs for monthly ranges, and the later homepage-navigation section logs and visits profile_url even though no such variable is defined, contradicting the documented operational path.
SQP-3 applies to all file types and includes language or locale policy violations. This file presents its top-level description exclusively in Chinese, and there is no indication that the user can choose another language or that the locale restriction is justified as region-specific.
The module docstring describes a browser scrolling mode that opens a user's homepage and extracts tweets from the DOM, but this function first constructs monthly search queries and scrapes X search result pages across date ranges. That is a materially broader behavior than simply scrolling a profile page, because it pivots into search-based collection logic before the later profile-scrolling phase.
The argparse description and help strings are all written in Chinese, which imposes a specific language on users of the tool. Under SQP-3, this is a natural-language policy issue unless the tool offers a language choice or clearly documents a justified locale-specific scope.
The script loads authenticated X.com session cookies from a local JSON file and uses them to impersonate a logged-in browser session without any user-facing disclosure, consent flow, or validation of how those credentials were obtained. In the context of a scraping skill specifically designed to access authenticated content, this increases the risk of unauthorized account use, accidental misuse of exported session tokens, and leakage of sensitive session material through poor operational handling.
The code issues authenticated GraphQL requests using a hardcoded bearer token plus the operator's session cookies and CSRF token, causing account-linked data transmission to X.com without any explicit user warning at runtime. In a scraping tool whose purpose is bulk collection from an authenticated session, this creates a meaningful risk of users unknowingly sending privileged requests, triggering account abuse, policy violations, or exposing session-derived access patterns.
The module docstring and runtime log messages are written in Chinese, which forces a specific language experience for users and operators. The file does not offer language selection or explain that the skill is intentionally limited to a Chinese-speaking context.
This request header hard-codes x-twitter-client-language to en, imposing a specific locale regardless of user preference. There is no option, opt-in, or justification indicating that English is required for a region-specific or compliance-related reason.
Detected: suspicious.exposed_secret_literal