Cyber Security News

PHP XXE Injection Vulnerability Let Attackers Read Config Files & Private Keys

Security researchers have uncovered a sophisticated XML External Entity (XXE) injection vulnerability in PHP applications that could allow attackers to access sensitive configuration files and private keys.

The vulnerability, discovered by researcher Aleksandr Zhurnakov, affects PHP applications using certain libxml flags during XML processing, potentially exposing critical server-side information even with standard security measures in place.

The vulnerability enables attackers to bypass multiple security mechanisms designed to prevent XXE attacks, including the LIBXML_NONET flag which is intended to block external network connections during XML parsing.

This attack vector works even when developers follow seemingly secure coding practices.

Analysts at PT Swarm identified that the exploitation chain involves a complex series of bypasses that together create what they describe as an “almost impossible XXE vulnerability.”

Working XXE Payload (Source – PT Swarm)

Their analysis shows the attack could be particularly devastating for identity providers and authentication systems.

The technical core of the vulnerability involves exploiting the way PHP’s libxml extension processes XML Parameter Entities.

A vulnerable code pattern identified in the research involves using the loadXML function with the LIBXML_DTDLOAD flag, as seen in this code snippet:-

$doc = new \DOMDocument();
$doc->loadXML($_POST['user_input']);
$xml = $doc->saveXML();
$doc = new \DOMDocument('1.0', 'UTF-8');
$doc->loadXML($xml, LIBXML_DTDLOAD | LIBXML_NONET);

The exploitation process involves crafting a special DOCTYPE declaration that bypasses filtering mechanisms.

The attacker can then use PHP wrapper techniques combined with Parameter Entity abuse to read local files and exfiltrate their contents.

Real-World Impact

The vulnerability has already been discovered in SimpleSAMLphp (CVE-2024-52596), where it allowed unauthorized users to read configuration files and access private keys used for signing SAML assertions.

This effectively permitted complete bypass of authentication mechanisms for SimpleSAMLphp installations configured as Identity Providers.

What makes this vulnerability particularly concerning is that it works without the need for the LIBXML_NOENT or LIBXML_DTDVALID flags, which are typically required for XXE exploitation.

It also demonstrates techniques for bypassing network restrictions using the data: protocol combined with PHP filters.

Security experts recommend immediately updating affected applications and implementing proper XML parsing configurations that explicitly disable DTD processing using the LIBXML_NO_XXE flag introduced in PHP 8.4.0.

Are you from SOC/DFIR Teams? – Analyse Malware Incidents & get live Access with ANY.RUN -> Start Now for Free.

Tushar Subhra Dutta

Tushar is a senior cybersecurity and breach reporter. He specializes in covering cybersecurity news, trends, and emerging threats, data breaches, and malware attacks. With years of experience, he brings clarity and depth to complex security topics.

Recent Posts

OpenAI Launches GPT-6 Cyber That Finds 81 Firefox Flaws and Develops 948 Linux Exploits

OpenAI has launched GPT-6 Cyber, a security-focused AI model that found 81 new high-severity Firefox…

3 hours ago

Shopify Mandates IP Allowlisting for Public Apps to Prevent Unauthorized Admin API Access

Shopify is making IP allowlisting mandatory for public apps that call its Admin API, adding…

4 hours ago

Microsoft Paint 0-Click Vulnerability Could Allow Hackers to Take Control of Windows PCs

Microsoft’s Windows Paint vulnerability, CVE-2026-83844, could allow an unauthenticated attacker to execute code over a…

4 hours ago

OpenMatter Network Positions Decentralized Computing as an Alternative to Data Centers for AI

Melbourne, Florida, November 5th, 2026, CyberNewswire OpenMatter Network, a pioneer in decentralized infrastructure for agentic…

12 hours ago

GhostMap Android Flaw Can Trap Phones in Endless Reboot Loops Without Opening an App

A new Android bug named GhostMap can leave a phone stuck in a crash loop…

13 hours ago

Hackers Turn Popular Chinese Keyboard Software Into a Backdoor for Cyberespionage Attacks

A China-aligned hacking group is abusing Sogou Input Method, one of the most popular Chinese…

14 hours ago