Skip to content

chore: Update PyO3 to fix vulnerability - #115

Merged
skuenzli merged 6 commits into
k9securityio:mainfrom
swenger:swenger-pyo3
Sep 2, 2026
Merged

chore: Update PyO3 to fix vulnerability#115
skuenzli merged 6 commits into
k9securityio:mainfrom
swenger:swenger-pyo3

Conversation

@swenger

@swenger swenger commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

skuenzli and others added 4 commits September 1, 2026 14:20
Reconciles CHANGELOG.md with main (4.8.4 released) and documents PR k9securityio#87
under [Unreleased]:
- Added: the {type, id} dict form for principal/action/resource on
  is_authorized / is_authorized_batch, and the new `make corpus-tests`
  target.
- Changed: missing principal/action/resource now raises KeyError
  instead of a Rust panic.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Backwards-compatible feature release; no Cedar engine change (still 4.8.2).

Added:
- Structured {"type", "id"} EUID form for principal/action/resource (k9securityio#87)
- Reusable, pre-parsed PolicySet handle to skip per-call policy parsing (k9securityio#91)

Changed (behavior):
- Missing principal/action/resource now raises KeyError instead of panicking (k9securityio#87)
- is_authorized* diagnostic errors print to stdout only when verbose=True (k9securityio#91)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
xhochy pushed a commit to conda-forge/cedarpy-feedstock that referenced this pull request Sep 1, 2026
See GHSA-36hh-v3qg-5jq4 and k9securityio/cedar-py#115.

Remove after we bump cedarpy past a version that includes this fix.
@skuenzli

skuenzli commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

@swenger - thank you for the PR!

The GHSA-36hh-v3qg-5jq4 and GHSA-chgr-c6px-7xpp Py03 advisories aren't reachable in cedar-py [1], so I deferred them to avoid churn and perf+correctness risk of updating Py03.

That said, I plan to merge this PR because I'm in the process of building the next release with a cedar engine bump and features. So will be doing another round of benchmarking.

[1] I built the Reachable Risk tool to help engineers triage dependency alerts so they can focus on the ones that actually need to be fixed

Co-Authored-By: Claude <noreply@anthropic.com>
@skuenzli

skuenzli commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Thanks @swenger! We validated this PR locally on Apple Silicon (macOS, CPython 3.11) beyond the green CI:

Check Result
Release build (maturin develop --release, pyo3 0.29.2) clean — no source changes needed
Unit tests 218 passed
Official Cedar integration suites 78 passed
Cedar corpus tarball 60,800 passed (expected count for cedar 4.12)
Benchmarks (N=5 runs, median Δ vs cedar-4.12.0 baseline, 5% gate) 35/35 PASS — Δ range −1.2% to +2.6%, within ambient drift
Submodule pointers identical to main
Cargo.lock churn minimal and expected; also reduces the stale windows-sys 0.59 duplicate from 3 consumers to 1

Context on the two advisories this bump fixes (GHSA-36hh-v3qg-5jq4 and GHSA-chgr-c6px-7xpp): both were previously triaged and dismissed as unreachable from cedarpy's API (no nth/nth_back calls on list/tuple iterators; PyCFunction::new_closure never used), so this upgrade is defense-in-depth — and it completes the pyo3 0.27→0.29 migration we had deferred. Both alerts will auto-close on merge.

We pushed one commit to the branch adding the CHANGELOG.md entry under [Unreleased].

@skuenzli
skuenzli merged commit 83952be into k9securityio:main Sep 2, 2026
7 checks passed
@swenger

swenger commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @skuenzli!

@swenger
swenger deleted the swenger-pyo3 branch September 3, 2026 05:14
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.

2 participants