Files
SnapOtter/packages/ai/python/requirements.txt
T
SnapOtterandGitHub 5d5117acf7 fix(deps): close js-yaml DoS alert + document rembg non-reachability (#286)
* fix(deps): patch gray-matter onto js-yaml 4.2.0 (close js-yaml DoS alert)

js-yaml 3.14.2 (quadratic-complexity DoS in merge-key handling, GHSA
patched only in 4.2.0) was kept in the tree by a scoped pnpm override
"gray-matter>js-yaml": "^3.14.1" that exempted gray-matter from the
global js-yaml>=4.2.0 override. gray-matter is a build-time-only
transitive dep of the docs site (vitepress-plugin-llms,
@sugarat/theme-shared) and pinned 3.x because it calls the removed
yaml.safeLoad / yaml.safeDump APIs.

Remove the exemption so gray-matter resolves js-yaml 4.2.0, and add a
pnpm patch renaming safeLoad->load / safeDump->dump (the 4.x
equivalents; load is safe by default). js-yaml 3.x is now gone from the
lockfile.

Verified: gray-matter parse+stringify smoke test passes on 4.2.0; full
VitePress docs build green (177 pages, llms plugin parses all tool
frontmatter with no safeLoad/safeDump error).

* docs(ai): document rembg 2.0.69 pin and advisory non-reachability

The patched rembg 2.0.75 pulls a numpy 2.x closure (numpy>=2.3,
scipy>=1.16, scikit-image>=0.26) that is incompatible with the
numpy==1.26.4-locked AI stack (realesrgan 0.3.0 and codeformer-pip 0.0.4
break on numpy 2.x). Both open rembg advisories are unreachable in this
codebase: rembg is used purely as a library (never the `rembg s`
server), and new_session() only receives allowlisted model names
(remove_bg.py ALLOWED_MODELS), never user-controlled paths. Record this
rationale next to the pin; the Dependabot alerts are dismissed as
not_used.
2026-06-21 23:24:10 +08:00

18 lines
745 B
Plaintext

# rembg is pinned to 2.0.69. The patched 2.0.75 (GHSA: server SSRF/CORS +
# custom-model path traversal) pulls numpy>=2.3, scipy>=1.16 and
# scikit-image>=0.26 -- a numpy 2.x closure that is incompatible with this
# numpy==1.26.4-locked stack (realesrgan 0.3.0 and codeformer-pip 0.0.4 break
# on numpy 2.x). Both advisories are unreachable here: rembg is used purely as
# a library (we never run `rembg s`), and new_session() only ever receives
# allowlisted model names (remove_bg.py ALLOWED_MODELS), never user paths.
rembg[cpu]==2.0.69
realesrgan==0.3.0
paddleocr[doc-parser]>=3.4.0,<3.5.0
paddlepaddle>=3.0.0,<3.1.0
mediapipe>=0.10.21
onnxruntime==1.20.1
numpy==1.26.4
Pillow==12.2.0
opencv-python-headless==4.10.0.84
codeformer-pip==0.0.4