T09 · Insecure Skill Coding Practices
- Location
scripts/hk_downloader.py:512- Finding
Path Traversal Through an Unvalidated Stock Code
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a coherent Hong Kong financial-report downloader, but it needs review because unsafe validation can write outside its intended archive and fetch unexpected PDF URLs.
Install only if you are comfortable reviewing or fixing the Python script first. At minimum, restrict stock codes to numeric HK symbols, verify all write paths remain inside the archive, allowlist PDF download hosts, and add download size limits before using --pdf.
scripts/hk_downloader.py:512Path Traversal Through an Unvalidated Stock Code
scripts/hk_downloader.py:400Server-Side Request Forgery Through Unrestricted Remote PDF URLs
scripts/hk_downloader.py:407Unbounded Response Buffering Permits Memory Exhaustion
The description is mostly aligned with the overall intent: this is indeed a Hong Kong financial report downloader, it classifies annual/interim/quarterly/prospectus documents, prefers complete reports over earnings announcements, and can download PDFs. However, there is a material mismatch in the declared source coverage. The description says it automatically obtains reports from Eastmoney/Tonghuashun/HKEX, but the HKEX path is explicitly stubbed out: fetch_hkex does not perform retrieval and always returns an empty list after a stockId lookup attempt. That means one of the three named data sources is not actually implemented, so the declared behavior overstates the skill's real capability.
The skill clearly describes network access and writing downloaded PDFs/manifests to disk, but it does not declare any explicit tool scope or permissions. In agent environments, missing scope declarations weaken user awareness and policy enforcement, making it easier for a seemingly simple skill to perform broader side effects than expected.
The skill description is entirely Chinese and the HKEX API example hard-codes lang: ZH, indicating a fixed language/locale behavior. The file does not offer users a language option or explain that the Chinese locale is required for a justified region-specific reason.
The natural-language/config content specifies lang: ZH for HKEX lookups, which enforces a locale choice. Under the stated policy, fixed language behavior should either be optional for the user or clearly justified as necessary for a region-specific compliance/tooling context.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
HEADERS_EASTMONEY = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",
"Referer": "https://data.eastmoney.com/notices/",
}
HEADERS_10JQKA = {
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
HEADERS_EASTMONEY = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",
"Referer": "https://data.eastmoney.com/notices/",
}
HEADERS_10JQKA = {
This code performs multiple local filesystem writes when --pdf is used: it creates directories, saves downloaded PDF files, and writes a manifest.json. Although the --pdf flag implies downloading, the script does not include any explicit warning, confirmation, or descriptive disclosure that these operations will write under /root/.openclaw/workspace/archive and modify local storage.
The skill documents that it will download PDFs and write them plus a manifest into a workspace archive, but it does not prominently warn users about these filesystem changes before execution. In agent settings, undisclosed file creation can surprise users, consume storage, and overwrite or clutter expected directories.
Natural-language strings in the module description and CLI help are presented only in Chinese, which can amount to forcing a specific language without user opt-in. There is no indication that the tool is region-specific or that users can select an alternate language/locale.
No suspicious patterns detected.