Skip to content

Commit b90bf78

Browse files
author
“threedr3am”
committed
fix:shiro错误实例
1 parent efdff37 commit b90bf78

File tree

2 files changed

+7
-22
lines changed

2 files changed

+7
-22
lines changed

shiro/auth-bypass(shiro<1.5.2)/src/main/java/com/threedr3am/bug/shiro/bypass/auth/config/ShiroConfig.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ ShiroFilterFactoryBean shiroFilterFactoryBean() {
3636
Map<String, String> map = new LinkedHashMap();
3737
map.put("/login", "anon");
3838
map.put("/bypass", "authc");
39+
map.put("/bypass.*", "authc");
40+
map.put("/bypass/**", "authc");
3941
bean.setFilterChainDefinitionMap(map);
4042
return bean;
4143
}

shiro/auth-bypass(shiro<1.5.2)/src/main/java/com/threedr3am/bug/shiro/bypass/auth/controller/BypassTestController.java

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,41 +7,24 @@
77
/**
88
* CVE-2020-1957
99
*
10-
* todo 当存在某个Controller使用了动态Controller时,例:存在接口/bypass和/bypass/{id},就能通过访问 http://localhost:8080/bypass.xxxxx 或 http://localhost:8080/aaaaa/..;/bypass 绕过接口/bypass的认证控制
11-
* todo When there is a dynamic Controller, the Controller USES the example: there are api interface /bypass and /bypass/{id}, you can visit http://localhost:8080/bypass.xxxxx or http://localhost:8080/aaaaa/..;bypass to bypass authentication
10+
* todo 通过访问 http://localhost:8080/bypass.xxxxx 或 http://localhost:8080/aaaaa/..;/bypass 绕过接口/bypass的认证控制
1211
*
13-
* todo 漏洞点在于使用了getRequestURI
14-
* todo The vulnerability point is in use 'getRequestURI()'
12+
* * todo 漏洞点在于使用了getRequestURI
13+
* * todo The vulnerability point is in use 'getRequestURI()'
1514
*
16-
* /aaaaa/..;/bypass
17-
* /bypass.xxxxx
15+
* todo /aaaaa/..;/bypass -> bypass -> ("/bypass", "authc")、("/bypass.*", "authc")、("/bypass/**", "authc") (shiro <= 1.5.1)
16+
* todo /bypass.xxxxx -> bypass -> ("/bypass", "authc")、("/bypass/**", "authc") (shiro all version)
1817
*
1918
* @author threedr3am
2019
*/
2120
@RestController
2221
public class BypassTestController {
2322

2423
/**
25-
*
26-
* 例:配置"/bypass", "authc",请求http://localhost:8080/bypass.xxxxx
27-
*
28-
* Example: configuration "/bypass", "authc", request to http://localhost:8080/bypass.xxxxx bypass
29-
*
30-
* shiro < 1.5.2
31-
*
3224
* @return
3325
*/
3426
@RequestMapping(value = "/bypass", method = RequestMethod.GET)
3527
public String bypass() {
3628
return "bypass1";
3729
}
38-
39-
/**
40-
* @param id
41-
* @return
42-
*/
43-
@RequestMapping(value = "/bypass/{id}", method = RequestMethod.GET)
44-
public String bypass2(String id) {
45-
return "bypass2";
46-
}
4730
}

0 commit comments

Comments
 (0)