Skip to content

[Security Vulnerability] Fix for Server-Side Template Injection (SSTI) via #evaluate#98

Open
hayageek wants to merge 1 commit intogoogle:mainfrom
hayageek:main
Open

[Security Vulnerability] Fix for Server-Side Template Injection (SSTI) via #evaluate#98
hayageek wants to merge 1 commit intogoogle:mainfrom
hayageek:main

Conversation

@hayageek
Copy link

Summary

EscapeVelocity, does not sanitize user-controlled template variables passed to Template.evaluate(Map vars). When a template contains the #evaluate directive, the value of the evaluated variable is parsed and executed as a Velocity template. This allows Server-Side Template Injection (SSTI) and can lead to Remote Code Execution (RCE) via reflection.

Description

  • Type: Server-Side Template Injection (SSTI) leading to Remote Code Execution
  • Source: User-controlled template variables in the Map passed to Template.evaluate(Map vars)
  • Sink: Parser.java lines 1486–1492: new Parser(new StringReader(value)).parse() and template.render()
  • Data flow: User input in vars map → expression.evaluate(context) returns string → Parser parses string as template → template.render() executes injected directives (e.g. RCE via reflection)
  • Impact: Full RCE when attacker can control template variables and the template uses #evaluate($var).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant