Scan Report
5 /100
invoice-extractor
使用百度 OCR API 从发票图片和 PDF 中提取发票信息并导出到 Excel
这是一个功能完整、行为规范的发票 OCR 提取工具,所有代码行为与文档声明一致,无恶意行为。
Safe to install
可直接使用。建议在 requirements.txt 中将 >= 改为具体版本号以增强供应链可预测性。
Findings 1 items
| Severity | Finding | Location |
|---|---|---|
| Low | 依赖版本未锁定次版本 Supply Chain | requirements.txt:1 |
| Resource | Declared | Inferred | Status | Evidence |
|---|---|---|---|---|
| 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
│ └─
verify_export.py
Python
├─
▾
src
│ ├─
baidu_ocr_extractor.py
Python
│ ├─
config.py
Python
│ ├─
excel_exporter.py
Python
│ ├─
invoice_extractor.py
Python
│ ├─
invoice_model.py
Python
│ ├─
main_baidu.py
Python
│ └─
main.py
Python
├─
config.template.txt
Text
├─
examples.md
Markdown
├─
install.sh
Shell
├─
requirements.txt
Text
├─
setup.md
Markdown
└─
SKILL.md
Markdown
Dependencies 5 items
| Package | Version | Source | Known Vulns | Notes |
|---|---|---|---|---|
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,无远程脚本执行
✓ 代码结构清晰,无混淆或隐藏逻辑