A Star is Reborn: The PHP Interpreter Rewritten in Safe Rust
summary
The gist
PHP powers most of the web, yet its C interpreter has had many memory-safety vulnerabilities.<ref:2611.32477#pg1, "PHP powers most of the web…
In short
The paper addresses memory safety issues in PHP's C interpreter by rewriting a core fragment in safe Rust. It introduces 'logical memory safety,' a formal guarantee confining program operations to permitted memory, proven via an abstract machine model and refinement proofs. The resulting Rust translation fixes 173 known vulnerabilities while maintaining functional parity with the original C engine.
Key concepts
- Logical Memory Safety
- This is an additional layer of protection beyond native memory safety. It ensures program operations are strictly confined to permitted memory regions by enforcing two properties: the frame property (restricting state changes) and sharing integrity (preventing unintended data sharing).
- Abstract PHP Machine Model
- This is a formal model used to describe how the PHP interpreter manages program values. It abstracts away implementation details, defining memory states as VSlots, VStores, and HStores. This model provides the mathematical foundation for proving that any execution admitted by it is memory-model safe.
- Refinement Proofs
- These are formal mathematical proofs used to transfer safety guarantees from the abstract machine model to the concrete Rust implementation. The proof verifies that every transition in the actual Rust code satisfies the abstract properties (like frame property and sharing integrity), mechanizing verification through tools like Verus.
Terminology used across episodes
This episode discusses
- A Star is Reborn: The PHP Interpreter Rewritten in Safe Rust · Paper Radio
- Fuzzing the PHP Interpreter via Dataflow Fusion
- Adversarial Agent Collaboration for Correctness Improvements of C to Safe Rust Translation
- C2SaferRust: Transforming C Projects into Safer Rust with NeuroSymbolic Techniques
- Mostly Automatic Translation of Language Interpreters from C to Safe Rust
The paper
A Star is Reborn: The PHP Interpreter Rewritten in Safe Rust · Read on arXiv
Tianyu Li, Bo Wang, Prateek Saxena, Umang Mathur
National University of Singapore
Transcript
Introduction to the show: ident: Security Radio. Generated commentary on the latest security and cryptography papers.
Nadia: I'm Nadia.
Elias: And I'm Elias, here with Priya.
Nadia: We're looking at the paper: "A Star is Reborn: The PHP Interpreter Rewritten in Safe Rust".
Title and authors: Nadia: So we've been looking at how this paper fixes PHP's deep memory safety issues by introducing logical memory safety, which is basically an extra rule set on top of standard memory protection <ref:2611.32477#pg1, "To prevent such failures, we introduce logical memory safety, which confines the program operations to their permitted memory">
Elias: Right. They take the whole PHP interpreter and create this abstract machine model to define exactly what’s allowed—the frame property and sharing integrity—and then they prove that their Rust translation of a core part of it follows those exact rules <ref:2611.32477#pg5, "We then formally prove that every transition of the abstract machine satisfies the frame property and sharing integrity">
Priya: So to put it simply, they’re building a blueprint for what PHP *should* be doing at a memory level and then showing that their Rust code doesn't violate those blueprints <ref:2611.32477#pg8, "every execution admitted by M is PHP memory-model safe">
Nadia: Exactly. It’s not just about preventing a crash; it’s about ensuring the program stays within its intended operational boundaries for every single memory operation <ref:2611.32477#pg4, "The frame property and sharing integrity define logical memory safety for PHP">
Elias: And they showed this works on a core part of PHP five point zero.zero which is a lot of code to handle—about 37K lines—and they managed to keep the performance overhead down to fifteen percent compared to the original C version <ref:2611.32477#pg2, "Our protection comes with a modest runtime overhead of 15% on the PHP performance benchmark">
Priya: Fifteen percent is low enough that it should be practical for most web applications, but what about the real-world risk? They fixed one hundred seventy-three memory bugs found in PHP five point zero <ref:2611.32477#pg1>.zero <ref:2611.32477#pg18, "The paper confirms that all of these bugs were fixed during PHP’s history">
Nadia: Those one hundred seventy-three bugs are specific things that could have caused native memory corruption or logical errors like using stale data <ref:2611.32477#pg3, "Logical memory violations happen frequently in our collected memory vulnerabilities">
Elias: The main thing is that they showed their safe Rust version handles all those vulnerability triggers without any native crashes or logic violations appearing on the inputs we tested <ref:2611.32477#pg10, "After analyzing the memory access behavior of our Rust PHP engine, we find no native memory violations or logic memory violations on these vulnerability-triggering inputs">
Priya: That’s good for security testing, but what does this mean for the average person using PHP? Does it make their code instantly bulletproof against all kinds of attacks?
Nadia: It means that if you are using a core fragment of PHP five point zero.zero you can be confident that the underlying engine is much safer than it used to be because it’s formally verified against these logical constraints <ref:2611.32477#pg9, "We then formally prove that every transition of the abstract machine satisfies the frame property and sharing integrity">
Elias: But there's a catch, as they state in their conclusion—rewriting to safe Rust stops native memory issues but it doesn't eliminate security-relevant logical errors in how you structure your program state <ref:2611.32477#pg14>.
Priya: So they’re trading one type of failure for another—native crashes for logic bugs—but they're putting a formal fence around the whole system to make those logic bugs much harder to find <ref:2611.32477#pg14>.
The paper's summary: Nadia: So we're looking at how this paper fixes PHP's deep memory safety issues by introducing logical memory safety, which is basically an extra rule set on top of standard memory protection <ref:2611.32477#pg1, "To prevent such failures, we introduce logical memory safety, which confines the program operations to their permitted memory">
The paper's improvements: Nadia: So we're wrapping up this discussion on "A Star is Reborn: The PHP Interpreter Rewritten in Safe Rust", which is about using formal proofs to make a core part of the PHP interpreter safe by adding logical memory safety <ref:2611.32477#pg1, "To prevent such failures, we introduce logical memory safety, which confines the program operations to their permitted memory">
Elias: Yeah. The main thing is that they used an abstract machine model to define these rules and then formally proved that their Rust code respected those rules for a core fragment of PHP five point zero.zero <ref:2611.32477#pg9, "We then formally prove that every transition of the abstract machine satisfies the frame property and sharing integrity">
Priya: From what I’ve seen, it’s a solid step in making sure we trust these massive pieces of software more easily by giving us a verifiable guarantee beyond just native memory safety <ref:2611.32477#pg14>
Nadia: Exactly. It shows that for long-running interpreted systems, you can formally verify higher-level properties like sharing integrity alongside the native memory guarantees <ref:2611.32477#pg8>.
Elias: And they did it by showing how their translation refines the abstract model using tools like Verus to mechanize that proof <ref:two thousand six hundred eleven point three two four seven seven#pg5, "We then formally prove that a core part of the interpreter engine in our concrete Rust implementation refines one the abstract PHP model and mechanize the proof through Verus">
Nadia: It means you get that extra layer of logical memory safety for the parts of the interpreter they covered, which handles those one hundred seventy-three old vulnerabilities <ref:2611.32477#pg18, "The paper confirms that all of these bugs were fixed during PHP’s history">
Nadia: We’re definitely going to keep an eye on how they extend this machine model concept to other languages and interpreter architectures in the future <ref:2611.32477#pg5, "We then formally prove that every transition of the abstract machine satisfies the frame property and sharing integrity">
Conclusion: Nadia: We're starting with the paper "A Star is Reborn: The PHP Interpreter Rewritten in Safe Rust". This is about taking that old C PHP interpreter, which powers most of the web, and rewriting it in safe Rust.
Elias: And they introduce this concept called logical memory safety. It’s not just fixing native errors; it’s about confining operations to permitted memory using an abstract machine model <ref:2611.32477#pg1, "To prevent such failures, we introduce logical memory safety, which confines the program operations to their permitted memory">
Priya: Logical memory safety sounds like a layer on top of regular safety, but what does that actually mean for how the program manages its data?
Nadia: It means they're building an abstract PHP machine model to capture how values are managed inside PHP while ignoring all the messy functionality details for a moment.
Elias: That model defines this property by focusing on two things: the frame property and sharing integrity. The frame property deals with read and write confinement, meaning state changes have to happen in permitted regions, and sharing integrity
More episodes
- The day in conversation for 2026-12-05
- Daily Summary for 2026-12-05
- 2607.15118-Automated Template-free Synthesis of Instruction-Centric Leakage Contracts for Black-Box CPUs
- 2610.37722-FVH-Bench: Evaluating Image Generator Safety Beyond Overtly Harmful Imagery
- 2512.23849-Security Without Detection: Economic Denial as a Primitive for Edge and IoT Defense
- 2605.05807-LCC-LLM: Leveraging Code-Centric Large Language Models for Malware Attribution
- 2607.02932-PromptPET: Prompt Obfuscation Against Profiling by AI Agents
- 2309.05646-A Novel Supervised Deep Learning Solution to Detect Distributed Denial of Service (DDoS) attacks on Edge Systems using Convolutional Neural Networks (CNN)
- The day in conversation for 2026-12-04
- Daily Summary for 2026-12-04