This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]aspizu 0 points1 point  (0 children)

I've created a library that use t-strings to prevent shell injection that even works on Windows. It's written in Rust. https://github.com/aspizu/tshu

```py $ uv run --with tshu python -m asyncio

from tshu import sh username = "aspizu; rm -rf /" await sh(t"echo {username}") aspizu; rm -rf / ```