CVE-2016-5019
📋 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
- Apache MyFaces Trinidad
📦 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.
🎯 Exploit Status
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
allImplement 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
allConfigure 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
- http://mail-archives.apache.org/mod_mbox/myfaces-users/201609.mbox/%3CCAM1yOjYM%2BEW3mLUfX0pNAVLfUFRAw-Bhvkp3UE5%3DEQzR8Yxsfw%40mail.gmail.com%3E
- http://packetstormsecurity.com/files/138920/Apache-MyFaces-Trinidad-Information-Disclosure.html
- http://www.oracle.com/technetwork/security-advisory/cpuapr2018-3678067.html
- http://www.oracle.com/technetwork/security-advisory/cpujul2016-2881720.html
- http://www.oracle.com/technetwork/security-advisory/cpujul2017-3236622.html
- http://www.oracle.com/technetwork/security-advisory/cpujul2018-4258247.html
- http://www.oracle.com/technetwork/security-advisory/cpuoct2017-3236626.html
- http://www.oracle.com/technetwork/security-advisory/cpuoct2018-4428296.html
- http://www.securityfocus.com/bid/93236
- http://www.securitytracker.com/id/1037633
- https://issues.apache.org/jira/browse/TRINIDAD-2542
- https://www.oracle.com/security-alerts/cpujan2020.html
- https://www.oracle.com/security-alerts/cpujul2020.html
- http://mail-archives.apache.org/mod_mbox/myfaces-users/201609.mbox/%3CCAM1yOjYM%2BEW3mLUfX0pNAVLfUFRAw-Bhvkp3UE5%3DEQzR8Yxsfw%40mail.gmail.com%3E
- http://packetstormsecurity.com/files/138920/Apache-MyFaces-Trinidad-Information-Disclosure.html
- http://www.oracle.com/technetwork/security-advisory/cpuapr2018-3678067.html
- http://www.oracle.com/technetwork/security-advisory/cpujul2016-2881720.html
- http://www.oracle.com/technetwork/security-advisory/cpujul2017-3236622.html
- http://www.oracle.com/technetwork/security-advisory/cpujul2018-4258247.html
- http://www.oracle.com/technetwork/security-advisory/cpuoct2017-3236626.html
- http://www.oracle.com/technetwork/security-advisory/cpuoct2018-4428296.html
- http://www.securityfocus.com/bid/93236
- http://www.securitytracker.com/id/1037633
- https://issues.apache.org/jira/browse/TRINIDAD-2542
- https://www.oracle.com/security-alerts/cpujan2020.html
- https://www.oracle.com/security-alerts/cpujul2020.html