~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.
Python academiaanthropicarxivbravedeep-researchencryptionhome-automationhomeserverlocallocal-deep-researchlocal-llmmistralollamaopenaipubmedresearchresearch-toolretrieval-augmented-generationsearxngself-hosted
build(security): hash-lock the bootstrap pip installs (Scorecard Pinned-Dependencies) (#6632)
LearningCircuit390767907308
diff --git a/.file-whitelist.txt b/.file-whitelist.txtindex ab20f60444..acbc4ffa21 100644--- a/.file-whitelist.txt+++ b/.file-whitelist.txt@@ -61,6 +61,12 @@^community_benchmark_results/.*\.yaml$^cookiecutter-docker/.*\.yml$+# ---------------------------------------------------------------------------+# Hash-locked bootstrap requirements (installed with --require-hashes by the+# Dockerfile and CI workflows; see the file headers)+# ---------------------------------------------------------------------------+^requirements/.*\.txt$+# ---------------------------------------------------------------------------# Shell scripts — path-scoped# ---------------------------------------------------------------------------diff --git a/.github/workflows/milvus-tests.yml b/.github/workflows/milvus-tests.ymlindex f99e3959b2..62d8726488 100644--- a/.github/workflows/milvus-tests.yml+++ b/.github/workflows/milvus-tests.yml@@ -186,8 +186,10 @@ jobs:id: installif: steps.check-milvus.outputs.milvus_exists == 'true'run: |- python -m pip install pip==26.2- pip install pdm==2.26.2+ # Hash-locked bootstrap (Scorecard Pinned-Dependencies, alerts+ # #8270/#8271): pip 26.2 + pdm 2.26.2 with every wheel sha256-pinned+ # in requirements/bootstrap-ci.txt (covers this runner's CPython 3.12).+ python -m pip install --require-hashes -r requirements/bootstrap-ci.txt# Bare locked install — no `-G milvus` and no `--dev`. See (a) in# the header: `-G` on a declared-but-unlocked group is a harddiff --git a/.gitignore b/.gitignoreindex a7bd35c64c..c9125155d0 100644--- a/.gitignore+++ b/.gitignore@@ -26,6 +26,10 @@ src/local_deep_research/web/static/css/themes.css!docs/**/*.sh!examples/**/*.sh+# Hash-locked bootstrap requirements (installed with --require-hashes by the+# Dockerfile and CI workflows; see the file headers and .file-whitelist.txt)+!requirements/*.txt+# Templates, Jinja2, XML — explicit paths# NOTE: .env.template has a leading-dot basename, so the `.*` catch-all# below would re-ignore it -- it is re-allowed in the post-catch-all blockdiff --git a/Dockerfile b/Dockerfileindex 44165dfa02..045eeb529f 100644--- a/Dockerfile+++ b/Dockerfile@@ -58,22 +58,26 @@ RUN apt-get update -o Acquire::Retries=3 && apt-get upgrade -y -o Acquire::Retri&& apt-get install -y --no-install-recommends nodejs \&& rm -rf /var/lib/apt/lists/*-# Install dependencies and tools (pinned versions for reproducibility)-# Pin pip, pdm, and playwright to specific versions for OSSF Scorecard compliance+# Install dependencies and tools (hash-locked for reproducibility ++# OSSF Scorecard Pinned-Dependencies compliance).# Note: hishel<1.0.0 is required due to https://github.com/pdm-project/pdm/issues/3657# Note: wheel>=0.46.2 is required for CVE-2026-24049 fix (path traversal)-# Note: Scorecard's Pinned-Dependencies rule additionally wants per-package-# --hash= or --require-hashes here. We considered hash-pinning the bootstrap-# layer but rejected it: hash-locking pip itself has repeatedly broken-# rebuilds (mirror/wheel-tag drift across CI runs). The base image's pip is-# already verified, and we re-pin to a CVE-fixed version immediately. The-# three resulting Scorecard alerts (#7740, #7741, #7742) are dismissed as-# won't-fix; revisit if a stable hash-locking workflow becomes available.# Note: pip 26.2 fixes CVE-2026-13346 (arbitrary file installation through a# malicious package index). It also retains the CVE-2026-8643,# CVE-2026-1703, and GHSA-jp4c-xjxw-mgf9 fixes from earlier releases.-RUN pip3 install --no-cache-dir pip==26.2 \- && pip install --no-cache-dir pdm==2.26.2 "hishel<1.0.0" playwright==1.62.0 "wheel>=0.46.2"+#+# Every package is installed with --require-hashes from+# requirements/bootstrap-builder.txt (sha256-pinned per wheel, covering+# cp314 linux amd64+aarch64). This closes the Pinned-Dependencies alerts+# (#8205, #8206) and supersedes the earlier won't-fix stance documented here+# (#7740-#7742): the historical objection was that hash-locking pip itself+# broke rebuilds on mirror/wheel-tag drift — with a fully enumerated,+# multi-platform hash set a drift now fails the build loudly instead of+# silently resolving something else, which is the desired behavior. Rotate+# via the regeneration recipe in the file header.+COPY requirements/bootstrap-builder.txt /tmp/bootstrap-builder.txt+RUN pip3 install --no-cache-dir --require-hashes -r /tmp/bootstrap-builder.txt \+ && rm /tmp/bootstrap-builder.txt# disable update checkENV PDM_CHECK_UPDATE=false# Increase PDM request timeout from default 15s to 120s for large packages (numpy, torch)@@ -304,9 +308,11 @@ ARG DEBIAN_FRONTEND=noninteractive# Pin pip to 26.2 for the CVE-2026-13346 malicious-index fix and the earlier# CVE-2026-8643, CVE-2026-1703, and GHSA-jp4c-xjxw-mgf9 fixes.-# See builder-stage rationale above for why this install is not hash-pinned-# — Scorecard alert #7742 dismissed as won't-fix on the same basis.-RUN pip3 install --no-cache-dir pip==26.2+# Hash-locked (Scorecard Pinned-Dependencies, alert #8207): same rationale as+# the builder-base bootstrap above.+COPY requirements/bootstrap-runtime.txt /tmp/bootstrap-runtime.txt+RUN pip3 install --no-cache-dir --require-hashes -r /tmp/bootstrap-runtime.txt \+ && rm /tmp/bootstrap-runtime.txt# Install runtime dependencies for SQLCipher and WeasyPrint.# `apt-get upgrade -y` is INTENTIONAL — see rationale on the builder-basediff --git a/requirements/bootstrap-builder.txt b/requirements/bootstrap-builder.txtnew file mode 100644index 0000000000..d3a7d66037--- /dev/null+++ b/requirements/bootstrap-builder.txt@@ -0,0 +1,150 @@+# Hash-locked bootstrap requirements (OSSF Scorecard Pinned-Dependencies).+#+# Installed with: pip install --require-hashes -r <this file>+# Every byte of the bootstrap toolchain is verified against a reviewed+# sha256. Hashes cover CPython 3.12 (CI runner) and CPython 3.14 (image)+# wheels for linux amd64 and aarch64 as applicable; pure-python wheels are+# shared, platform/abi wheels list one --hash line per artifact.+#+# Regenerate:+# pip download <roots> --only-binary=:all: --python-version <3.12|3.14>+# --implementation cp+# --platform manylinux2014_x86_64 --platform manylinux_2_17_x86_64+# [--platform manylinux2014_aarch64 --platform manylinux_2_17_aarch64]+# -d /tmp/hashes+# then re-emit "name==version" with one "--hash=sha256:<digest>" line per+# wheel (run per platform/abi and merge, so tagged wheels carry every hash).+#+# Rotate by bumping the roots to the reviewed versions and regenerating;+# a drifted mirror or wheel-tag makes the install FAIL loudly (by design).+#+# Used by: Dockerfile (builder-base) - pip, pdm, hishel (<1.0.0, pdm#3657),+# playwright 1.62.0, wheel (image Python 3.14).+++anyio==4.15.1 \+ --hash=sha256:6152fdbbf9a77fdec97731721bebf7c4c44f7c29b424b0065826173efc7ed101++anysqlite==0.0.5 \+ --hash=sha256:cb345dc4f76f6b37f768d7a0b3e9cf5c700dfcb7a6356af8ab46a11f666edbe7++blinker==1.9.0 \+ --hash=sha256:ba0efaa9080b619ff2f3459d1d500c57bddea4a6b424b60a91141db6fd2f08bc++certifi==2026.7.22 \+ --hash=sha256:62f22742b58a1a33014a2b6b706588a8d7e2a88ae7bd1a6ebe8c992928483775++dep-logic==0.7.2 \+ --hash=sha256:33640c4ba7fd45f2504442eb9e0c12e57dac253c748ca3925749548a5c556bae++distlib==0.4.3 \+ --hash=sha256:4b0ce306c966eb73bc3a7b6abad017c556dadd92c44701562cd528ac7fde4d5b++filelock==3.32.7 \+ --hash=sha256:65ff0d0190ea42038b32bda4b77834fb05be2cad4c5b9b01aa4dfb3614536e52++findpython==0.8.0 \+ --hash=sha256:4a61ee1618a8b55014f7d41f59345d322be93f6ce62395bdccccc651b3f7e28a++greenlet==3.5.6 \+ --hash=sha256:c59acfa8eb73a1e0d484392dc002bdf001fd4ce73394e0132df3d1ab6093d7cb \+ --hash=sha256:9a09d59bef1db94f384b5bcc2d523694d338f3df6b757aeeaf7baca5d0c0be88++h11==0.16.0 \+ --hash=sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86++hishel==0.1.5 \+ --hash=sha256:0bfbe9a2b9342090eba82ba6de88258092e1c4c7b730cd4cb4b570e4b40e44a7++httpcore==1.0.9 \+ --hash=sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55++httpx==0.28.1 \+ --hash=sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad++id==1.6.1 \+ --hash=sha256:f5ec41ed2629a508f5d0988eda142e190c9c6da971100612c4de9ad9f9b237ca++idna==3.20 \+ --hash=sha256:ab7ae7122974553370f0bdb919e1a960b2cd1bc1ef0276416d896db81c14582c++installer==0.7.0 \+ --hash=sha256:05d1933f0a5ba7d8d6296bb6d5018e7c94fa473ceb10cf198a92ccea19c27b53++markdown-it-py==4.2.0 \+ --hash=sha256:9f7ebbcd14fe59494226453aed97c1070d83f8d24b6fc3a3bcf9a38092641c4a++mdurl==0.1.2 \+ --hash=sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8++msgpack==1.2.2 \+ --hash=sha256:77c2e018417dc1d66f235e383877ee885b60ade9d29e494dd581e08af2cb1923 \+ --hash=sha256:8dc4487097571f7311188c3eca2a3e86cd1f1db4c37c7a017bcc3fd38486cbfe \+ --hash=sha256:73b0e05c32c3cfc3cd84994908e57430c0ebc6813abf905d3f18ff115d54df3f++packaging==26.3 \+ --hash=sha256:d7193f7c8e4e93f444fde0262bf90af30e16fa0ad0ad44cb553c87339b23cd1c++pbs-installer==2026.9.1 \+ --hash=sha256:d2c320a11e0313f559f4338fad3f698345d200d0506053c75d266730b2507dcb++pdm==2.26.2 \+ --hash=sha256:b3b0199f6eec37284192a6feb26bef21f911d45d5aa4b02323ff211752abf04b++pip==26.2 \+ --hash=sha256:931c303696af6fa3417112103b1cad26890e5a07eccb5b99783700e33f2b8aad++platformdirs==4.11.10 \+ --hash=sha256:973c4c082b964958c71588448488d2b14fb253893dfbdb82325a14c84e540e8f++playwright==1.62.0 \+ --hash=sha256:ba33bae6a13b3d9d354c751cb618af357d20fe1d57767cbcce52079bbef17ad3 \+ --hash=sha256:db2d76613a57ad844362ce42f7d0c2fa26b19a4f7a46d4f76b891c631e6e5aff++pyee==13.0.1 \+ --hash=sha256:af2f8fede4171ef667dfded53f96e2ed0d6e6bd7ee3bb46437f77e3b57689228++pygments==2.21.0 \+ --hash=sha256:2363c69b61c4a97c838da3b130dcd6468f4848992b21a82f2a63ec34377137d9++pyproject-hooks==1.3.3 \+ --hash=sha256:5fc53fdac9f7bd63fbcdc868fb5f90b4784d78a53a3d3388cd738b807441a20b++python-discovery==1.6.1 \+ --hash=sha256:d43fcdef879fe795352bd13ccf8d185ba5a9f86f36cfcd00529f596e737442b3++python-dotenv==1.2.3 \+ --hash=sha256:904552145e8bfed22162c09dab1c2b9b54fefa7b23ba780f4f26ca0316b0f0d9++resolvelib==1.2.1 \+ --hash=sha256:fb06b66c8da04172d9e72a21d7d06186d8919e32ae5ab5cdf5b9d920be805ac2++rich==15.0.0 \+ --hash=sha256:33bd4ef74232fb73fe9279a257718407f169c09b78a87ad3d296f548e27de0bb++shellingham==1.5.4 \+ --hash=sha256:7ecfff8f2fd72616f7481040475a65b2bf8af90a56c89140852d1120324e8686++socksio==1.0.0 \+ --hash=sha256:95dc1f15f9b34e8d7b16f06d74b8ccf48f609af32ab33c608d08761c5dcbb1f3++tomlkit==0.15.1 \+ --hash=sha256:177a05aece5a8ca5266fd3c448abb47b8d352f09d477d3ca8332db4d89b24304++truststore==0.10.4 \+ --hash=sha256:adaeaecf1cbb5f4de3b1959b42d41f6fab57b2b1666adb59e89cb0b53361d981++typing-extensions==4.16.0 \+ --hash=sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8++unearth==0.18.3 \+ --hash=sha256:306773b7a792af7d44b3b2a3bea21ba63a0b947546ad8ee793194fd09a6ae020++urllib3==2.8.0 \+ --hash=sha256:0cf3cae568d36aa9576b28dfb35f11328f1cb974ca7647d9475ebb86c75ac6e3++virtualenv==21.7.15 \+ --hash=sha256:b7fa004650941c5f4b8035c981673ba2fc88189543c86db05ace77878804202d++wheel==0.48.0 \+ --hash=sha256:3217dcc807155e45db462d7ef2431f5ddda0d7273b700d05a67b271ceb1287abdiff --git a/requirements/bootstrap-ci.txt b/requirements/bootstrap-ci.txtnew file mode 100644index 0000000000..65d391ac00--- /dev/null+++ b/requirements/bootstrap-ci.txt@@ -0,0 +1,135 @@+# Hash-locked bootstrap requirements (OSSF Scorecard Pinned-Dependencies).+#+# Installed with: pip install --require-hashes -r <this file>+# Every byte of the bootstrap toolchain is verified against a reviewed+# sha256. Hashes cover CPython 3.12 (CI runner) and CPython 3.14 (image)+# wheels for linux amd64 and aarch64 as applicable; pure-python wheels are+# shared, platform/abi wheels list one --hash line per artifact.+#+# Regenerate:+# pip download <roots> --only-binary=:all: --python-version <3.12|3.14>+# --implementation cp+# --platform manylinux2014_x86_64 --platform manylinux_2_17_x86_64+# [--platform manylinux2014_aarch64 --platform manylinux_2_17_aarch64]+# -d /tmp/hashes+# then re-emit "name==version" with one "--hash=sha256:<digest>" line per+# wheel (run per platform/abi and merge, so tagged wheels carry every hash).+#+# Rotate by bumping the roots to the reviewed versions and regenerating;+# a drifted mirror or wheel-tag makes the install FAIL loudly (by design).+#+# Used by: .github/workflows/milvus-tests.yml - pip + pdm on the Python 3.12 runner.+++anyio==4.15.1 \+ --hash=sha256:6152fdbbf9a77fdec97731721bebf7c4c44f7c29b424b0065826173efc7ed101++anysqlite==0.0.5 \+ --hash=sha256:cb345dc4f76f6b37f768d7a0b3e9cf5c700dfcb7a6356af8ab46a11f666edbe7++blinker==1.9.0 \+ --hash=sha256:ba0efaa9080b619ff2f3459d1d500c57bddea4a6b424b60a91141db6fd2f08bc++certifi==2026.7.22 \+ --hash=sha256:62f22742b58a1a33014a2b6b706588a8d7e2a88ae7bd1a6ebe8c992928483775++dep-logic==0.7.2 \+ --hash=sha256:33640c4ba7fd45f2504442eb9e0c12e57dac253c748ca3925749548a5c556bae++distlib==0.4.3 \+ --hash=sha256:4b0ce306c966eb73bc3a7b6abad017c556dadd92c44701562cd528ac7fde4d5b++filelock==3.32.7 \+ --hash=sha256:65ff0d0190ea42038b32bda4b77834fb05be2cad4c5b9b01aa4dfb3614536e52++findpython==0.8.0 \+ --hash=sha256:4a61ee1618a8b55014f7d41f59345d322be93f6ce62395bdccccc651b3f7e28a++h11==0.16.0 \+ --hash=sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86++hishel==0.1.5 \+ --hash=sha256:0bfbe9a2b9342090eba82ba6de88258092e1c4c7b730cd4cb4b570e4b40e44a7++httpcore==1.0.9 \+ --hash=sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55++httpx==0.28.1 \+ --hash=sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad++id==1.6.1 \+ --hash=sha256:f5ec41ed2629a508f5d0988eda142e190c9c6da971100612c4de9ad9f9b237ca++idna==3.20 \+ --hash=sha256:ab7ae7122974553370f0bdb919e1a960b2cd1bc1ef0276416d896db81c14582c++installer==0.7.0 \+ --hash=sha256:05d1933f0a5ba7d8d6296bb6d5018e7c94fa473ceb10cf198a92ccea19c27b53++markdown-it-py==4.2.0 \+ --hash=sha256:9f7ebbcd14fe59494226453aed97c1070d83f8d24b6fc3a3bcf9a38092641c4a++mdurl==0.1.2 \+ --hash=sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8++msgpack==1.2.2 \+ --hash=sha256:77c2e018417dc1d66f235e383877ee885b60ade9d29e494dd581e08af2cb1923 \+ --hash=sha256:8dc4487097571f7311188c3eca2a3e86cd1f1db4c37c7a017bcc3fd38486cbfe \+ --hash=sha256:73b0e05c32c3cfc3cd84994908e57430c0ebc6813abf905d3f18ff115d54df3f++packaging==26.3 \+ --hash=sha256:d7193f7c8e4e93f444fde0262bf90af30e16fa0ad0ad44cb553c87339b23cd1c++pbs-installer==2026.9.1 \+ --hash=sha256:d2c320a11e0313f559f4338fad3f698345d200d0506053c75d266730b2507dcb++pdm==2.26.2 \+ --hash=sha256:b3b0199f6eec37284192a6feb26bef21f911d45d5aa4b02323ff211752abf04b++pip==26.2 \+ --hash=sha256:931c303696af6fa3417112103b1cad26890e5a07eccb5b99783700e33f2b8aad++platformdirs==4.11.10 \+ --hash=sha256:973c4c082b964958c71588448488d2b14fb253893dfbdb82325a14c84e540e8f++pygments==2.21.0 \+ --hash=sha256:2363c69b61c4a97c838da3b130dcd6468f4848992b21a82f2a63ec34377137d9++pyproject-hooks==1.3.3 \+ --hash=sha256:5fc53fdac9f7bd63fbcdc868fb5f90b4784d78a53a3d3388cd738b807441a20b++python-discovery==1.6.1 \+ --hash=sha256:d43fcdef879fe795352bd13ccf8d185ba5a9f86f36cfcd00529f596e737442b3++python-dotenv==1.2.3 \+ --hash=sha256:904552145e8bfed22162c09dab1c2b9b54fefa7b23ba780f4f26ca0316b0f0d9++resolvelib==1.2.1 \+ --hash=sha256:fb06b66c8da04172d9e72a21d7d06186d8919e32ae5ab5cdf5b9d920be805ac2++rich==15.0.0 \+ --hash=sha256:33bd4ef74232fb73fe9279a257718407f169c09b78a87ad3d296f548e27de0bb++shellingham==1.5.4 \+ --hash=sha256:7ecfff8f2fd72616f7481040475a65b2bf8af90a56c89140852d1120324e8686++socksio==1.0.0 \+ --hash=sha256:95dc1f15f9b34e8d7b16f06d74b8ccf48f609af32ab33c608d08761c5dcbb1f3++tomlkit==0.15.1 \+ --hash=sha256:177a05aece5a8ca5266fd3c448abb47b8d352f09d477d3ca8332db4d89b24304++truststore==0.10.4 \+ --hash=sha256:adaeaecf1cbb5f4de3b1959b42d41f6fab57b2b1666adb59e89cb0b53361d981++typing-extensions==4.16.0 \+ --hash=sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8++unearth==0.18.3 \+ --hash=sha256:306773b7a792af7d44b3b2a3bea21ba63a0b947546ad8ee793194fd09a6ae020++urllib3==2.8.0 \+ --hash=sha256:0cf3cae568d36aa9576b28dfb35f11328f1cb974ca7647d9475ebb86c75ac6e3++virtualenv==21.7.15 \+ --hash=sha256:b7fa004650941c5f4b8035c981673ba2fc88189543c86db05ace77878804202ddiff --git a/requirements/bootstrap-runtime.txt b/requirements/bootstrap-runtime.txtnew file mode 100644index 0000000000..f85f1dab69--- /dev/null+++ b/requirements/bootstrap-runtime.txt@@ -0,0 +1,25 @@+# Hash-locked bootstrap requirements (OSSF Scorecard Pinned-Dependencies).+#+# Installed with: pip install --require-hashes -r <this file>+# Every byte of the bootstrap toolchain is verified against a reviewed+# sha256. Hashes cover CPython 3.12 (CI runner) and CPython 3.14 (image)+# wheels for linux amd64 and aarch64 as applicable; pure-python wheels are+# shared, platform/abi wheels list one --hash line per artifact.+#+# Regenerate:+# pip download <roots> --only-binary=:all: --python-version <3.12|3.14>+# --implementation cp+# --platform manylinux2014_x86_64 --platform manylinux_2_17_x86_64+# [--platform manylinux2014_aarch64 --platform manylinux_2_17_aarch64]+# -d /tmp/hashes+# then re-emit "name==version" with one "--hash=sha256:<digest>" line per+# wheel (run per platform/abi and merge, so tagged wheels carry every hash).+#+# Rotate by bumping the roots to the reviewed versions and regenerating;+# a drifted mirror or wheel-tag makes the install FAIL loudly (by design).+#+# Used by: Dockerfile (ldr stage) - pins pip itself (image Python 3.14).+++pip==26.2 \+ --hash=sha256:931c303696af6fa3417112103b1cad26890e5a07eccb5b99783700e33f2b8aad