T09 · Insecure Skill Coding Practices
- Location
scripts/financial_report_fetcher.py:32- Finding
Financial report metadata and documents are retrieved over plaintext HTTP
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is mainly a financial-report downloader, but it has unsafe download/session-handling patterns that users should review before installing.
Install only in an isolated virtual environment or container, run as a non-privileged user, keep outputs in a dedicated directory, avoid authenticated Hibor/login workflows unless you secure session files yourself, and treat downloaded PDFs as untrusted until the downloader validates HTTPS, paths, content type, size, and PDF signatures.
scripts/financial_report_fetcher.py:32Financial report metadata and documents are retrieved over plaintext HTTP
scripts/financial_report_fetcher.py:137Remote announcement fields can escape the download directory and unvalidated content is parsed as PDF
SKILL.md:454Setup instructions install unpinned third-party packages and browser binaries
SKILL.md:314Documented browser login workflow stores bearer session state in a predictable plaintext file
总体领域相近,都是金融报告抓取,但声明明显高于代码实际能力。代码的核心功能是从巨潮资讯抓取公告 PDF,并可解析已下载 PDF,确实符合“上市公司年报抓取”的一部分;但它没有实现东方财富等其他数据源,也没有按公司名称或行业检索/批量处理的能力。CLI 中虽有 --research 和 --months 参数,但主流程完全未使用这些参数来实现研报抓取,因此“研报自动抓取”与实际不符。另外,所谓“内置反爬绕过”在代码中仅体现为随机 User-Agent、Referer 和延时,这更像基础伪装而非明确的绕过能力。基于这些重要功能差异,应判定描述与实际行为存在不匹配。
The skill describes network access, file reads/writes, and local storage of downloaded PDFs/metadata, but it does not declare an explicit tool scope or permission boundary. In an agent setting, missing scope declarations increase the chance of unintended capability use and make it harder for operators or users to understand what the skill can access.
The skill includes login simulation and credential-handling instructions for third-party sites, even though much of its stated purpose involves public filings that do not require authentication. This expands the attack surface to credential theft, insecure secret storage, and session persistence misuse, especially where storage_state files are written locally.
The skill encourages login simulation, cookie persistence, and bulk local downloads without prominent warnings about how credentials, cookies, and downloaded files will be stored and protected. In an agent environment, this can lead to accidental retention of sensitive session tokens or storage of large third-party data sets in unsafe locations.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
- **PDF 直链**: `https://pdf.dfcfw.com/pdf/H3_{infoCode}_1.pdf`
- 无需登录,直接 GET 即可下载
- 需检查 content-type 是否为 `application/pdf`,防止 404 返回 HTML
- **详情页**: `https://data.eastmoney.com/report/info/{infoCode}.html`
- **反爬**: 列表 API 无需登录、无反爬;PDF 直链也无需登录。页面抓取需 Playwright(JS 渲染)
### 行业代码参考
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
- **PDF 直链**: `https://pdf.dfcfw.com/pdf/H3_{infoCode}_1.pdf`
- 无需登录,直接 GET 即可下载
- 需检查 content-type 是否为 `application/pdf`,防止 404 返回 HTML
- **详情页**: `https://data.eastmoney.com/report/info/{infoCode}.html`
- **反爬**: 列表 API 无需登录、无反爬;PDF 直链也无需登录。页面抓取需 Playwright(JS 渲染)
### 行业代码参考
This section combines third-party page fetching with stealth/scraping automation intended to bypass anti-bot controls. In context, that is more risky than ordinary outbound access because it may trigger access-control circumvention behavior and increases exposure to untrusted remote content through a browser-like fetch path.
# 方式2:Scrapling stealth 模式(需要登录/有反爬时)
from scrapling.fetchers import StealthyFetcher
page = StealthyFetcher.fetch(
"https://data.eastmoney.com/report/{stock_code}.html",
headless=True,
solve_cloudflare=False,
timeout=30
The manifest describes a skill for automatically fetching listed-company annual reports and research reports by company code/name/year/industry, implying company-targeted financial-report retrieval. This file contains many generic industry, macro, hotel/catering, tourism, and consumer-service reports with empty stockName/stockCode fields, indicating the skill is collecting broad sector research rather than company-specific listed-company reports.
The module docstring includes an example using '--research', and the CLI defines '--research' as '研报模式(预留)'. However, the flag is never used in control flow, and the fetching logic always performs the same 巨潮公告/报告 search path. This documentation suggests a capability that the code does not actually provide.
The manifest describes a broader fetcher covering multiple sources, company code/name/year/industry batch download, and annual reports/research reports. In this file, the implemented retrieval logic is hard-coded to 巨潮资讯 endpoints and the CLI only accepts stock codes and years; there is no implementation for company-name lookup, industry-based retrieval, 东方财富 access, or research-report fetching.
The Accept-Language header is fixed to "zh-CN,zh;q=0.9,en;q=0.8", which imposes a specific locale preference for all requests. The file does not offer the user any language/locale opt-in or explain why this restriction is required, so it matches the language/locale policy violation category.
The manifest description and the rest of the skill instructions are presented entirely in Chinese, which effectively imposes a language constraint without any user opt-in or stated locale-specific justification. The policy requires flagging language or locale restrictions unless the skill offers a choice or clearly documents why the constraint is necessary.
This JSON file is primarily Chinese-language content, but the rating field at L1698 uses a mixed-language label "看好(Overweight)". Under the natural-language policy rule, forcing or introducing a specific language/locale convention without any visible opt-in or justification can be a locale consistency issue.
No suspicious patterns detected.