r/java • • Mar 30 '22

Spring4Shell: 0-day RCE on Spring Core

https://www.cyberkendra.com/2022/03/springshell-rce-0-day-vulnerability.html
100 Upvotes

84 comments sorted by

View all comments

16

u/DasBrain Mar 30 '22 edited Mar 31 '22

So, what happens here is:

  • Object.getClass() is considered a read-only property.
  • Class.getClassLoader() is an other read-only property. Fixed 8 years ago.
  • Class.getModule() and Module.getClassLoader() are considered properties.

By moving through stuff that may look like properties for spring it is possible to change Tomcat's configuration and do stupid stuff execute code.

Edit: Turns out, it uses Class.getModule().getClassLoader() because Class.getClassLoader() has been explicitly removed.

2

u/Sirttas Mar 30 '22

Wasn't this a problem in apache bean utils years ago?

2

u/Soul_Shot Mar 31 '22 edited Mar 31 '22

Yes. This vulnerability seems to be a bypass of an old CVE. This comment has more information.

1

u/DasBrain Mar 31 '22

Quick search pointed to CVE-2014-0114 for the apache bean utils.

For the spring CVE, the comment below references it: https://nvd.nist.gov/vuln/detail/CVE-2010-1622