-
Notifications
You must be signed in to change notification settings - Fork 157
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
High vulnerability issue 'thymeleaf-spring5' dependency JAR #263
Comments
Just received a notification by Snyk. |
@danielfernandez Do you have a rough estimation when version 3.0.13 with the fix will be available? Thanks! |
The fix is extremely urgent since it breaks all the builds on vulnerability scanning!
|
Just in order to reduce anxiety around this issue, I'd like to explain that CVE-2021-43466 only affects those applications that contain controllers or controller configurations that take a request parameter and directly use it, without previous filtering, as the name of the view to be rendered — which is something IMHO no one should be doing, as it is a bit like voluntarily providing a way for code injection. This is actually just a border case that was not covered by the overall fix for this scenario that was included in 3.0.12. Current |
If it's rarely exploitable, I wouldn't expect it to have a severity of 9.8/10 |
@OrangeDog there are quite a lot of things about how this CVE was registered and reported that I wouldn't have expected either. Right now the link explaining the exploit isn't even online anymore (fortunately I could read it before it disappeared), and the description simply says "combined with specific scenarios in template injection" in a hugely generic way when it refers to developers voluntarily creating a security hole in their Spring controller code that, yes, would end up making Thymeleaf execute what it shouldn't. This CVE is exactly the same as declaring it for SpringEL because, in theory, you could use it for executing whatever someone sends you in a request parameter. And as for the severity, I assume that was basically "code injection" -> "critical". |
Also, you know, the whole "responsible disclosure" thing so there's already a fix before the details are published. Perhaps you can complain and get it a more appropriate severity. |
I'm a little surprised this didn't happen yet within 1 week after the snapshot release. Since it's a patch release, I'd think this is a no-brainer that would be executed by some automatism within minutes/hours? |
I have two questions: 1.) Is this vulnerability specific only to that exact version or are previous versions vulnerable, too? Thank you for your transparency... |
It definitely affects this artifact that includes it: <dependency>
<groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf-spring5</artifactId>
<version>3.0.12.RELEASE</version>
<scope>compile</scope>
</dependency> |
@dmitry-weirdo That is quite clear - the question was about previous versions and related packages... |
Thymeleaf 3.0.13.RELEASE has just been released. |
Sounds very good. When will it and the related Spring artifact be available in the maven repo? |
@dmitry-weirdo around 11 hours ago |
@OrangeDog Are you 146% sure? Then I and dependabot/renovate are both blind since we don't see anything new in the repo, see: |
@dmitry-weirdo That search index takes a while to update. The actual repo is here: |
@OrangeDog Thanks for the hint. The aforementioned artifacts are now also in the search index. However, I added a ticket for Spring boot here — spring-projects/spring-boot#28893. |
@dmitry-weirdo in order to use this new version of Thymeleaf in a Spring Boot application you only need to define this property:
|
@danielfernandez Thank you for the hint, but it doesn't seem to fix the CVE caught by |
@dmitry-weirdo then you've set up your Spring Boot project incorrectly. |
Can confirm. If you are inheriting from spring-boot-starter-parent (as most spring boot applications do) then overriding the relevant maven property will override the spring managed version. If you aren't inheriting from spring-boot-starter-parent then you will need to add explicit dependencyManagement configuration to your application.... this is would be generally be considered an anti-practice in spring. In the specific issue of thymeleaf-spring5... I updated numerous applications to use 3.0.13.RELEASE with the aforementioned property two days back with zero issues. |
Most probably you're right. Here is how my maven configs look like: Parent <properties>
<!-- ... -->
<spring-boot.version>2.6.1</spring-boot.version>
<thymeleaf.version>3.0.13.RELEASE</thymeleaf.version> <!-- see https://github.com/thymeleaf/thymeleaf-spring/issues/263#issuecomment-984568545 -->
<!-- ... -->
</properties>
<!-- ... -->
<dependencyManagement>
<!-- ... -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>${spring-boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- ... -->
</dependencyManagement> Child <!-- ... -->
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<!-- ... -->
</dependencies>
<!-- ... --> I also tried to add Could you probably make a hint on how to switch the Thymeleaf version in this kind of configuration, please? |
You aren't using spring-boot-starter-parent as the maven parent for your application... that is the problem. You should be doing:
See https://start.spring.io/ for a complete example. |
Please note Thymeleaf |
High Severity CVE-2021-43466
Template Injection: thymeleaf-spring5 is vulnerable to template injection. An attacker can inject malicious input through the
render
function inAjaxThymeleafView.java
, leading to remote code execution.Can you please look into it ?
The text was updated successfully, but these errors were encountered: