Java : XML decoder injection
Classification
Overview
The application deserializes unvalidated XML file from an untrusted source using java.beans.XMLDecoder. This allows an attacker to execute arbitrary malicious code on the server.
JDK XMLEncoder and XMLDecoder classes provide simple methods for the permanent storage of objects by serializing them into XML documents.XMLDecoder also allows the developer to serialize method calls. If an attacker can specify XML-document that will be deserialized by the XMLDecoder class, he will be able to execute arbitrary malicious code on the server.
References
- OWASP: Testing for XML Injection
- OWASP Top 10 2017-A1-Injection
- OWASP Top 10 2013-A1-Injection
- CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code (‘Eval Injection’)
- CWE-116: Improper Encoding or Escaping of Output
- XMLDecoder - docs.oracle.com
- CWE CATEGORY: OWASP Top Ten 2017 Category A1 - Injection
DerScanner Severity Score
Check your Java code for this vulnerability, free
Request a free pilot of DerScanner. We give you access and help with the first scan. It works in the cloud and on-premise.
Try it on your code, free
By submitting this form, I acknowledge that DerScanner may process my personal data I provided above for purposes explained above. More details about the processing.
