Skip to content

feat(ci): weekly advisory fetch for the watchlist - #2

Merged
stephen-masters merged 1 commit into
mainfrom
claude/elegant-poincare-2f26e3
Nov 1, 2026
Merged

stephen-masters merged 1 commit into
mainfrom
claude/elegant-poincare-2f26e3

Conversation

@stephen-masters

Copy link
Copy Markdown
Contributor

What runs, when

.github/workflows/advisories.yml runs every Monday at 07:00 UTC (an hour after the Security workflow) and on workflow_dispatch, with a dry run tick-box that lists without opening. It runs scripts/advisories.py run, which:

  1. queries POST https://api.osv.dev/v1/query for each package on the watchlist (pillow on PyPI; tiff, libpng1.6, libjpeg-turbo, zlib, poppler, openjpeg2, freetype on Debian), following next_page_token;
  2. drops Debian's bulletins (DSA-, DLA-, and DTSA-, which OSV also carries) and withdrawn records, and merges the records that describe one CVE (Pillow's GHSA + PYSEC entries, Debian's DEBIAN-CVE-… record) into one advisory keyed by the CVE;
  3. drops what is known (below);
  4. holds a reserved CVE, one with an id but no text, as pending: no issue, listed in the step summary, checked again next week. Today those are CVE-2026-36849 and CVE-2026-46675, the backfill's two U entries;
  5. opens one issue per new advisory from a fixed template: marker, a table of key, aliases, package, published date, severity if given and OSV links; the labels and what matched; summary and details; and a triage section with the question, the seven buckets as tick boxes with one-line definitions, and an empty Finding: line.

The script is Python standard library only (no new dependency; uv lock --check passes) and runs locally: fetch (what is new, opens nothing), run (the job; needs GITHUB_TOKEN and --repository), record (refresh the baseline). tests/test_advisories.py builds every OSV and GitHub response in the test file and fakes the one HTTP function the script calls: pagination, bulletin dropping, CVE merging, the reserved state, each noise filter, the template, the state file, and the job end to end including the second run opening nothing.

Where the state lives, and why nothing is committed

The issues are the record. Each issue starts with <!-- sillybos-advisory: … --> naming every identifier of the advisory, and the next run reads those markers back from every advisory-labelled issue, open or closed. So the workflow needs only contents: read and issues: write, and main gets no bot commit a week (its ruleset would refuse a GITHUB_TOKEN push anyway, and a weekly bot PR is noise for a human to merge).

docs/advisories/seen.json is the baseline: the 767 advisories OSV held for the watchlist on 1 November 2026, by key, with the two reserved CVEs as pending. A maintainer refreshes it by hand with python scripts/advisories.py record when the issue list has grown long enough to be worth folding in. An advisory is known if any of its identifiers is in the baseline or an issue marker, so a GHSA that later gains a CVE alias does not come back as new.

The noise filters

Three mechanical filters add likely-not-reached and list what matched; none drops anything. A path under tools/ or contrib/ and the Pillow modules ImageFont, ImageDraw, ImageMath, ImageShow, PdfParser are looked for in the whole text. The words save/encode/write/append (verb forms) are looked for in the headline only (summary plus first paragraph of prose), because on the real October batch nearly every Pillow write-up mentions "writes" somewhere, which made the label meaningless; "out-of-bounds write" and its kin are blanked first, and "encoding" the noun is left alone.

What a maintainer does with a new issue

Answer the question at the top of docs/advisories/README.md in a line after Finding ("would a bounded header check, or what pdfinfo/pdfimages -list/pdffonts report, have kept the triggering file from the decoder?"), tick one bucket (A, B, B2, C, D, N, U; the guide defines each and what follows), and close the issue, or leave it open as the ticket for the B work. A B or B2 finding becomes a policy field plus a hostile corpus case plus a README row, never a silent change of a default, since every default refusal is a breaking release. The guide has a clearly marked, unbuilt place for the model-driven triage comment.

Also: a one-line pointer under Development in the README, and scripts added to mypy's files.

Checks

ruff check ., ruff format --check ., mypy, pytest --cov (183 tests, 96.8%), uv lock --check, and zizmor --min-severity medium .github/workflows (no findings; the new workflow is also clean at every severity) all pass locally.

🤖 Generated with Claude Code

Every Monday a workflow asks OSV.dev for the advisories on Pillow (PyPI)
and tiff, libpng1.6, libjpeg-turbo, zlib, poppler, openjpeg2 and freetype
(Debian), drops Debian's bulletins and merges the records for one CVE,
compares against docs/advisories/seen.json and the existing advisory
issues, and opens one issue per new advisory from a fixed template with
an empty triage section. Three mechanical noise filters label, never
drop. A reserved CVE with no text stays pending and is checked again
next week.

The script is standard library only and runs locally; its tests build
every OSV and GitHub response in the test file. Nothing is committed by
the workflow: the issues are the record, and seen.json is the baseline
from the November 2026 backfill, refreshed by hand with `record`.

docs/advisories/README.md is the triage guide: the question each issue
answers, the buckets, the noise filters, and the rule that a B finding
becomes a policy field plus a hostile corpus case, never a silent change
of a default. The model-driven triage comment is a marked place-holder.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@stephen-masters
stephen-masters merged commit cccfe3e into main Nov 1, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant