-
Notifications
You must be signed in to change notification settings - Fork 665
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
43 changed files
with
747 additions
and
778 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ | |
/** | ||
* Java 1.7/1.8 no CRLF vulns (test in Java 1.7/1.8) | ||
* | ||
* @author JoyChou ([email protected]) @2018-01-03 | ||
* @author JoyChou ([email protected]) @2018-01-03 | ||
*/ | ||
@Controller | ||
@RequestMapping("/crlf") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
* check csrf using spring-security | ||
* Access http://localhost:8080/csrf/ -> click submit | ||
* | ||
* @author JoyChou ([email protected]) @2019-05-31 | ||
* @author JoyChou ([email protected]) @2019-05-31 | ||
*/ | ||
@Controller | ||
@RequestMapping("/csrf") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ | |
import javax.servlet.http.HttpServletResponse; | ||
|
||
/** | ||
* @author JoyChou ([email protected]) @2018.10.24 | ||
* @author JoyChou ([email protected]) @2018.10.24 | ||
* https://github.com/JoyChou93/java-sec-code/wiki/CORS | ||
*/ | ||
|
||
|
@@ -106,7 +106,7 @@ public String seccode(HttpServletRequest request, HttpServletResponse response) | |
|
||
// 如果origin不为空并且origin不在白名单内,认定为不安全。 | ||
// 如果origin为空,表示是同域过来的请求或者浏览器直接发起的请求。 | ||
if ( origin != null && SecurityUtil.checkURL(origin) == null ) { | ||
if (origin != null && SecurityUtil.checkURL(origin) == null) { | ||
return "Origin is not safe."; | ||
} | ||
response.setHeader("Access-Control-Allow-Origin", origin); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.