Trusted — Risk Score 5/100
Last scan:10 hr ago Rescan
5 /100
invoice-extractor
使用百度 OCR API 从发票图片和 PDF 中提取发票信息并导出到 Excel
这是一个功能完整、行为规范的发票 OCR 提取工具,所有代码行为与文档声明一致,无恶意行为。
Skill Nameinvoice-extractor
Duration30.0s
Enginepi
Safe to install
可直接使用。建议在 requirements.txt 中将 >= 改为具体版本号以增强供应链可预测性。

Findings 1 items

Severity Finding Location
Low
依赖版本未锁定次版本 Supply Chain
requirements.txt 使用 requests>=2.28.0 等范围版本,未锁定具体版本,可能引入供应链风险。
requests>=2.28.0
→ 建议改为 requests==2.31.0 等具体版本
requirements.txt:1
ResourceDeclaredInferredStatusEvidence
Filesystem READ WRITE ✓ Aligned src/excel_exporter.py:60 - 创建 output 目录和 Excel 文件
Network READ READ ✓ Aligned src/baidu_ocr_extractor.py - 仅向 api.baidubce.com 发送 OCR 请求
Environment READ READ ✓ Aligned src/config.py:14 - 仅读取 BAIDU_API_KEY/BAIDU_SECRET_KEY
9 findings
🔗
Medium External URL 外部 URL
https://cloud.baidu.com/product/ocr:
SKILL.md:29
🔗
Medium External URL 外部 URL
https://cloud.baidu.com/doc/OCR/index.html
SKILL.md:290
🔗
Medium External URL 外部 URL
https://cloud.baidu.com/product/ocr
config.template.txt:2
🔗
Medium External URL 外部 URL
https://python-poetry.org/docs/#installation
setup.md:93
🔗
Medium External URL 外部 URL
https://cloud.baidu.com/
setup.md:106
🔗
Medium External URL 外部 URL
https://aip.baidubce.com/rest/2.0/ocr/v1/vat_invoice
src/baidu_ocr_extractor.py:23
🔗
Medium External URL 外部 URL
https://aip.baidubce.com/rest/2.0/ocr/v1/accurate_basic
src/baidu_ocr_extractor.py:25
🔗
Medium External URL 外部 URL
https://aip.baidubce.com/oauth/2.0/token
src/baidu_ocr_extractor.py:49
📧
Info Email 邮箱地址
[email protected]
examples.md:338

File Tree

15 files · 101.6 KB · 3396 lines
Python 9f · 2171L Markdown 3f · 1170L Shell 1f · 44L Text 2f · 11L
├─ 📁 scripts
│ ├─ 🐍 batch_process.py Python 120L · 3.0 KB
│ └─ 🐍 verify_export.py Python 114L · 3.7 KB
├─ 📁 src
│ ├─ 🐍 baidu_ocr_extractor.py Python 367L · 13.8 KB
│ ├─ 🐍 config.py Python 105L · 3.6 KB
│ ├─ 🐍 excel_exporter.py Python 345L · 11.3 KB
│ ├─ 🐍 invoice_extractor.py Python 588L · 22.2 KB
│ ├─ 🐍 invoice_model.py Python 96L · 3.5 KB
│ ├─ 🐍 main_baidu.py Python 309L · 8.7 KB
│ └─ 🐍 main.py Python 127L · 3.6 KB
├─ 📄 config.template.txt Text 6L · 196 B
├─ 📝 examples.md Markdown 504L · 10.4 KB
├─ 🔧 install.sh Shell 44L · 1.2 KB
├─ 📄 requirements.txt Text 5L · 83 B
├─ 📝 setup.md Markdown 376L · 9.0 KB
└─ 📝 SKILL.md Markdown 290L · 7.4 KB

Dependencies 5 items

PackageVersionSourceKnown VulnsNotes
requests >=2.28.0 pip No 次版本未锁定
pandas >=2.0.0 pip No 次版本未锁定
openpyxl >=3.1.0 pip No 次版本未锁定
PyMuPDF >=1.23.0 pip No 次版本未锁定
Pillow >=10.0.0 pip No 次版本未锁定

Security Positives

✓ 文档完整且与代码行为完全一致,无阴影功能
✓ 仅访问 config.txt 读取 API 凭证,无敏感路径遍历
✓ 网络请求仅指向百度官方 OCR API 端点 (aip.baidubce.com)
✓ 无 base64 解码执行、无反向 shell、无凭证收割等高危模式
✓ base64 仅用于将图片编码为 API 请求体,属于正常用途
✓ install.sh 仅执行本地 pip install,无远程脚本执行
✓ 代码结构清晰,无混淆或隐藏逻辑