T09 · Insecure Skill Coding Practices
- Location
assets/hottrender-runtime/src/providers/tiktok.py:258- Finding
Partial Disclosure of TikTok Session Token in Application Logs
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill mostly matches its crawler purpose, but optional TikTok support handles session material and logs part of an msToken, so it should be reviewed before installation.
Install only if you intend to run a local web-crawling tool and understand that live mode will contact external platforms. Avoid optional TikTok mode until token-prefix logging is removed, use a disposable TikTok session token if testing, keep logs private, and prefer pinned or hash-locked dependencies in an isolated virtual environment or container.
assets/hottrender-runtime/src/providers/tiktok.py:258Partial Disclosure of TikTok Session Token in Application Logs
assets/hottrender-runtime/requirements-tiktok.txt:1Floating and Unverified Python and Browser Dependencies
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
python -m venv .venv . .venv/bin/activate pip install -r requirements.txt cp .env.example .env
## Daily Trends
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
shutil.copytree(source, target)
(target / "out").mkdir(parents=True, exist_ok=True)
env_example = target / ".env.example"
env_file = target / ".env"
if env_example.exists() and not env_file.exists():
shutil.copy2(env_example, env_file)
The skill instructs the agent to use shell commands, inspect environment variables, search the filesystem, install and run bundled code, and execute tests, but it does not declare any explicit tool scope such as permissions or allowed-tools. That mismatch weakens least-privilege enforcement and can let the skill operate with broader file, environment, and network access than reviewers or policy expect.
The skill enables implicit invocation with no visible trigger constraints, which can cause the agent to auto-select and run a web-crawling capability in situations the user did not explicitly request. Because this skill performs external data fetching, unintended invocation increases the risk of over-broad scraping, privacy issues, and surprising agent behavior, especially when paired with generic prompting.
The markdown renderer uses fixed Chinese strings for the report title, headings, labels, and empty/error messages. This forces a specific language in user-facing output without any visible opt-in or documented region-specific justification in this file, which matches the language/locale policy violation criteria.
The default HTTP header explicitly sets "ja" as the preferred language, which imposes a specific locale preference in outbound requests. This is a natural-language/locale policy concern because the file does not offer user choice or document why Japanese should be forced by default.
The code forces specific language/locale pairs for each region, such as Japanese for jp and English for us, and then uses those values in the outbound request. This is a natural-language locale policy concern because the skill does not expose any opt-in or user choice for language selection, and the constraint is not documented here as a justified region-specific requirement.
The manifest describes a lightweight HotTrender crawler that should prefer the bundled basic crawler runtime and existing provider scripts, while explicitly excluding broader infrastructure and advanced add-ons. This file instead builds a full Playwright-backed unofficial TikTok scraping client, including session creation, cookie/ms_token credential handling, proxy support, and browser monkey-patching to evade platform loading constraints, which is materially more complex than a lightweight basic crawler implementation.
The code pulls proxy settings, cookies, and a TIKTOK_MS_TOKEN environment variable to create authenticated scraping sessions against TikTok. For a skill described as a lightweight hotspot crawler that explicitly excludes unrelated infrastructure and advanced features, secret/token ingestion for a non-official scraper is an additional capability not clearly justified by the stated purpose.
The provider logs the first 20 characters of an auto-acquired TikTok msToken, which is sensitive session credential material. Partial token disclosure can aid credential correlation, leak secrets into centralized logs, and expand the blast radius if logs are accessible to operators, other services, or attackers.
The short description is written only in Chinese, which may impose a language/locale expectation without offering user choice or documenting that the skill is intended solely for a Chinese-speaking context. This can conflict with language/locale policy requirements when no opt-in or justification is provided.
The dependency uses a lower-bound version specifier only, which allows installation of any newer release, including unreviewed major versions with breaking changes or compromised upstream packages. In a crawler runtime that pulls third-party libraries with browser automation and social-media access, this weakens supply-chain control and can introduce malicious or vulnerable code during future installs.
TikTokApi>=6.0
playwright>=1.40
The Playwright dependency is not pinned to an exact version, so builds may resolve to different releases over time, increasing exposure to supply-chain compromise and unexpected behavior. Because Playwright executes browser automation and may download browser components, uncontrolled upgrades can materially affect the security posture of the crawler environment.
TikTokApi>=6.0
playwright>=1.40
The dependency is specified with a lower bound only, which allows builds to resolve to different versions over time. This weakens supply-chain integrity and makes security posture non-reproducible, especially because PyYAML has a history of security advisories and the exact installed version cannot be verified from this manifest alone.
PyYAML>=6.0
requests>=2.31
beautifulsoup4>=4.12
pytest>=8.0
PyYAML has multiple known advisories, and because the manifest does not pin a specific version, it is impossible to determine whether deployed environments are using a fixed or affected release. This is particularly relevant if the skill parses YAML from configuration or other untrusted sources, where historical PyYAML issues have included unsafe parsing behaviors.
Using an unpinned requests dependency permits installation of any future version satisfying the lower bound, which can introduce vulnerable or breaking releases without review. In a crawler/runtime context that performs network access, this increases supply-chain and runtime risk because HTTP client behavior directly affects outbound requests, redirects, and credential handling.
PyYAML>=6.0
requests>=2.31
beautifulsoup4>=4.12
pytest>=8.0
requests has several known advisories, but the absence of version pinning prevents verification that installations are using a secure release. In this skill's crawler context, requests is directly exposed to attacker-controlled URLs and responses, so uncertainty around the exact version increases concern even though the manifest alone does not prove an exploitable vulnerable install.
An unpinned beautifulsoup4 version makes builds non-deterministic and can silently pull in changed parser behavior or vulnerable releases later. While this package is less obviously security-sensitive than a network client, it still participates in processing untrusted web content in this crawler skill, so version drift is undesirable.
PyYAML>=6.0
requests>=2.31
beautifulsoup4>=4.12
pytest>=8.0
pytest is listed as an unpinned dependency, which allows uncontrolled version drift and can pull in vulnerable or incompatible test tooling. The risk is lower than for runtime packages because pytest is typically used in development/test contexts, but it still weakens reproducibility and may affect CI environments.
PyYAML>=6.0
requests>=2.31
beautifulsoup4>=4.12
pytest>=8.0
pytest has known advisories and is not pinned, so the security state of the resolved test dependency cannot be verified. The practical risk is lower because this package is generally used in testing rather than production runtime, but CI or developer environments may still be exposed to vulnerable tooling.
User-visible error hints are written only in Chinese, which imposes a specific language choice in natural-language output. The file does not offer a language selection mechanism or document that the provider is intentionally limited to Chinese-speaking users.
The regression-check example includes --keywords "乙游,短剧", which bakes a specific language/locale into the skill documentation. The file does not indicate that this skill is region-specific or offer a user choice, so this can be read as a language-policy constraint without opt-in.
No suspicious patterns detected.