You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Interior NULs is a security hazard for C-style strings. A NUL byte
truncates a string which can lead the caller and callee to see two
different strings. It can cause path traversal attacks where a path in
Python looks complete but it is interpreted differently through FFI.
RustPython needs to handle this for its C-API as well as raw libc or
Windows calls. Both Rust's standard library as well as Rustix handle
interior NULs for us.
Finally, this PR is non-exhaustive. I will have to rely heavily on
CodeRabbit to help lint it to ensure that interior NUL checks are only
introduced for FFI and not outside of it.
**AI disclosure:** I relied on AI to ensure I'm solving this problem
correctly. Mainly, I used it to check if the FFI functions I'm modifying
need to handle interior NULs.
**Sources:**
* https://owasp.org/www-community/attacks/Embedding_Null_Code
* python/cpython#11656
Assisted-by: Codex
0 commit comments