fix(deps): update rust crate pyo3 to 0.24.0 [security] #1161
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
0.23.0
->0.24.0
GitHub Vulnerability Alerts
GHSA-pph8-gcv7-4qj5
PyString::from_object
took&str
arguments and forwarded them directly to the Python C API without checking for terminating nul bytes. This could lead the Python interpreter to read beyond the end of the&str
data and potentially leak contents of the out-of-bounds read (by raising a Python exception containing a copy of the data including the overflow).In PyO3 0.24.1 this function will now allocate a
CString
to guarantee a terminating nul bytes. PyO3 0.25 will likely offer an alternative API which takes&CStr
arguments.Release Notes
pyo3/pyo3 (pyo3)
v0.24.1
Compare Source
This release is a security fix for the
PyString::from_object
method, which passed&str
data to the Python C API without checking for a terminating nul byte. All historical PyO3 versions are affected, and we recommend you upgrade if you are usingPyString::from_object
. Thank you to @vthib for the report and @Dr-Emann for the fix. A RUSTSEC advisory will be published shortly.Aside from the security fix, this release contains a number of other non-breaking additions:
abi3-py313
feature to support compiling with the Python 3.13 stable ABI.PyAnyMethods::getattr_opt
to get optional attributes without paying the cost of a Python exception when the attribute in question does not exist.PyInt::new
.with_critical_section2
for locking two objects at the same time on the free-threaded build.Option<&str>
andOption<&T>
(whereT: PyClass
) function arguments no longer being permittedThere are also a few other small bug fixes for edge cases, mostly related to compile errors from PyO3's macro code.
Thank you to the following contributors for the improvements:
@bschoenmaeckers
@davidhewitt
@Dr-Emann
@emmagordon
@epontan
@Icxolu
@IvanIsCoding
@jelmer
@jonaspleyer
@ngoldbaum
@Owen-CH-Leung
@Tpt
@Trolldemorted
@XuehaiPan
v0.24.0
Compare Source
Packaging
target-lexicon
dependency to 0.13. #4822jiff
dependency to add conversions forjiff
datetime types. #4823inventory
version to 0.3.5. #4954Added
PyIterator::send
method to allow sending values into a python generator. #4746PyCallArgs
trait for passing arguments into the Python calling protocol. This enabled using a faster calling convention for certain types, improving performance. #4768#[pyo3(default = ...']
option for#[derive(FromPyObject)]
to set a default value for extracted fields of named structs. #4829#[pyo3(into_py_with = ...)]
option for#[derive(IntoPyObject, IntoPyObjectRef)]
. #4850PyThreadState_GetFrame
andPyFrame_GetBack
. #4866last
forBoundListIterator
,BoundTupleIterator
andBorrowedTupleIterator
. #4878Iterator::count()
forPyDict
,PyList
,PyTuple
&PySet
. #4878nth
,nth_back
,advance_by
andadvance_back_by
forBoundTupleIterator
#4897types.GenericAlias
aspyo3::types::PyGenericAlias
. #4917MutextExt
trait to help avoid deadlocks with the GIL while locking astd::sync::Mutex
. #4934#[pyo3(rename_all = "...")]
option for#[derive(FromPyObject)]
. #4941Changed
nth
,nth_back
,advance_by
andadvance_back_by
forBoundListIterator
. #4810DerefToPyAny
in blanket implementations ofFrom<Py<T>>
andFrom<Bound<'py, T>>
forPyObject
. #4593io::ErrorKind::IsADirectory
/NotADirectory
to the corresponding Python exception on Rust 1.83+. #4747PyAnyMethods::call
and friends now requirePyCallArgs
for their positional arguments. #4768PyObject_Vectorcall(Method)
on the stable abi on 3.12+. #4853#[pyo3(from_py_with = ...)]
now take a path rather than a string literal #4860PathBuf
&Path
into Pythonpathlib.Path
instead ofPyString
. #4925pthread_exit
trying to acquire the GIL when the interpreter is shutting down. This mimics the Python 3.14 behavior and avoids undefined behavior and crashes. #4874Removed
Deref
forPyAny
and other "native" types. #4593Fixed
PyIter_Send
to return aPySendResult
. #4746v0.23.5
Compare Source
Packaging
Fixed
__builtins__
to__globals__
in code executed byPython::py_run
(was removed in PyO3 0.23.0). #4921Configuration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.