Submit #1045050: dromara lamp-cloud d61184d7d402023fc3ea63b6bdbd7a1bfdb8ce92 CWE-94 | Improper Control of Generation of Code (Code Injectioninfo

Titledromara lamp-cloud d61184d7d402023fc3ea63b6bdbd7a1bfdb8ce92 CWE-94 | Improper Control of Generation of Code (Code Injection
DescriptionA Server-Side Template Injection (SSTI) vulnerability exists in the lamp-cloud microservice framework that allows an external attacker to achieve arbitrary Remote Code Execution (RCE) on the server. The root cause is that `FreeMarkerUtil.java` configures a `BeansWrapper(VERSION_2_3_30)` without restricting the `?new` built-in via `setNewBuiltinClassResolver(SAFER_RESOLVER)`, leaving the default `UNRESTRICTED_RESOLVER` in place. User-controlled template content stored in the database via the `/defMsgTemplate` endpoint is later rendered directly as a FreeMarker template body (not as a data variable) when triggered through `/extendMsg/sendByTemplate`. An attacker can inject a FreeMarker payload such as `<#assign ex="freemarker.template.utility.Execute"?new()>${ex("touch /tmp/pwned")}` to instantiate the `freemarker.template.utility.Execute` class and run arbitrary operating-system commands.
Source⚠️ https://github.com/dromara/lamp-cloud/issues/417
User poppingsnack (UID 102221)
Submission10/20/2026 10:32 (29 days ago)
Moderation11/18/2026 19:18 (29 days later)
StatusDuplicate
VulDB entry365481 [Dromara lamp-cloud up to 5.6.2 Message Template GroovyClassLoader.parseClass DefMsgTemplate.content special elements in template engine]
Points0