Coder Social home page Coder Social logo

Security issues about thymeleaf-itutorial HOT 14 CLOSED

thymeleaf avatar thymeleaf commented on June 12, 2024
Security issues

from thymeleaf-itutorial.

Comments (14)

jmiguelsamper avatar jmiguelsamper commented on June 12, 2024

We should address these issues if we finally use CloudFoundry instead of GoogleAppEngine.

from thymeleaf-itutorial.

danielfernandez avatar danielfernandez commented on June 12, 2024

Does Cloud Foundry allow complete execution of any arbitrary expression on the Java Runtime classes?

from thymeleaf-itutorial.

jmiguelsamper avatar jmiguelsamper commented on June 12, 2024

Yes... I've just tried

      <span th:text="${T(java.lang.System).exit(0)}">...</span>

and then the website returns a 404 response.

from thymeleaf-itutorial.

danielfernandez avatar danielfernandez commented on June 12, 2024

Wow. IMHO, that is a Cloud Foundry issue... maybe reporting it to them could be a good idea?

from thymeleaf-itutorial.

ultraq avatar ultraq commented on June 12, 2024

You can do that?! Hahaha :D

from thymeleaf-itutorial.

jmiguelsamper avatar jmiguelsamper commented on June 12, 2024

The concept of CloudFoundry is quite different from GAE. GAE gives you a restricted runtime enviroment whilst CF gives you an Amazon AWS instance for you.
Then, in your Amazon AWS instance you install a pre-packaged Tomcat server and deploy your app in your Tomcat (you do that with just one command).
So I assume it is your responsability to manage your Tomcat instance properly.

from thymeleaf-itutorial.

danielfernandez avatar danielfernandez commented on June 12, 2024

Understood. Hmm... and does CloudFoundry allow you to configure your own SecurityManager for that Tomcat instance?

In fact, I still think CF should add such SecurityManager by default. CF is PaaS, not IaaS, so it should offer you these things, IMHO. If you wanted an IaaS service, then you should just use AWS directly...

from thymeleaf-itutorial.

jmiguelsamper avatar jmiguelsamper commented on June 12, 2024

I suppose you can do anything.

I'm using the default "java buildpack"

but you can create your "custom buildpacks" (although I don't know if it is easy).

from thymeleaf-itutorial.

danielfernandez avatar danielfernandez commented on June 12, 2024

Well... given we still don't know whether the CF deployment would be right for us in terms of billing (compared to GAE), I would try to avoid spending too much effort on adapting the application to a deployment we cannot know for sure we'll still be using in 2-month's time.

So.. @jmiguelsamper could you please create a ticket at CF's JIRA explaining our situation and giving them detail about why we need our users to execute any expression, but protect the system from things like the above?... at least that way we'll be able to have some "official explanation" about how this scenario should be handled...

To be honest, this whole thing makes it look like GAE is much more suitable for our tutorial, at least for now... :-(

from thymeleaf-itutorial.

jmiguelsamper avatar jmiguelsamper commented on June 12, 2024

Ok, I read a bit more the documentation, tried the Tomcat's security manager in local and finally posted a question in the CF's official forums:

from thymeleaf-itutorial.

jmiguelsamper avatar jmiguelsamper commented on June 12, 2024

Got response from CF. If we want to enable Tomcat's security manager we have to build our custom java-buildpack.

from thymeleaf-itutorial.

danielfernandez avatar danielfernandez commented on June 12, 2024

And that looks like a lot of work, right?

from thymeleaf-itutorial.

jmiguelsamper avatar jmiguelsamper commented on June 12, 2024

Yeah... the instructions are quite clear:

  • Fork java-buildpack
  • Modify tomcat spec to add -security parameter to Tomcat's start command.
  • Provide a custom catalina.policy file with proper permissions (default catalina.policy does not allow Spring framework to start).

from thymeleaf-itutorial.

jmiguelsamper avatar jmiguelsamper commented on June 12, 2024

This was finally solved implementing a org.springframework.expression.TypeLocator which controls the expressions that can be executed inside a SpEL expression.

from thymeleaf-itutorial.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.