Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong code modification leads to Shiro deserialization vulnerability #20

Open
BetterDefender opened this issue Mar 13, 2021 · 0 comments

Comments

@BetterDefender
Copy link

The cause of the vulnerability
The project uses shiro1.7.0 version, this version should not have this vulnerability;
image
image
Code layer troubleshooting:

  1. The default key is used (one of the reasons for this vulnerability)
    image
  2. From the point of view of the exploited gadget, the commonscollection exploit chain is used (the second reason for this vulnerability), and the commons-collections vulnerability should use version 3.2.2 and above
    image
  3. Check shiro related calling code:
    image
    The Shiro deserialization vulnerability is caused by calling the getRememberedSerializedIdentity() function of the CookieRememberMeManager class. The official repair code is as follows, the repair plan is to delete the CookieRememberMeManager class
    image
    The CookieRememberMeManager class was added when the open source project was rewritten, which led to the generation of vulnerabilities.

Exploit:
You can use the following tools to exploit this vulnerability, Github project: https://github.com/j1anFen/shiro_attack
image
Execute system commands
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant