CVE-2019-11831

9.8 CRITICAL

📋 TL;DR

This vulnerability in PharStreamWrapper allows attackers to bypass directory traversal protections in TYPO3's phar:// stream wrapper. By using specially crafted URLs like phar:///path/bad.phar/../good.phar, attackers can circumvent deserialization safeguards, potentially leading to remote code execution. This affects TYPO3 installations using vulnerable versions of the phar-stream-wrapper package.

💻 Affected Systems

Products:
  • TYPO3 CMS
  • TYPO3 phar-stream-wrapper package
Versions: phar-stream-wrapper 2.x before 2.1.1, 3.x before 3.1.1
Operating Systems: All platforms running affected TYPO3 versions
Default Config Vulnerable: ⚠️ Yes
Notes: Any TYPO3 installation using phar:// URLs with the vulnerable wrapper is affected.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution leading to complete system compromise, data theft, or ransomware deployment.

🟠

Likely Case

Arbitrary file read/write, privilege escalation, or deserialization attacks leading to application compromise.

🟢

If Mitigated

Limited impact with proper input validation and file system permissions in place.

🌐 Internet-Facing: HIGH - Web applications using TYPO3 with vulnerable phar-stream-wrapper are directly exposed.
🏢 Internal Only: MEDIUM - Internal applications still vulnerable but with reduced attack surface.

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Proof of concept demonstrated in advisory; exploitation requires ability to upload or reference phar files.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: phar-stream-wrapper v2.1.1 or v3.1.1

Vendor Advisory: https://github.com/TYPO3/phar-stream-wrapper/releases

Restart Required: No

Instructions:

1. Update phar-stream-wrapper package to v2.1.1 (for 2.x) or v3.1.1 (for 3.x). 2. Update TYPO3 CMS if it bundles the vulnerable package. 3. Verify no regressions in phar:// stream functionality.

🔧 Temporary Workarounds

Disable phar:// wrapper

all

Temporarily disable the phar:// stream wrapper in PHP configuration

php -d phar.readonly=1
Add 'phar.readonly = 1' to php.ini

Input validation filter

all

Implement strict input validation to reject phar:// URLs with directory traversal patterns

🧯 If You Can't Patch

  • Implement web application firewall rules to block phar:// URLs with traversal sequences
  • Restrict file upload capabilities and monitor for suspicious phar file usage

🔍 How to Verify

Check if Vulnerable:

Check composer.json or package version: composer show typo3/phar-stream-wrapper

Check Version:

composer show typo3/phar-stream-wrapper | grep version

Verify Fix Applied:

Verify installed version is 2.1.1+ or 3.1.1+: composer show typo3/phar-stream-wrapper | grep version

📡 Detection & Monitoring

Log Indicators:

  • phar:// URLs with ../ sequences in access logs
  • Unexpected file operations via phar wrapper

Network Indicators:

  • HTTP requests containing phar:// paths with traversal patterns

SIEM Query:

web_access_logs WHERE url CONTAINS 'phar://' AND url CONTAINS '../'

🔗 References

📤 Share & Export