# Trivy allowlist — an irrelevant CVE is declared HERE, justified and dated, never by
# loosening the threshold (--severity/--exit-code) of the CI configuration.

# CVE-2026-4372, CVE-2026-5241 (transformers==4.57.6, RCE via trust_remote_code) — 2026-07-21.
# `transformers` is a WSL-only dependency of the [npu] extra (jbr_inference/backends/npu/convert_model.py,
# model conversion/quantisation): never installed in the BASE venv (the CI one,
# `uv sync` without --extra) nor in the real runtime of the service (jbr_inference/backends/npu/server.py on the
# target machine, which only depends on openvino + tokenizers, see
# jbr_inference/backends/npu/README.md). The
# converted model (Jean-Baptiste/camembert-ner, public on HF, fixed checkpoint) is loaded once
# locally by a developer, never with `trust_remote_code=True`, never exposed to a
# network input — the RCE surface of these CVEs does not apply to this usage.
# Upstream fix: shipped in transformers>=5.3.0/5.5.0 depending on the CVE. Not adoptable here:
# `optimum-intel` (latest published release, 2.0.0) declares a hard constraint
# `transformers<5.1` — `uv sync --extra npu` refuses to resolve `transformers>=5.5` with
# `optimum-intel>=1.24` (unsatisfiable conflict, verified), despite a functionally identical
# conversion tested manually with transformers==5.5.0 (export + quantisation + compile +
# inference produce the same predictions as with 4.57.6). A real upstream
# gap (optimum-intel not yet aligned with recent transformers 5.x), not a choice of this
# repo — see pyproject.toml (extra [npu]) for the details. To be removed as soon as a version of
# optimum-intel raises this cap and allows `transformers>=5.5,<6`.
CVE-2026-4372
CVE-2026-5241

# CVE-2026-80047 (transformers==4.57.6, unauthorised file write via
# `GenerativePreTrainedModel.load_custom_generate()`) and CVE-2026-9856 (path
# traversal via `save_pretrained`/chat template name) — 2026-10-27, found by the nightly
# pip-audit/trivy gate (no associated code change).
# Same scope and same justification as CVE-2026-4372/5241 above: `transformers`
# is a WSL-only dependency of the [npu] extra (local conversion/quantisation), never
# installed in the CI BASE venv nor in the real runtime of the service — the converted
# model (fixed public HF checkpoint) is loaded locally by a developer, never
# through an untrusted network input, so the arbitrary file write and the path traversal of these two
# CVEs have no exploitation surface here.
# Upstream fix: CVE-2026-9856 fixed in transformers>=5.10.0; CVE-2026-80047 has
# no fix published to date. Not adoptable: same `optimum-intel<2.0` cap
# imposing `transformers<5.1` already documented above (unsatisfiable conflict with
# `uv sync --extra npu`). Expires on 2027-01-27 — to be reassessed on that date (new
# version of optimum-intel lifting the cap, or a fix published for CVE-2026-80047).
CVE-2026-80047 exp:2027-01-27
CVE-2026-9856 exp:2027-01-27
