TL;DR: Runtime memory can expose passwords, tokens and API keys when PHP2Shell hits an exposed deployment, according to Tonic. PHP workers serving public traffic need patching, restarts and secret rotation because application-layer fixes do not remove a vulnerable runtime.
Editorial analysis by NHI Mgmt Group, based on content published by Tonic: “PHP2Shell: Critical PHP vulnerabilities, fixes available”.
By the numbers:
- 80% of identity breaches involved compromised non-human identities such as service accounts and API keys, according to the Ultimate Guide to NHIs.
Key questions
Q: Why does a PHP engine flaw create credential risk as well as server compromise?
A: Because the PHP process may hold passwords, tokens and API keys in memory at the moment exploitation or disclosure occurs.
Q: What breaks when teams rely on CMS patching but leave the PHP runtime exposed?
A: The assumption that application-layer hardening is enough breaks down.
Q: What should teams do first when a PHP runtime is exposed to unauthenticated RCE?
A: First, identify which PHP workers are actually serving public or business-critical traffic, because installed packages do not prove exposure.
Practitioner guidance
- Prioritise externally reachable PHP runtimes Start with public services and business-critical applications, then trace CDN, WAF, gateway and load-balancer paths to the serving workload so you fix what is actually exposed.
- Patch the serving runtime, not only the application Update packages or rebuild images, replace old replicas, and confirm the runtime version that is handling web traffic rather than the CLI version present on the host.
- Rotate credentials that may have lived in process memory Treat passwords, tokens and API keys as potentially exposed if the vulnerable runtime processed traffic, then revoke or replace them after containment and before restoring full trust.
Bottom line: The core risk is not only remote code execution but also exposure of runtime-held passwords, tokens and API keys.
Glossary terms: Runtime exposure management, Memory Disclosure Vulnerability, Stale global state, Serving runtime
Explore further
View Full Forum → | NHI Foundation Course → | Our Services → | Read the full analysis →
Runtime exposure has become the real control boundary for PHP security: the article makes clear that package presence is not the same as reachable risk. The serving workload, not the inventory entry, determines whether exploitation is possible. For practitioners, this shifts governance from software cataloguing to live runtime ownership and reachability.
A few things that frame the scale:
- DeepSeek alone generated 113,000 new exposed API keys in 2025, illustrating how new AI providers create credential exposure before security guardrails catch up, according to the State of Secrets Sprawl 2026.
- Only 20% have formal processes for offboarding and revoking API keys, and even fewer have procedures for rotating them, according to the Ultimate Guide to NHIs.
A question worth separating out:
Q: Should organisations use WAF rules or temporary access restrictions instead of patching PHP?
A: No. Temporary controls can reduce exposure to specific request paths, but they do not remove the vulnerability in the engine. They are useful only as a bridge while you patch, restart affected workers, and confirm that every exposed instance is remediated.
👉 Read our full editorial: PHP RCE flaws expose runtime memory and API keys