CVE-2016-5019

9.8 CRITICAL

📋 TL;DR

This vulnerability in Apache MyFaces Trinidad allows attackers to execute arbitrary code through deserialization attacks by sending a crafted serialized view state string. It affects web applications using vulnerable versions of the Trinidad framework. Successful exploitation could lead to complete system compromise.

💻 Affected Systems

Products:
  • Apache MyFaces Trinidad
Versions: 1.0.0 through 1.0.13, 1.2.x before 1.2.15, 2.0.x before 2.0.2, and 2.1.x before 2.1.2
Operating Systems: All operating systems running Java applications
Default Config Vulnerable: ⚠️ Yes
Notes: Affects applications using Trinidad's CoreResponseStateManager with default serialization settings.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution leading to full system compromise, data theft, and complete control of affected servers.

🟠

Likely Case

Remote code execution allowing attackers to execute arbitrary commands on the server, potentially leading to data exfiltration or further network penetration.

🟢

If Mitigated

Attack prevented through proper input validation, updated libraries, or network segmentation limiting impact.

🌐 Internet-Facing: HIGH - Web applications are typically internet-facing, making them directly accessible to attackers.
🏢 Internal Only: MEDIUM - Internal applications could still be exploited by compromised internal users or through lateral movement.

🎯 Exploit Status

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

Exploitation requires sending crafted HTTP requests to vulnerable endpoints. Public exploit code exists in security advisories.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Trinidad 1.0.14, 1.2.15, 2.0.2, 2.1.2 or later

Vendor Advisory: http://mail-archives.apache.org/mod_mbox/myfaces-users/201609.mbox/%3CCAM1yOjYM%2BEW3mLUfX0pNAVLfUFRAw-Bhvkp3UE5%3DEQzR8Yxsfw%40mail.gmail.com%3E

Restart Required: Yes

Instructions:

1. Identify Trinidad version in your application. 2. Update to patched version via Maven/Gradle or manual download. 3. Rebuild and redeploy application. 4. Restart application server.

🔧 Temporary Workarounds

Input Validation Filter

all

Implement servlet filter to validate and sanitize view state parameters before processing.

Implement custom filter in web.xml and Java class to inspect and block malicious serialized data

Disable Serialized View State

all

Configure Trinidad to use client-side state saving instead of server-side serialization.

Set trinidad-config.xml parameter: <state-saving>client</state-saving>

🧯 If You Can't Patch

  • Implement network segmentation to isolate vulnerable applications from critical systems
  • Deploy web application firewall (WAF) with rules to detect and block deserialization attacks

🔍 How to Verify

Check if Vulnerable:

Check application's Trinidad library version in pom.xml, build.gradle, or WEB-INF/lib directory.

Check Version:

java -cp trinidad-impl-*.jar org.apache.myfaces.trinidad.util.Version

Verify Fix Applied:

Verify updated Trinidad JAR files in WEB-INF/lib show version 1.0.14+, 1.2.15+, 2.0.2+, or 2.1.2+.

📡 Detection & Monitoring

Log Indicators:

  • Java deserialization errors in application logs
  • Unexpected ClassNotFoundException or InvalidClassException
  • Suspicious HTTP requests with encoded view state parameters

Network Indicators:

  • HTTP POST requests with unusually long or encoded viewState parameters
  • Requests to Trinidad-specific endpoints like /faces/*

SIEM Query:

source="application.logs" AND ("ClassNotFoundException" OR "InvalidClassException" OR "deserialization")

🔗 References

📤 Share & Export