avoigt1121 Claude Opus 5.5 commited on
Commit ·
17acd0c
1
Parent(s): e119adb
security: D5-A — accept the 8 pillow 12.3.0 CVEs here until 2026-11-20
Browse filesThe project lead decided D5-A (2026-10-20): a justified acceptance in this repo
only. This Space takes identifiers only and opens no caller-supplied image; the
fix needs a fleet-wide gradio move (gradio 6.28.0 requires pillow<13).
security/accepted-vulns.txt feeds pip-audit --ignore-vuln; the scan fails on an
expired entry, and tests/test_accepted_vulns.py fails once the lock moves pillow
off 12.3.0, so the acceptance cannot outlive its reason. Scan green.
Slice: phase1-knowledge-specialist/s2
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/plans/PLAN-phase1-knowledge-specialist.md
CHANGED
|
@@ -150,7 +150,9 @@ The memo settled the approach. The only real choice left is where the endpoints
|
|
| 150 |
- **Recommend:** A, for this repo.
|
| 151 |
- **Blocks:** the s2 merge gate ("security scan green") and s3's first push. Everything else in s2
|
| 152 |
is done and green.
|
| 153 |
-
- **Status:**
|
|
|
|
|
|
|
| 154 |
|
| 155 |
**Two-way defaults** (DECIDED by default; overrule in one line):
|
| 156 |
- The plan and ADR-0001 stay here until s1 moves them into the new repo.
|
|
|
|
| 150 |
- **Recommend:** A, for this repo.
|
| 151 |
- **Blocks:** the s2 merge gate ("security scan green") and s3's first push. Everything else in s2
|
| 152 |
is done and green.
|
| 153 |
+
- **Status:** DECIDED 2026-10-20 (project lead): A — accepted in this repo only, expiring 2026-11-20 or
|
| 154 |
+
when gradio allows pillow 13 (`security/accepted-vulns.txt`, `tests/test_accepted_vulns.py`). The
|
| 155 |
+
fleet-wide question stays open outside this plan.
|
| 156 |
|
| 157 |
**Two-way defaults** (DECIDED by default; overrule in one line):
|
| 158 |
- The plan and ADR-0001 stay here until s1 moves them into the new repo.
|
scripts/security_scan.sh
CHANGED
|
@@ -115,8 +115,25 @@ else
|
|
| 115 |
echo " setting up audit venv ($PYBIN)"
|
| 116 |
"$PYBIN" -m venv "$VENV" && "$VENV/bin/python" -m pip install -q --upgrade pip pip-audit
|
| 117 |
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 118 |
"$VENV/bin/python" -m pip_audit --requirement "$TMP/audit.txt" --no-deps --disable-pip \
|
| 119 |
-
--format columns 2>/dev/null | tee "$OUT/pip-audit-$STAMP.txt"
|
| 120 |
AUDIT_RC=${PIPESTATUS[0]}
|
| 121 |
if [[ "$AUDIT_RC" -eq 0 ]]; then
|
| 122 |
ok "pip-audit — no known vulnerabilities in the resolved tree"
|
|
|
|
| 115 |
echo " setting up audit venv ($PYBIN)"
|
| 116 |
"$PYBIN" -m venv "$VENV" && "$VENV/bin/python" -m pip install -q --upgrade pip pip-audit
|
| 117 |
fi
|
| 118 |
+
# Recorded, expiring acceptances (security/accepted-vulns.txt; justified in
|
| 119 |
+
# security/ACCEPTED-FINDINGS.md). An EXPIRED entry fails the scan: re-triage, never extend quietly.
|
| 120 |
+
IGNORES=()
|
| 121 |
+
if [[ -f security/accepted-vulns.txt ]]; then
|
| 122 |
+
TODAY="$(date -u +%Y-%m-%d)"
|
| 123 |
+
while read -r vid expires _rest; do
|
| 124 |
+
[[ -z "${vid:-}" || "$vid" == \#* ]] && continue
|
| 125 |
+
exp="${expires#expires=}"
|
| 126 |
+
if [[ "$exp" < "$TODAY" ]]; then
|
| 127 |
+
fail "accepted finding $vid expired on $exp — re-triage it (security/ACCEPTED-FINDINGS.md)"
|
| 128 |
+
continue
|
| 129 |
+
fi
|
| 130 |
+
IGNORES+=(--ignore-vuln "$vid")
|
| 131 |
+
done < security/accepted-vulns.txt
|
| 132 |
+
[[ ${#IGNORES[@]} -gt 0 ]] && echo " accepting $(( ${#IGNORES[@]} / 2 )) recorded finding(s) until their expiry (security/accepted-vulns.txt)"
|
| 133 |
+
fi
|
| 134 |
+
# `${IGNORES[@]+…}`: macOS ships bash 3.2, where an empty array under `set -u` is unbound.
|
| 135 |
"$VENV/bin/python" -m pip_audit --requirement "$TMP/audit.txt" --no-deps --disable-pip \
|
| 136 |
+
${IGNORES[@]+"${IGNORES[@]}"} --format columns 2>/dev/null | tee "$OUT/pip-audit-$STAMP.txt"
|
| 137 |
AUDIT_RC=${PIPESTATUS[0]}
|
| 138 |
if [[ "$AUDIT_RC" -eq 0 ]]; then
|
| 139 |
ok "pip-audit — no known vulnerabilities in the resolved tree"
|
security/ACCEPTED-FINDINGS.md
CHANGED
|
@@ -26,4 +26,4 @@ transitive of that kind is a reviewed change, not a silent one.
|
|
| 26 |
| Stage | Result |
|
| 27 |
|-------|--------|
|
| 28 |
| **gitleaks** | One finding, **accepted as a false positive by fingerprint** (`.gitleaksignore`): commit `97e7d80`, `security/ACCEPTED-FINDINGS.md:13`, `generic-api-key`. That line of §0 quoted, verbatim, the docstring phrase §0 describes as a false positive, so it tripped the same rule. The text is reworded here; the old commit is local history on `dev` that has never been pushed, and is ignored by its exact fingerprint rather than rewritten. Not a secret: it is a list of identifier kinds. |
|
| 29 |
-
| **pip-audit** | **8 findings,
|
|
|
|
| 26 |
| Stage | Result |
|
| 27 |
|-------|--------|
|
| 28 |
| **gitleaks** | One finding, **accepted as a false positive by fingerprint** (`.gitleaksignore`): commit `97e7d80`, `security/ACCEPTED-FINDINGS.md:13`, `generic-api-key`. That line of §0 quoted, verbatim, the docstring phrase §0 describes as a false positive, so it tripped the same rule. The text is reworded here; the old commit is local history on `dev` that has never been pushed, and is ignored by its exact fingerprint rather than rewritten. Not a secret: it is a list of identifier kinds. |
|
| 29 |
+
| **pip-audit** | **8 findings, ACCEPTED until 2026-11-20 (plan D5-A, the project lead, 2026-10-20)** — `pillow 12.3.0` (via gradio 6.28.0, which requires `pillow<13`): CVE-2026-112895 / -112400 / -112397 / -112896 / -112897 / -112395 / -112404 / -112899, all fixed in 13.0.0. **Why acceptable here:** all eight are in parsing attacker-supplied image files (PDF append, GIF, PPM/PGM, TIFF, EPS); this Space's inputs are identifiers only (ADR-0001 §6), it has no image or file input, and it never opens an image a caller supplies. **Why not fixed:** an anchored pin bump cannot move pillow without breaking gradio's constraint; every fleet repo's `dev` pins the same version, so the fix is a fleet-wide gradio move, tracked separately. **Ends** when a gradio release allowing `pillow>=13` is pinned (tests/test_accepted_vulns.py then fails until the entries are removed) or on 2026-11-20, when the scan fails on the expired entries. Mechanism: `security/accepted-vulns.txt` → `pip-audit --ignore-vuln`. |
|
security/accepted-vulns.txt
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Accepted pip-audit findings — each line: <advisory id> expires=<YYYY-MM-DD> <package> <affected version>
|
| 2 |
+
# scripts/security_scan.sh passes every unexpired id to `pip-audit --ignore-vuln` and FAILS on an
|
| 3 |
+
# expired one, so an acceptance cannot outlive its date. tests/test_accepted_vulns.py fails once the
|
| 4 |
+
# lock moves the package off the affected version, so a fixed finding cannot stay accepted.
|
| 5 |
+
# Justification: security/ACCEPTED-FINDINGS.md §1 (plan D5-A, decided 2026-10-20 by the project lead).
|
| 6 |
+
CVE-2026-112895 expires=2026-11-20 pillow 12.3.0
|
| 7 |
+
CVE-2026-112400 expires=2026-11-20 pillow 12.3.0
|
| 8 |
+
CVE-2026-112397 expires=2026-11-20 pillow 12.3.0
|
| 9 |
+
CVE-2026-112896 expires=2026-11-20 pillow 12.3.0
|
| 10 |
+
CVE-2026-112897 expires=2026-11-20 pillow 12.3.0
|
| 11 |
+
CVE-2026-112395 expires=2026-11-20 pillow 12.3.0
|
| 12 |
+
CVE-2026-112404 expires=2026-11-20 pillow 12.3.0
|
| 13 |
+
CVE-2026-112899 expires=2026-11-20 pillow 12.3.0
|
tests/test_accepted_vulns.py
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Accepted pip-audit findings stay narrow, documented, dated, and die when they are fixed."""
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
import datetime
|
| 6 |
+
import re
|
| 7 |
+
from pathlib import Path
|
| 8 |
+
|
| 9 |
+
ROOT = Path(__file__).resolve().parent.parent
|
| 10 |
+
LINE = re.compile(r"^(?P<id>\S+) expires=(?P<date>\d{4}-\d{2}-\d{2}) (?P<pkg>\S+) (?P<ver>\S+)$")
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
def _entries():
|
| 14 |
+
out = []
|
| 15 |
+
for raw in (ROOT / "security/accepted-vulns.txt").read_text().splitlines():
|
| 16 |
+
line = raw.strip()
|
| 17 |
+
if not line or line.startswith("#"):
|
| 18 |
+
continue
|
| 19 |
+
m = LINE.match(line)
|
| 20 |
+
assert m, f"malformed acceptance line: {line!r}"
|
| 21 |
+
out.append(m.groupdict())
|
| 22 |
+
return out
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
def _locked(package: str) -> str | None:
|
| 26 |
+
lock = (ROOT / "requirements.txt").read_text()
|
| 27 |
+
m = re.search(rf"^{re.escape(package)}==(\S+)$", lock, re.MULTILINE | re.IGNORECASE)
|
| 28 |
+
return m.group(1) if m else None
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
def test_every_acceptance_is_well_formed_dated_and_short_lived():
|
| 32 |
+
for e in _entries():
|
| 33 |
+
expires = datetime.date.fromisoformat(e["date"])
|
| 34 |
+
# D5-A: no acceptance runs past 2026-11-20 without a new decision.
|
| 35 |
+
assert expires <= datetime.date(2026, 11, 20), e
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
def test_every_acceptance_is_justified_in_the_findings_record():
|
| 39 |
+
record = (ROOT / "security/ACCEPTED-FINDINGS.md").read_text()
|
| 40 |
+
for e in _entries():
|
| 41 |
+
suffix = e["id"].split("-")[-1]
|
| 42 |
+
assert e["id"] in record or f"-{suffix}" in record, e["id"]
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
def test_an_acceptance_dies_when_its_package_moves_off_the_affected_version():
|
| 46 |
+
"""When the lock moves pillow to a fixed version, remove the entries; this fails until then."""
|
| 47 |
+
for e in _entries():
|
| 48 |
+
assert _locked(e["pkg"]) == e["ver"], (
|
| 49 |
+
f"{e['pkg']} is now {_locked(e['pkg'])} in requirements.txt; {e['id']} was accepted "
|
| 50 |
+
f"for {e['ver']} only — remove it from security/accepted-vulns.txt"
|
| 51 |
+
)
|