Rapid7 Vulnerability & Exploit Database

Apache Solr Remote Code Execution via Velocity Template

Back to Search

Apache Solr Remote Code Execution via Velocity Template

Disclosed
10/29/2019
Created
04/02/2020

Description

This module exploits a vulnerability in Apache Solr <= 8.3.0 which allows remote code execution via a custom Velocity template. Currently, this module only supports Solr basic authentication. From the Tenable advisory: An attacker could target a vulnerable Apache Solr instance by first identifying a list of Solr core names. Once the core names have been identified, an attacker can send a specially crafted HTTP POST request to the Config API to toggle the params resource loader value for the Velocity Response Writer in the solrconfig.xml file to true. Enabling this parameter would allow an attacker to use the Velocity template parameter in a specially crafted Solr request, leading to RCE.

Author(s)

  • s00py
  • jas502n
  • AleWong
  • Imran E. Dawoodjee <imran@threathounds.com>

Platform

Linux,Unix,Windows

Development

Module Options

To display the available options, load the module within the Metasploit console and run the commands 'show options' or 'show advanced':

msf > use exploit/multi/http/solr_velocity_rce
msf exploit(solr_velocity_rce) > show targets
    ...targets...
msf exploit(solr_velocity_rce) > set TARGET < target-id >
msf exploit(solr_velocity_rce) > show options
    ...show and set options...
msf exploit(solr_velocity_rce) > exploit

Time is precious, so I don’t want to do something manually that I can automate. Leveraging the Metasploit Framework when automating any task keeps us from having to re-create the wheel as we can use the existing libraries and focus our efforts where it matters.

– Jim O’Gorman | President, Offensive Security

;