Intel

AIKIDO-2025-10198

pyo3 is vulnerable to Buffer Overflow

GHSA-pph8-gcv7-4qj5Published Apr 1, 2025
April 1, 2025

30

CVE Score

Low

Buffer Overflow

Are you affected? Scan for Free

TL;DR

Affected versions of this package are vulnerable to an out-of-bounds read in PyString::from_object, which directly forwards &str arguments to the Python C API without ensuring a null-terminated string. This could cause the Python interpreter to read beyond the allocated data, potentially leaking sensitive information in an exception message. In PyO3 0.24.1, this issue is mitigated by allocating a CString to ensure proper null termination, and PyO3 0.25 is expected to introduce an alternative API that accepts &CStr arguments.

How do I fix this?

Upgrade the pyo3 library to the patch version.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range.

Package

Versions

0.21.0 - 0.24.0

Fixed in 0.24.1

Background info

pyo3 is vulnerable to Buffer Overflow in versions 0.21.0 - 0.24.0.

Get secure today,
quickly and for free.

Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.

No credit card required | Scan results in 32 seconds.

Trusted by 150k+ orgs
  • Revolut
  • n8n
  • Lovable
  • Deel
  • Prove
  • Omnea