Ruby and PHP, two programming languages that power a significant portion of enterprise web applications, have both addressed critical vulnerabilities in their respective engines that could enable remote code execution. Notably, four of the vulnerabilities in Ruby are attributed to an AI laboratory, and unsupported versions will not receive these fixes.
The Ruby security team released seven advisories on November 18, focusing on case conversion issues and the language’s regular expression engine, which have been patched in versions 4.0.10, 3.4.13, and 3.3.14. Following closely, the PHP project issued updates on November 19, including versions 8.5.13, 8.4.28, 8.3.37, and 8.2.36, which address eighteen vulnerabilities identified by the French government’s CERT-FR, several of which also lead to potential remote code execution.
These two sets of patches come during a particularly eventful period for security teams, following the Java4Shell vulnerability fix in the OpenJDK on November 17 and the NGINX2Root exploit in the NGINX web server on November 18. Researchers have dubbed the most discussed vulnerability in each language as ruby2shell for Ruby and phpAfterShell for PHP, reminiscent of their predecessors.
Vulnerabilities Linked to AI Research
Among the seven vulnerabilities in Ruby, four are attributed to Stephan Lipp from auditing firm Ada Logics and Anthropic, the publisher of the Claude AI models. Notably, ruby2shell, cataloged as CVE-2026-132825 in the public vulnerability database, exploits a flaw where Ruby writes an extra byte beyond the allocated memory when modifying the case of a specially crafted string in certain Western encodings like ISO-8859-1 and Windows-1252. The Ruby team states that unpublished proof-of-concept code demonstrates the potential for code execution in “certain scenarios” for five of the seven identified vulnerabilities.
The severity of ruby2shell remains hotly debated. While the Ruby team has not assigned a definitive threat level, the CVE record managed by MITRE rates it at 7.4 out of 10 on the Common Vulnerability Scoring System (CVSS), indicating a high severity for local attacks of significant complexity. Security companies, led by Cloudflare, have classified it as critical, highlighting that it can be exploited without authentication in Rails and Sinatra applications, a critical point not fully addressed in the Ruby advisory. Additionally, on November 13, Google’s Project Zero announced it would shorten its vulnerability disclosure timeline to 90 days post-reporting, and to 30 days by 2028, due to the increasing speed of vulnerability discovery and exploitation facilitated by AI.
PHP Sessions: A Third Alert in a Month
Turning to PHP, the phpAfterShell vulnerability (CVE-2026-126714) affects the default session handler, which stores sessions in files. The advisory warns that a partially overwritten session file could lead to code execution if an attacker can influence the session’s content and interrupt the writing process at just the right moment. The file upload tracking feature, which records the progress of a file upload within the session, creates a potential exploit path. This flaw has existed since PHP 4.1.0, and it has been rated a critical 9.2 out of 10 by the PHP project. However, exploiting this vulnerability requires an exploitable deserialization chain within the application itself.
This vulnerability marks the third serious alert concerning PHP sessions in just one month. On October 21, the PHP project urgently patched two critical vulnerabilities, CVE-2026-109618 and CVE-2026-109619—dubbed PHP2Shell by researchers. Just two days later, the project identified CVE-2026-115560, related to upload tracking and a real-time format change in serialization, which remained unfixed until November 19. “We recommend setting session.upload_progress.enabled to 0 until the next regular maintenance release to fully protect against an unlikely remote code execution vector,” the PHP project advised at that time. For the November 19 updates, the project noted the most serious vulnerabilities would likely require non-standard or rare configurations to be exploitable.
Outdated Engines and Unsupported Branches: A Blind Spot
Patching requires awareness of where these languages are deployed, as Cloudflare reports that many self-hosted applications include affected versions of Ruby, including GitLab, GitHub Enterprise Server, Mastodon, OpenProject, and Discourse. The responsibility for updating these applications lies with their respective publishers. Additionally, Linux distribution packages may apply the patch without changing the version number, potentially misleading inventory assessments based solely on version numbers.
Older branches pose their own challenges, as Ruby 3.2 and earlier versions are nearing their end of life and will not receive these fixes, per the language advisory. PHP, on the other hand, will only support patches for branches 8.2 to 8.5. In the meantime, the PHP project recommends disabling upload tracking when not in use, minimizing untrusted data stored in sessions, and eventually adopting a session storage strategy that replaces each entry in its entirety. For containerized environments, upgrading requires rebuilding images and restarting PHP-FPM, the PHP process manager.
Conducting an Inventory of Execution Environments: The First Step
For Chief Information Officers (CIOs) and Chief Information Security Officers (CISOs), these two series of patches highlight that the vulnerabilities lie within the languages themselves, particularly in internally developed applications that may be poorly tracked by inventories. Teams monitoring the Ruby and PHP versions running on their servers, container images, and embedded software can implement fixes within days. However, those without a clear picture of where these languages are deployed must first locate their instances as vulnerability discoveries accelerate.
Neither the Ruby nor the PHP advisories indicate any active exploitation, and the phpAfterShell vulnerability’s risk is contingent on specific application conditions. Nonetheless, time is of the essence for those lagging behind, as researchers at Veria Labs, who analyzed ruby2shell, are expected, according to Cloudflare, to release a proof of concept about a week after the vulnerability disclosure.



