Skip to content

Clear 13 dependency advisories and start scanning for them - #173

Merged
rajeeja merged 2 commits into
mainfrom
security-deps-and-scanning
Oct 13, 2026
Merged

rajeeja merged 2 commits into
mainfrom
security-deps-and-scanning

Conversation

@rajeeja

@rajeeja rajeeja commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator

Thirteen packages in uv.lock had published advisories against the exact versions we pinned. All thirteen had fixes already on PyPI.

What was vulnerable

Package Was Now Notable advisory
cryptography 48.0.0 50.0.2 vulnerable OpenSSL in wheels; PKCS#7 Bleichenbacher oracle
starlette 1.1.0 1.7.0 unvalidated request path poisons request.url_for; form limits ignored
urllib3 2.7.0 2.8.0 HTTPS proxy TLS config ignored; chunked-deflate infinite loop
aiohttp 3.13.5 3.14.5
pillow 12.2.0 12.3.0
pyjwt 2.13.0 2.15.1
tornado 6.5.5 6.5.10
plus anyio, python-multipart, virtualenv, fsspec, multidict, soupsieve

A plain uv lock --upgrade clears every one. Scanned against OSV before and after:

BEFORE: 13 vulnerable / 184 packages
AFTER :  0 vulnerable / 189 packages

Why they accumulated — the part actually worth fixing

zizmor audits workflow files. upstream-compat probes the four packages we sit directly downstream of. Neither reads an advisory database, and nothing looked at the other ~180 packages at all.

So this adds two jobs that answer different questions:

  • .github/workflows/audit.yml — does anything we pin have a published advisory? Scans the fully exported graph (--all-extras --all-groups, 188 packages), not the installed environment, because dev-only and extra-only packages run in CI and ship in the Docker image. Runs on lockfile changes and weekly, since an advisory can be published against a version we already pin and no push would ever trigger it.
  • .github/dependabot.yml — is anything simply out of date? Groups routine minor/patch bumps into one weekly PR so they don't arrive as a hundred ignorable ones. Security updates stay ungrouped.

Two deliberate choices

osv-scanner, not pip-audit. pip-audit resolves requirements into a throwaway virtualenv, which fails on this graph (antimeridian has no sdist for the resolver's Python — reproduced locally). osv-scanner reads the file and queries OSV directly: same advisory sources, no install step.

Actions pinned to full commit SHAs. .github/zizmor.yml exempts the older workflows from unpinned-uses as a tracked follow-up, but a job whose entire purpose is supply-chain safety should not join that list. This one needs no exemption — zizmor reports clean on it.

Verification

The upgrade moves 112 packages including xarray 2026.4.0 → 2026.9.0, so it was checked on every lane rather than just the core one:

Lane Result
core 1374 passed, 1 skipped
hpc 25 passed, 2 skipped
yac 3 passed
pre-commit (ruff, mypy, zizmor) 11/11
OSV scan of exported graph 0 of 188 vulnerable

This is PR 1 of 2. PR 2 covers MCP protocol-level tests (in-process ClientSession, wire-JSON assertions) — kept separate so a 112-package bump stays bisectable.

Thirteen packages in uv.lock had published advisories against the exact
versions we pinned: cryptography 48.0.0 (vulnerable OpenSSL in the
wheels, and a Bleichenbacher oracle in PKCS#7 decryption), starlette
1.1.0 (unvalidated request path poisoning request.url_for, form limits
silently ignored), urllib3 2.7.0 (HTTPS proxy TLS configuration ignored,
chunked-deflate infinite loop), plus aiohttp, anyio, pillow, pyjwt,
python-multipart, tornado, virtualenv, fsspec, multidict and soupsieve.

None of them was exotic. All thirteen had fixes already on PyPI, and a
plain `uv lock --upgrade` clears every one: scanned against OSV before
and after, 13 vulnerable packages of 184 became 0 of 189.

The reason they accumulated is the part worth fixing. zizmor audits the
workflow files; upstream-compat probes the four packages we sit directly
downstream of. Neither reads an advisory database, and nothing else
looked at the other ~180 packages at all. So this adds:

  - .github/workflows/audit.yml, scanning the fully exported graph
    (--all-extras --all-groups, 188 packages) with osv-scanner. It runs
    on lockfile changes and weekly, because an advisory can be published
    against a version we already pin and no push would ever trigger it.
  - .github/dependabot.yml, grouping routine minor/patch bumps into one
    weekly PR so they do not arrive as a hundred ignorable ones. Security
    updates still come through ungrouped.

osv-scanner rather than pip-audit: pip-audit resolves the requirements
into a throwaway virtualenv, which fails on this graph (antimeridian has
no sdist for the resolver's Python). osv-scanner reads the file and
queries OSV directly, covering the same advisory sources with no install
step.

The new workflow pins its actions to full commit SHAs. .github/zizmor.yml
exempts the older workflows from `unpinned-uses` as a tracked follow-up,
but a job whose purpose is supply-chain safety should not be joining that
list, so this one pins properly and needs no exemption.

The upgrade moves xarray 2026.4.0 -> 2026.9.0 among 112 packages, so it
was checked on every lane rather than just the core one: core 1374
passed, hpc 25 passed, yac 3 passed, pre-commit 11/11.
osv-scanner-action is a Docker action: it bind-mounts GITHUB_WORKSPACE and
nothing else, so the file written to the runner's /tmp did not exist inside
the container. The scan died with `stat /tmp/requirements-audit.txt: no such
file or directory` and exit 127, before reading a single package.

Writing it into the workspace is all it needs. The filename is gitignored so
running the same export locally cannot leave a stray file staged.
@rajeeja
rajeeja merged commit b7d30ab into main Oct 13, 2026
15 checks passed
@rajeeja
rajeeja deleted the security-deps-and-scanning branch October 13, 2026 00:59
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