Right. But it can’t, for several reasons:
1) The proxy is open source and much simpler than PHP runtime or a web application. Its code only takes input and generates output. It is basically a pipe. It has no other capabilities to exploit.
2) The operating system, such as BSD or Linux, supports running processes under a user and enforces limits on that user. So you just jail this proxy — since it has one purpose. Unlike your application, which may do many things and you can’t restrict it, it may become a confused deputy
How exactly is being open source supposed to protect it from memory safety issues? Even if you jail it, you still run the risk of the proxy leaking sensitive requests of other users…
No, the proxy itself may have memory vulnerabilities that could give attackers remote code execution capabilities.