Files
vulhub/shiro/CVE-2020-1957/README.md
Aaron 63285f61aa
Some checks failed
Vulhub Format Check and Lint / format-check (push) Has been cancelled
Vulhub Format Check and Lint / markdown-check (push) Has been cancelled
Vulhub Docker Image CI / longtime-images-test (push) Has been cancelled
Vulhub Docker Image CI / images-test (push) Has been cancelled
first commit
2025-09-06 16:08:15 +08:00

1.6 KiB

Apache Shiro Authentication Bypass Vulnerability (CVE-2020-1957)

中文版本(Chinese version)

Apache Shiro is a powerful and easy-to-use Java security framework that performs authentication, authorization, cryptography, and session management.

In versions of Apache Shiro prior to 1.5.2 with the Spring dynamic controller, an attacker can construct a maliciously crafted request using ..; to bypass the directory authentication.

Reference links:

Vulnerability environment

Start an application with Spring 2.2.2 and Shiro 1.5.1 by executing the following command.

docker compose up -d

Once the environment is started, visit http://your-ip:8080 to see the home page.

The configuration of URL permissions in this application is as follows.

@Bean
public ShiroFilterChainDefinition shiroFilterChainDefinition() {
    DefaultShiroFilterChainDefinition chainDefinition = new DefaultShiroFilterChainDefinition();
    chainDefinition.addPathDefinition("/login.html", "authc"); // need to accept POSTs from the login form
    chainDefinition.addPathDefinition("/logout", "logout");
    chainDefinition.addPathDefinition("/admin/**", "authc");
    return chainDefinition;
}

Exploit

A direct request to the admin page /admin/ is inaccessible and will be redirected to the login page.

Construct a malicious request /xxx/..;/admin/ to bypass authentication checks and access the admin page.