T09 · Insecure Skill Coding Practices
- Location
scripts/tiktok_login_save_session.py:47- Finding
TikTok Authentication Session Stored Without Restrictive File Permissions
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill mostly matches TikTok trend monitoring, but it handles login sessions and paid crawling too broadly and includes an undeclared video downloader.
Review this skill before installing. Use a dedicated low-privilege TikTok account and Apify token, protect or delete data/tiktok_session.json, avoid shared machines, inspect any alternate config before using MCP mode, avoid --schedule unless you have external billing limits, and do not run the downloader unless you have validated the input URLs and want local media downloads.
scripts/tiktok_login_save_session.py:47TikTok Authentication Session Stored Without Restrictive File Permissions
scripts/crawl_tiktok_hotspots.py:291Configuration-Controlled MCP Process Inherits the Entire Parent Environment
scripts/crawl_tiktok_hotspots.py:547Documented Apify Cost and Crawl Limits Are Not Enforced
`.
4. The script passes the URL to `yt-dlp`.
5. `yt-dlp` attempts to resolve and request the destination from the victim host’s network context.
6. Depending on content type and extractor behavior, the response may be downloaded, its availability may be inferred from errors or timing, or redirects may reach another destination.
### Impact Assessment
The process can reach destinations available to the host, potentially including intranet services or other non-public endpoints. It can also consume bandwidth
...[truncated 419 chars]:132Untrusted Analysis URLs Can Drive Arbitrary Outbound Requests Through yt-dlp
requirements.txt:1Security-Critical Dependencies Use Open-Ended Lower-Bound Version Constraints
scripts/render_tiktok_hotspot_report.py:407Generated Reports Contact Google Fonts Despite Being Declared Self-Contained
The code is clearly related to TikTok hotspot analysis and does implement trend scoring, coverage-like scoring, recent-window bucketing, and crawl log metric summarization, so it partially aligns with the declared domain. However, the declared description presents a broader monitoring skill that crawls metadata via Apify/Playwright and generates static HTML reports. This code chunk does neither: it loads preexisting snapshot files from disk, analyzes them, and writes a JSON report. The cost-aware crawl strategy is only indirectly reflected by parsing crawl logs and window summaries, not by executing any crawl scheduling logic. Additionally, the presence of a --download flag without implementation indicates a description/behavior gap rather than added capability. Therefore this chunk materially underdelivers on key declared capabilities, making the description inaccurate for the supplied code chunk.
The code is clearly focused on crawling and normalizing TikTok video metadata, saving snapshots/logs, and supporting weighted crawl windows with a cost note. That partially matches the declared crawling/monitoring aspect and the cost-aware multi-window strategy. However, several material parts of the declared purpose are not represented in this code: there is no women's-fashion-specific analysis logic, no trend analysis or heat/coverage scoring, and no static HTML report generation. The fallback/alternate crawler is also not Playwright; it is an MCP-based TikTok search client invoked over stdio. Because core declared capabilities are absent and one provider mechanism is materially different, the description does not accurately represent what this code chunk actually does.
The declared description is for a monitoring/analysis/report-generation skill: crawling TikTok metadata, scoring trends, and producing static HTML reports. This code chunk does not perform crawling via Apify or Playwright, does not analyze trends, and does not generate HTML reports. Instead, its primary function is to download TikTok videos referenced in an existing analysis JSON and save them as local .mp4 files alongside markdown metadata. Downloading media is a materially different and undeclared capability, so this is a description-behavior mismatch.
The declared description is about automated TikTok trend monitoring, metadata crawling, scoring, and HTML report generation. This code chunk does none of that. Its sole purpose is to create and save an authenticated TikTok session using Playwright. While a saved login session could be a supporting prerequisite for later crawling, this specific code introduces a significant undeclared capability: collecting and persisting authentication state/cookies. That is materially different from the declared primary purpose and is not represented in the description or permissions.
The code only provides a thin MCP-compatible search service for TikTok video search using Playwright. It reads a saved session file, opens TikTok search pages, intercepts search API responses, extracts metadata, and returns results over stdio. This is only a subset of the declared functionality and omits several central described behaviors: there is no Apify-based primary crawler, no backup selection logic between Apify and Playwright, no trend-analysis or scoring logic, no hotspot detection specific to US women's fashion, no report generation, and no cost-aware multi-window crawling strategy. The implemented behavior is materially narrower and differently scoped than the declared end-to-end monitor.
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
<span class="source">关键词 / vacation outfits</span>
<span class="status status-warm">近七天</span>
</div>
<h3>SHEIN is getting to good.\ud83c\udf68\ud83e\udee7\ud83e\uddd8\ud83c\udffd♀️Download the SHEIN App to check out the amazing store Avantive and unlock the latest fashion trends anytime, anywhere! Search \u0026 follow Avantive on SHEIN and use; 4SPUSsophienelsonnnnn034 to enjoy exclusive discounts! ✨
@sheinofficial @shein_us @SHEIN US
#SHEINtrends #ad
#sheinhaul #summersheinhaul #vacationoutfits </h3>
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
<span class="source">关键词 / vacation outfits</span>
<span class="status status-warm">近七天</span>
</div>
<h3>SHEIN is getting to good.\ud83c\udf68\ud83e\udee7\ud83e\uddd8\ud83c\udffd♀️Download the SHEIN App to check out the amazing store Avantive and unlock the latest fashion trends anytime, anywhere! Search \u0026 follow Avantive on SHEIN and use; 4SPUSsophienelsonnnnn034 to enjoy exclusive discounts! ✨
@sheinofficial @shein_us @SHEIN US
#SHEINtrends #ad
#sheinhaul #summersheinhaul #vacationoutfits </h3>
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
pip install apify-client
# 2. Set Apify API Token
echo "APIFY_TOKEN=your_token_here" > .env
# 3. Crawl (10 sources × window weights)
python scripts/crawl_tiktok_hotspots.py --once
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
pip install apify-client
# 2. Set Apify API Token
echo "APIFY_TOKEN=your_token_here" > .env
# 3. Crawl (10 sources × window weights)
python scripts/crawl_tiktok_hotspots.py --once
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
return datetime.now(timezone.utc).strftime("%Y%m%dT%H%M%SZ")
def load_dotenv(path: Path = PROJECT_ROOT / ".env") -> None:
if not path.exists():
return
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
return datetime.now(timezone.utc).strftime("%Y%m%dT%H%M%SZ")
def load_dotenv(path: Path = PROJECT_ROOT / ".env") -> None:
if not path.exists():
return
The code launches an external MCP subprocess and passes the entire parent process environment with env={**os.environ, **config.tiktok_mcp_env}. If the configured MCP command/args point to an untrusted or compromised program, it receives all loaded secrets from the shell and .env file, enabling credential exfiltration far beyond the minimum needed for TikTok crawling.
server_params = StdioServerParameters(
command=config.tiktok_mcp_command,
args=config.tiktok_mcp_args,
env={**os.environ, **config.tiktok_mcp_env},
cwd=config.tiktok_mcp_cwd,
encoding_error_handler="replace",
)
Referenced artifact was not completely inspected
### 4.2 `analyze_tiktok_hotspots.py` — Offline Analyzer
Referenced artifact was not completely inspected
### 4.2 `analyze_tiktok_hotspots.py` — Offline Analyzer
The README instructs users to save a TikTok authenticated session for local Playwright scraping but does not warn that the resulting browser/session state is sensitive credential material. If that state file is stored insecurely, committed to source control, or reused by other processes, an attacker could hijack the TikTok account session and access or act as the user.
Without declared permissions the skill's intent is opaque and cannot be validated.
This manifest/config file includes multiple natural-language labels in Chinese such as "近24小时高赞" while the config market is explicitly "US". The file provides no opt-in, fallback, or documented justification for forcing a non-user-selected language, which conflicts with the language/locale policy criterion.
The label field here is natural-language user-facing text in Chinese, continuing a pattern of fixed locale content in the configuration. Because the file does not offer a language choice or explain a region-specific requirement, this is a policy-relevant locale constraint.
This line contains another Chinese label in a configuration otherwise scoped to the US market. The mismatch suggests the skill may force a specific language without user choice or clear justification.
The configuration continues to define user-facing labels only in Chinese. Without any documented opt-in or regional constraint, this appears to impose a fixed language/locale contrary to the stated policy.
This label is another instance of fixed Chinese-language text in the config. The absence of locale selection or justification makes it a natural-language policy concern.
This user-facing label is hard-coded in Chinese and appears in a US-market configuration. No language selection or explicit region-specific rationale is present.
The label field here enforces Chinese-language output without any visible opt-in mechanism. That makes the locale behavior fixed rather than user-selected.
This is another hard-coded Chinese label in the same config, reinforcing a forced locale pattern. The file does not expose a language option or note a justified regional restriction.
This label continues the use of a fixed Chinese locale for user-facing text. Because the config offers no opt-in or rationale, it fits the policy-violation category.
No suspicious patterns detected.