python-rapidocr
The non-standard host (modelscope.cn) hosts model files, which are static data assets required for OCR functionality; these are not executable code, and the package builds from the project's own source, making the risk low despite the untrusted host.
Triggered rules
llm_review
The static rules flagged this MEDIUM, but an AI model (qwen/qwen3-235b-a22b-2507) reviewed the full PKGBUILD and judged it LOW (confidence 95%): The non-standard host (modelscope.cn) hosts model files, which are static data assets required for OCR functionality; these are not executable code, and the package builds from the project's own source, making the risk low despite the untrusted host.
1 higher static finding superseded - not the current verdict (shown for transparency)
source_untrusted_domain
One or more source=() URLs point to a host outside the trusted allowlist (github.com, gitlab.com, codeberg.org, pypi.org, …).
-
PKGBUILD:32
'https://www.modelscope.cn/models/RapidAI/RapidOCR/resolve/v3.9.0/onnx/PP-OCRv6/det/PP-OCRv6_det_small.onnx'
PKGBUILD
1 offending line(s) highlighted# Maintainer: aliu <AA RON LIU <GMAIL.COM> >
pkgname=python-rapidocr
pkgver=3.9.1
pkgrel=1
pkgdesc='Cross-runtime OCR library'
arch=('any')
license=('Apache-2.0')
depends=('python>=3.8'
'python-pyclipper>=1.2.0'
'python-opencv>=4.5.1.48'
'python-numpy>=1.19.5' 'python-numpy<3.0.0'
'python-six>=1.15.0'
'python-shapely>=1.7.1' #'python-shapely!=2.0.4'
'python-yaml'
'python-pillow'
'python-tqdm'
'python-omegaconf'
'python-requests'
'python-colorlog')
optdepends=(
# Operation requires at least one of these and adjusted engine_type config
'python-onnxruntime: Recommended runtime'
'python-onnxruntime-cpu: Faster than GPU-accelerated onnxruntime (https://github.com/microsoft/onnxruntime/issues/13198)'
'python-openvino: Supported runtime'
'python-paddlepaddle: Supported runtime'
'python-pytorch: Supported runtime'
)
makedepends=('python-build' 'python-installer>=1.0.1' 'python-setuptools')
url='https://github.com/RapidAI/RapidOCR'
source=("https://github.com/RapidAI/RapidOCR/archive/v${pkgver}.tar.gz"
# models bundled in PyPI wheel, from default_models.yaml
'https://www.modelscope.cn/models/RapidAI/RapidOCR/resolve/v3.9.0/onnx/PP-OCRv6/det/PP-OCRv6_det_small.onnx'
'https://www.modelscope.cn/models/RapidAI/RapidOCR/resolve/v3.9.0/onnx/PP-OCRv4/cls/ch_ppocr_mobile_v2.0_cls_mobile.onnx'
'https://www.modelscope.cn/models/RapidAI/RapidOCR/resolve/v3.9.0/onnx/PP-OCRv6/rec/PP-OCRv6_rec_small.onnx'
# patch-in version number
'pyproject.toml.patch')
b2sums=('55a3f0e43f0a9d5efdb1fe9acea4ba303b01189ecde92934ac79b067d4d7de827a6d57bb3501a952584956e8de4106fb1ef6df9fc4bfa88192865a32fd54e20d'
'22409f1a00b806c03ceefa0a75bb6c43950e7627f33348944ac769a71b9ee8caa6d3142021a56e0a668a13f9ac14fb3486257293397a1c4c32494ca422b25f82'
'f0c251313ce88e8ce74ebc995e3d7488541727ac9d242db4089bef7c131b0a8d59e7a322b592f5f07e5702e8d58e232510103f18438b5cb8cbfbb285cd3290a6'
'267c40f15280dcfac6930ef69d3106c950c425c1af76c776eedda4fbba7133676b9490f503a212fe73b97f2fd87808430f49bfc6ffda1eadc1f940d0b2a6a84a'
'06fdefd3dd0357eec4b82c84ee12369231c2182e005f4b2053077377014fb538981a5b0fb48fa1b53352b736866a86a2fb3367fcc65ba9f283bd796bd5f252d3')
prepare() {
cd "${srcdir}/RapidOCR-${pkgver}/python"
# Patch in version number without needing to install a nonce dependency
# that fetches the version number from git
patch < "${srcdir}/pyproject.toml.patch"
sed -i "s/VERSION_NUM/\"${pkgver}\"/" pyproject.toml
rm rapidocr/models/.gitkeep # i don't like you
# From prepare_wheel_assets.py, run by gen_whl_to_pypi_rapidocr GH Action
mv "${srcdir}/"*.onnx -t rapidocr/models/
cat <<- EOF > MANIFEST.in
include rapidocr/models/PP-OCRv6_det_small.onnx
include rapidocr/models/ch_ppocr_mobile_v2.0_cls_mobile.onnx
include rapidocr/models/PP-OCRv6_rec_small.onnx
EOF
}
build() {
cd "${srcdir}/RapidOCR-${pkgver}/python"
python -m build --wheel --no-isolation
}
check() {
cd "${srcdir}/RapidOCR-${pkgver}/python/build/lib"
if [[ -f /etc/rapidocr/config.yaml ]]; then # Test with old config
mv {rapidocr,"${srcdir}"}/config.yaml
cp /etc/rapidocr/config.yaml rapidocr/config.yaml
cp /usr/lib/python*/site-packages/rapidocr/models/*.onnx --update=none rapidocr/models/
fi
PYTHONPATH="$PWD" python -m rapidocr.main check
}
package() {
cd "${srcdir}/RapidOCR-${pkgver}/python"
python -m installer --destdir="${pkgdir}" dist/*.whl
# Move config file to /etc
mkdir -p "${pkgdir}/etc/rapidocr/"
if [[ -f "${srcdir}/config.yaml" ]]; then # created backup during check()
mv {"${srcdir}","${pkgdir}"/etc/rapidocr}/config.yaml
rm "${pkgdir}"/usr/lib/python*/site-packages/rapidocr/config.yaml
else
mv "${pkgdir}"/usr/lib/python*/site-packages/rapidocr/config.yaml "${pkgdir}"/etc/rapidocr/config.yaml
fi
ln -s /etc/rapidocr/config.yaml "$(ls -d "${pkgdir}"/usr/lib/python*/site-packages/rapidocr)/config.yaml"
}
Scan history
| Scanned at (UTC) | Severity | Rules |
|---|---|---|
| 2026-09-17 00:27:14 | Low | 2 |
| 2026-09-16 00:03:17 | Low | 2 |
| 2026-09-15 00:25:31 | Low | 2 |
| 2026-09-14 00:27:57 | Low | 2 |
| 2026-09-13 00:19:54 | Low | 2 |
| 2026-09-12 00:25:17 | Low | 2 |
| 2026-09-11 00:19:22 | Low | 2 |
| 2026-09-10 00:22:44 | Low | 2 |
| 2026-09-09 00:04:09 | Low | 2 |
| 2026-09-08 00:18:08 | Low | 2 |
| 2026-09-07 00:30:15 | Low | 2 |
| 2026-09-06 00:17:06 | Low | 2 |
| 2026-09-05 00:16:27 | Low | 2 |
| 2026-09-04 00:03:13 | Low | 2 |
| 2026-09-03 00:15:47 | Low | 2 |
| 2026-09-02 00:02:31 | Low | 2 |
| 2026-09-01 00:11:19 | Low | 2 |
| 2026-08-31 00:19:57 | Low | 2 |
| 2026-08-30 00:04:14 | Low | 2 |
| 2026-08-29 00:29:17 | Low | 2 |