A Remote Code Execution (RCE) vulnerability had discovered in FusionAuth. An authencated attacker can execute commands on system using the Apache FreeMarker Expression language.
What is FusionAuth?
FusionAuth is an identity access management application. It provides features like registration, login, SSO, MFA, password hashing, password constraints, password reset, email templates, OAuth, OpenID Connect and others. All the features of FusionAuth is available for free.
POC is available on GitHub.
An authenticated user can edit the template functions like site templates or email templates.
To create an email template without id using following POST request, id will be generated automatically,
Create an email template with the provided id,
FusionAuth uses Apache FreeMarker engine template. We can use Apache Freemarker Expression language to execute the system command. Template editing features can be abused to execute remote commands using the “freemarker.template.utility.Execute” object.
Vulnerability is exploitable by using following POST request, creates email template having id preview. After successful exploitation /etc/password file will be shown.
Image Source: techblog
Authenticated attacker can execute any system command on the operating system.
FusionAuth Prior to 1.11.0
This vulnerability is platform-independent. To protect your system from attack, patch with recent update from FusionAuth web page,
References & Sources: