Skip to content

Commit ca98c59

Browse files
committed
Add new CORS vulnerability example.
1 parent 32fb2e3 commit ca98c59

File tree

1 file changed

+12
-2
lines changed
  • src/main/java/org/joychou/controller

1 file changed

+12
-2
lines changed

src/main/java/org/joychou/controller/CORS.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
package org.joychou.controller;
22

3+
import org.joychou.utils.Security;
34
import org.springframework.stereotype.Controller;
4-
import org.springframework.web.bind.annotation.*;
5+
import org.springframework.web.bind.annotation.CrossOrigin;
6+
import org.springframework.web.bind.annotation.RequestMapping;
7+
import org.springframework.web.bind.annotation.ResponseBody;
8+
59
import javax.servlet.http.HttpServletRequest;
610
import javax.servlet.http.HttpServletResponse;
7-
import org.joychou.utils.Security;
811

912
/**
1013
* @author: JoyChou
@@ -46,6 +49,13 @@ private static String vuls2(HttpServletResponse response) {
4649
return info;
4750
}
4851

52+
@CrossOrigin("*")
53+
@RequestMapping("/vul3")
54+
@ResponseBody
55+
private static String vuls3(HttpServletResponse response) {
56+
return info;
57+
}
58+
4959
@RequestMapping("/sec")
5060
@ResponseBody
5161
private static String seccode(HttpServletRequest request, HttpServletResponse response) {

0 commit comments

Comments
 (0)