Skip to main content

Remote Configuration Disclosure and Code Execution in a Legacy TYPO3 Instance

Illustration of Remote Configuration Disclosure and Code Execution in a Legacy TYPO3 Instance
Dariusz Tytko

During an external penetration test I identified a critical vulnerability that grants unauthenticated users full visibility of the application side configuration and a direct path to server side code execution.

Introduction

The target site operates on TYPO3 CMS version 6.2.31, a release line that addresses some patches, including the security bulletin referenced as typo3 psa 2020 001. Because the instance still exposes the auxiliary validateHash controller, any visitor can request a Hash based Message Authentication Code for an arbitrary value. TYPO3 relies on that to protect form metadata sent from client to server, once an attacker can mint valid HMACs, every integrity barrier collapses. The following sections reproduce the proof of concept chronology performed during the audit.

Discovery methodology

The reconnaissance phase began with automated fingerprinting through typo3scan. Command line output pinpointed the backend login endpoint and disclosed that the host core is fixed at version 6.2.31:

Version fingerprinting

Given the age of that branch, the I checked public advisories and confirmed that validateHash remains vulnerable. No public exploit code was available, so the corresponding patch was inspected to understand the vulnerability.

The patch notes revealed that a request of the form /?eID=validateHash&value=< payload >&addition= returns a digest calculated with the global encryptionKey. A live probe against production confirmed oracle behaviour - submitting the value test yielded an immediate SHA 1 HMAC: In the HTTP response, I saw below:

Oracle behavior confirmation

In the HTTP response, I saw below:

HMAC response

At this point, the team I was able to sign any payload I wanted, which was necessary to bypass the integrity check that came next.

EXPLOITATION WORKFLOW

Capturing a legitimate HMAC Protected Request

Traffic interception during a standard newsletter sign up supplied a practical specimen of HMAC guarded parameters. The POST targeted /newsletter/newsletter.html and contained two notable fields: variable_pi1[__referrer][@request] and variable_pi1[__trustedProperties]. The latter embedded a serialized PHP array followed by its HMAC:

HMAC protected request

Because the digest is validated server side before deserialization, forging a substitute object became possible once I could calculate a “fresh” signature.

Generating a PHP Object Injection payload

Using phpggc, a gadget based on GuzzleHttp\Psr7\FnStream was produced. The object’s destructor executes phpinfo, chosen just for demonstrative purposes:

Gadget generation

Signing the payload via the Oracle

The serialized object was URL encoded and submitted to validateHash, returning a valid digest (be10[…]5ebb). The payload and its signature now mirrored the format observed in the intercepted request:

Payload signing

In the HTTP response, we can see:

Signed payload response

Replaying the tampered newsletter form

In the final step I replaced the original __trustedProperties value with the signed gadget and replayed the entire multipart POST:

Request replay

As a result, output of phpinfo function was returned:

PHPinfo execution

TYPO3 processed the forged metadata, executed the destructor inside the request context and issued a 303 See Other. The redirected page displayed the complete output of phpinfo(), validating remote code execution under the web server account.

Post exploitation findings

Inspection of the phpinfo disclosure uncovered:

a) clear text database credentials:

Database credentials

b) e-mail API secret:

Email API secret

c) bcrypt hash securing the TYPO3 Install Tool:

Install Tool hash

The hash was extracted and passed to hashcat, where it succumbed quickly to dictionary attack, providing administrative backend access:

Hash cracking

Additional environment variables revealed several internal IP addresses, effectively mapping the application subnet:

Internal IP mapping

Together, these pieces of evidence showed that confidentiality was broken, integrity was at risk, and paths for moving deeper into the system were revealed, all without needing to be logged in.

Conclusion

The audit shows that retaining TYPO3 6.2.31 in production invites catastrophic compromise. By exploiting a single unauthenticated oracle, I escalated from passive fingerprinting to full configuration disclosure and arbitrary code execution, following a six step chain: version identification, HMAC oracle confirmation, live request capture, gadget construction, payload signing and request replay.

Other Insights

Illustration of Overriding Data Loss Prevention Controls via Misconfigurations and Endpoint Security Bypass

Overriding Data Loss Prevention Controls via Misconfigurations and Endpoint Security Bypass

Dominik Antończak

Data Loss Prevention (DLP) solutions are often implemented in corporate environments to prevent unauthorized exfiltration of intellectual property, code, and other sensitive materials. These systems typically rely on a combination of monitoring, filtering, and dynamic rule enforcement to detect any suspicious attempt to copy critical files to unapproved external devices or cloud-based services.

READ article
Illustration of Unrestricted File Upload Leading to Arbitrary Code Execution and NTLM Hash Disclosure

Unrestricted File Upload Leading to Arbitrary Code Execution and NTLM Hash Disclosure

Dominik Antończak

During a security audit, I found a critical vulnerability in the file upload mechanism of an application designed to receive user-submitted requests. This vulnerability enables attackers to upload and subsequently execute malicious files on the server with administrative privileges. Furthermore, it allows a maliciously crafted PDF file to steal the NTLM hash of the user who opens it, potentially enabling lateral movement and privilege escalation within the infrastructure. This write-up provides technical details, a proof of concept (PoC), and recommended remediation strategies.

READ article
Illustration of Exploiting improper password reset token validation – an uncommon authentication flaw enabling account takeover

Exploiting improper password reset token validation – an uncommon authentication flaw enabling account takeover

PIOTR ĆWIKLIŃSKI

During a security audit of a web application, I discovered an uncommon flaw in the password reset mechanism. Due to insufficient server-side validation, the application failed to properly verify the presence and validity of a reset token, which is a core element of any secure password recovery flow. This oversight made it possible for an attacker to bypass the verification process entirely and reset the password of any user, ultimately leading to full account takeover.

READ article
A professional cybersecurity consultant ready to assist with your inquiry.

Any questions?

Happy to get a call or email
and help!