扫描报告
15 /100
zhihu-fetcher
知乎热榜数据抓取工具,支持三级认证降级(Browser Profile → File Cookie → Fallback Source),数据存储至 SQLite 并可生成 HTML 可视化报告
知乎热榜数据采集工具,代码逻辑清晰透明,核心功能(抓取→存储→查询→可视化)均为声明范围内。唯一风险点是固化 cookie 凭证存储在配置文件中随代码分发,SKILL.md 有安全警告但未在 allowed-tools 中声明 shell/network 权限。
可以安装
建议:1) 将 config/fallback-sources.json 从代码库分离,由 .gitignore 排除;2) SKILL.md 补充 allowed-tools 声明(shell:WRITE, network:READ, filesystem:WRITE);3) 将 fallback 源 URL 列表从配置中移至白名单。
安全发现 3 项
| 严重性 | 安全发现 | 位置 |
|---|---|---|
| 低危 | browser_profile 认证方式为存根实现 文档欺骗 | snippets/fetch-hot.js:38 |
| 低危 | 第三方依赖无版本锁定 供应链 | snippets/fetch-hot.js:1 |
| 提示 | 凭证以配置文件形式存储 敏感访问 | config/fallback-sources.json:6 |
| 资源类型 | 声明权限 | 推断权限 | 状态 | 证据 |
|---|---|---|---|---|
| 命令执行 | NONE | WRITE | ✗ 越权 | scripts/save_to_db.py:48 — subprocess.run(['node', ...]) |
| 网络访问 | NONE | READ | ✗ 越权 | snippets/fetch-hot.js, snippets/cookie-manager.js — HTTPS请求到 zhihu.com |
| 文件系统 | NONE | WRITE | ✗ 越权 | scripts/init_db.py, scripts/db.py, scripts/generate_html.py — 创建目录、SQLite、HTML文件 |
| 环境变量 | NONE | NONE | — | 未访问 os.environ |
| 浏览器 | NONE | NONE | — | SKILL.md 声明 browser_profile 为认证方式,但 fetchWithBrowser() 只抛出错误提示,实际未使用浏览器 |
1 高危 30 项发现
高危 IP 地址 硬编码 IP 地址
120.0.0.0 snippets/cookie-manager.js:64 中危 外部 URL 外部 URL
https://www.zhihu.com SKILL.md:41 中危 外部 URL 外部 URL
https://api.example.com/zhihu-hot.json SKILL.md:299 中危 外部 URL 外部 URL
https://www.zhihu.com/question/2016604377415120691 data/index.html:274 中危 外部 URL 外部 URL
https://www.zhihu.com/question/2016607467954467246 data/index.html:274 中危 外部 URL 外部 URL
https://www.zhihu.com/question/2016444661095424928 data/index.html:274 中危 外部 URL 外部 URL
https://www.zhihu.com/question/2016214590560625837 data/index.html:274 中危 外部 URL 外部 URL
https://www.zhihu.com/question/2016458550067613931 data/index.html:274 中危 外部 URL 外部 URL
https://www.zhihu.com/question/2016267906896322825 data/index.html:274 中危 外部 URL 外部 URL
https://www.zhihu.com/question/398694606 data/index.html:274 中危 外部 URL 外部 URL
https://www.zhihu.com/question/2015113794855142897 data/index.html:274 中危 外部 URL 外部 URL
https://www.zhihu.com/question/2015300831826690616 data/index.html:274 中危 外部 URL 外部 URL
https://www.zhihu.com/question/2015024147378500415 data/index.html:274 中危 外部 URL 外部 URL
https://www.zhihu.com/question/2015804010213373773 data/zhihu-hot-2026-03-15.json:10 中危 外部 URL 外部 URL
https://www.zhihu.com/question/2015910417793320691 data/zhihu-hot-2026-03-15.json:11 中危 外部 URL 外部 URL
https://www.zhihu.com/question/2016280494870853302 data/zhihu-hot-2026-03-15.json:12 中危 外部 URL 外部 URL
https://www.zhihu.com/question/455135036 data/zhihu-hot-2026-03-15.json:13 中危 外部 URL 外部 URL
https://www.zhihu.com/question/2016099547433161361 data/zhihu-hot-2026-03-15.json:14 中危 外部 URL 外部 URL
https://www.zhihu.com/question/2015551066716989113 data/zhihu-hot-2026-03-15.json:16 中危 外部 URL 外部 URL
https://www.zhihu.com/question/2016526047311577504 data/zhihu-hot-2026-03-15.json:18 中危 外部 URL 外部 URL
https://zhihu.com/question/1 scripts/db.py:177 中危 外部 URL 外部 URL
https://zhihu.com/question/2 scripts/db.py:178 中危 外部 URL 外部 URL
https://www.zhihu.com/hot snippets/browser-research.js:5 中危 外部 URL 外部 URL
https://www.zhihu.com/api/v3/feed/topstory/hot-list-web?limit=$ snippets/cookie-manager.js:115 中危 外部 URL 外部 URL
https://www.zhihu.com/question/$ snippets/cookie-manager.js:132 中危 外部 URL 外部 URL
https://www.zhihu.com/ snippets/research-anti-crawl.js:38 中危 外部 URL 外部 URL
https://www.zhihu.com/api/v3/feed/topstory/hot-list-web?limit=3 snippets/test-hot-structure.js:83 中危 外部 URL 外部 URL
https://api.zhihu.com/people/self snippets/test-zhihu-vapi-style.js:7 中危 外部 URL 外部 URL
https://www.zhihu.com/api/v3/feed/topstory/hot-list-web?limit=10 snippets/test-zhihu-vapi-style.js:160 中危 外部 URL 外部 URL
https://api.zhihu.com/topstory/hot-list?limit=10 snippets/test-zhihu-vapi-style.js:161 目录结构
25 文件 · 100.4 KB · 3260 行 JavaScript 15f · 1412L
Python 5f · 1037L
HTML 1f · 386L
Markdown 1f · 366L
JSON 3f · 59L
├─
▾
config
│ └─
fallback-sources.json
JSON
├─
▾
data
│ ├─
index.html
HTML
│ └─
zhihu-hot-2026-03-15.json
JSON
├─
▾
scripts
│ ├─
db.py
Python
│ ├─
generate_html.py
Python
│ ├─
init_db.py
Python
│ ├─
query.py
Python
│ └─
save_to_db.py
Python
├─
▾
snippets
│ ├─
browser-research.js
JavaScript
│ ├─
cookie-manager.js
JavaScript
│ ├─
fallback.js
JavaScript
│ ├─
fetch-hot.js
JavaScript
│ ├─
hot.js
JavaScript
│ ├─
rate-limiter.js
JavaScript
│ ├─
research-anti-crawl.js
JavaScript
│ ├─
search.js
JavaScript
│ ├─
setup-cookie.js
JavaScript
│ ├─
test-fallback.js
JavaScript
│ ├─
test-file-cookie.js
JavaScript
│ ├─
test-fixed-cookie.js
JavaScript
│ ├─
test-hot-structure.js
JavaScript
│ ├─
test-simple.js
JavaScript
│ └─
test-zhihu-vapi-style.js
JavaScript
├─
_meta.json
JSON
└─
SKILL.md
Markdown
依赖分析 3 项
| 包名 | 版本 | 来源 | 已知漏洞 | 备注 |
|---|---|---|---|---|
sqlite3 | built-in | python stdlib | 否 | Python 标准库,无需安装 |
Node.js 标准库 | N/A | node built-in (fs, https, path, crypto) | 否 | 仅使用 Node.js 内置模块,无第三方依赖 |
requests | N/A | N/A | 否 | 未使用 requests 库,所有 HTTP 请求均为 Node.js 原生实现 |
安全亮点
✓ 代码结构清晰,所有脚本均为单一功能模块,无复杂混淆逻辑
✓ 数据库操作仅使用 sqlite3 标准库,无 ORM 依赖
✓ HTML 报告生成使用内嵌模板,无模板注入风险
✓ 热榜数据输出为纯 JSON,无序列化代码执行路径
✓ 配置中的 fallback 源 URL 仅指向 github.com 和 zhihu.com,无可疑外部域名
✓ 未发现 base64/eval/动态代码执行等高危混淆技术
✓ rate-limiter 模块提供了合理的请求频率控制
✓ SKILL.md 有中文/英文双语说明,文档质量较好
✓ z_c0 凭证字段为空,降低了凭证泄露的潜在影响