Skip to content
New issue

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

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

Already on GitHub? # to your account

thymeleaf SSTI vulnerability which can cause Remote-Command-Execution #2613

Closed
p1n93r opened this issue Jul 8, 2023 · 3 comments
Closed
Labels

Comments

@p1n93r
Copy link

p1n93r commented Jul 8, 2023

Reference to https://github.com/p1n93r/SpringBootAdmin-thymeleaf-SSTI

@erikpetzold
Copy link
Member

Hi @p1n93r , thanks for reporting, we will look into this.
In any case you will need POST Access to /env, right?

For users:
This attack requires explicitly allowing POST requests in the config.
The endpoint is provided by Spring Cloud and already has security warnings in the docs: https://docs.spring.io/spring-cloud-commons/docs/current/reference/html/#endpoints

The current quick fix is to set

management:
  endpoint:
    env:
      post:
        enabled: false

(which is also the default, need only to change if you have it set to true)

We will investigate what we can do in Spring Boot Admin to make this more secure.

@p1n93r p1n93r closed this as completed Jul 10, 2023
@p1n93r p1n93r reopened this Jul 10, 2023
@p1n93r
Copy link
Author

p1n93r commented Jul 10, 2023

yes, only you have the POST Access to /env can attack success.

For springboot-admin, you can try restricting the template property of the MailNotifier to not allow protocols like file:/// or http://. Additionally, consider adding sandbox rules for Thymeleaf.

@SteKoe
Copy link
Contributor

SteKoe commented Jul 14, 2023

Hi @p1n93r,

we have implemented a change that just allows to load classpath resources as suggested.

@SteKoe SteKoe closed this as completed Jul 14, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants