youseries / ureport

UReport2 is a high-performance pure Java report engine based on Spring architecture, where complex Chinese-style statements and reports can be prepared by iterating over cells.
Apache License 2.0
2.02k stars 834 forks source link

Local malicious class loading and code execution vulnerability due to unauthorized access to designer page. #484

Open T3qui1a opened 4 years ago

T3qui1a commented 4 years ago

With the following source code, we can easily find that the 'class. Forname' method can load malicious classes.

image

'Class.forname' is a method for JVM to retrieve and load into memory. In this process, the static phase of loading class will be executed.

In other words, if a malicious class is defined in advance, you can execute the static code block of the malicious class here.

image

We successfully execute the code by loading the malicious classes set in advance.

image