fix(deps): resolve Dependabot security alerts (pyo3, js-yaml)#1324
Conversation
pyo3 0.22 -> 0.29 in rust/python clears three advisories: out-of-bounds read in PyList/PyTuple nth/nth_back (high), missing Sync bound on PyCFunction::new_closure closures (medium), and PyString::from_object buffer overflow (low). Migrate the bindings to the 0.29 API (PyDict::new / PyBytes::new, Python::detach, Py<PyAny> return). Verified via a release build linked as an extension module + abi3-py39 import and dispatch on CPython 3.9. js-yaml: remove the last vulnerable js-yaml 3.14.2 (CVE-2026-53550, quadratic-complexity merge-key DoS) by overriding read-yaml-file to ^2.1.0, which depends on js-yaml 4.x. @manypkg/get-packages (changesets dev tooling) was its only consumer; read-yaml-file 2.1.0 keeps the same CommonJS default + .sync surface and switches safeLoad -> load. The 4.x line was already pinned to ^4.2.0.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
📝 WalkthroughWalkthroughUpgrades the PyO3 dependency from version ChangesPyO3 0.29 upgrade and binding API migration
pnpm read-yaml-file override
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@rust/python/Cargo.toml`:
- Line 20: In the pyo3 dependency declaration in Cargo.toml, remove the
deprecated "extension-module" feature from the features array while keeping
"abi3-py39". The extension-module feature is no longer needed and should be
replaced with modern build backends like maturin (version 1.9.4 or higher) or
setuptools-rust (version 1.12 or higher) for building the extension module
instead.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: b58b62a7-f1b9-4b5e-a01c-44fdde179445
⛔ Files ignored due to path filters (2)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yamlrust/python/Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (3)
package.jsonrust/python/Cargo.tomlrust/python/src/lib.rs
Closes the 4 open Dependabot alerts on the default branch.
pyo3 0.22 → 0.29 (
rust/python)Clears three advisories against the PyO3 binding crate:
nth/nth_backforPyList/PyTupleiterators (alert feat: Complete rework of measure tool with drag UX and snapping #80)Syncbound onPyCFunction::new_closureclosures (alert fix: update header text in ViewportContainer #81)PyString::from_object(alert Fix IFC 5 geometry placement coordinate issue #79)Migrated the 111-line binding to the 0.29 API:
PyDict::new_bound/PyBytes::new_bound→PyDict::new/PyBytes::newPython::allow_threads→Python::detachPy<PyAny>(thePyObjectalias was dropped from the prelude) viainto_any().unbind()rust/pythonis excluded from the workspace and ships via its ownpython-wheels.yml(maturin, abi3-py39), which this PR's path filter will exercise across all platform targets.Verified locally: release build links cleanly as an
extension-moduleand the abi3 wheel imports + dispatches bothgeometry_data_jsonandgeometry_data_bufferson CPython 3.9.js-yaml — drop the last vulnerable 3.14.2 (alert #77)
CVE-2026-53550 (quadratic-complexity merge-key DoS) covers all
js-yaml <= 4.1.1. The 4.x line was already pinned to^4.2.0; the only remaining vulnerable copy wasjs-yaml@3.14.2, pulled transitively by:@changesets/cli→@manypkg/get-packages@1.1.3→read-yaml-file@1.1.0→js-yaml@3.14.2read-yaml-file@1.1.0callsyaml.safeLoad, removed in js-yaml 4.x — so a blanketjs-yaml@3 → 4override would break changesets. Instead this overridesread-yaml-file→^2.1.0, which usesyaml.load(js-yaml 4.x) while keeping the exact CommonJSdefault+.syncsurface@manypkg/get-packagesconsumes.read-yaml-fileandjs-yaml@3each had a single consumer, so this removesjs-yaml@3.14.2from the tree entirely.Verified locally:
read-yaml-file@2.1.0+js-yaml@4.2.0parses the repo's ownpnpm-workspace.yamlvia both the default promise fn and.sync; merge keys still parse.pnpm install --frozen-lockfileis consistent.Summary by CodeRabbit
Chores
Refactor