Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2023-50386 PoC — Apache Solr: Backup/Restore APIs allow for deployment of executables in malicious ConfigSets

Source
Associated Vulnerability
Title:Apache Solr: Backup/Restore APIs allow for deployment of executables in malicious ConfigSets (CVE-2023-50386)
Description:Improper Control of Dynamically-Managed Code Resources, Unrestricted Upload of File with Dangerous Type, Inclusion of Functionality from Untrusted Control Sphere vulnerability in Apache Solr.This issue affects Apache Solr: from 6.0.0 through 8.11.2, from 9.0.0 before 9.4.1. In the affected versions, Solr ConfigSets accepted Java jar and class files to be uploaded through the ConfigSets API. When backing up Solr Collections, these configSet files would be saved to disk when using the LocalFileSystemRepository (the default for backups). If the backup was saved to a directory that Solr uses in its ClassPath/ClassLoaders, then the jar and class files would be available to use with any ConfigSet, trusted or untrusted. When Solr is run in a secure way (Authorization enabled), as is strongly suggested, this vulnerability is limited to extending the Backup permissions with the ability to add libraries. Users are recommended to upgrade to version 8.11.3 or 9.4.1, which fix the issue. In these versions, the following protections have been added: * Users are no longer able to upload files to a configSet that could be executed via a Java ClassLoader. * The Backup API restricts saving backups to directories that are used in the ClassLoader.
Description
Apache Solr Backup/Restore APIs RCE Poc (CVE-2023-50386)
Readme
# Apache-Solr-RCE_CVE-2023-50386_POC
Apache Solr Backup/Restore APIs RCE Poc (CVE-2023-50386)



> 参考(向dalao们致敬):
>
> [CVE-2023-50386漏洞作者博客](https://l3yx.github.io/2024/02/10/Apache-Solr-Backup-Restore-APIs-RCE-CVE-2023-50386-%E5%88%86%E6%9E%90%E5%8F%8A%E6%8C%96%E6%8E%98%E6%80%9D%E8%B7%AF)
>
> [Java Security Manager绕过姿势](https://www.mi1k7ea.com/2020/05/03/%E6%B5%85%E6%9E%90Java%E6%B2%99%E7%AE%B1%E9%80%83%E9%80%B8/)
>
> [JDK 17下的反射保护绕过](https://pankas.top/2023/12/05/jdk17-%E5%8F%8D%E5%B0%84%E9%99%90%E5%88%B6%E7%BB%95%E8%BF%87)
>
> [JNI绕Rasp](https://javasec.org/javase/JNI/)

漏洞利用原理和思考:https://mp.weixin.qq.com/s/mO4e8aiuL56yBdOD4jy2qQ

poc是用[Pocsuite3](https://github.com/knownsec/pocsuite3)写的,直接用框架运行即可,若不使用框架,则提取其核心实现出来也可以

conf1.zip和conf2.zip可以直接使用

若需要自己测试和编译,Java的Exp都在src下面,包含了我所有测试用和能够使用的Exp

poc执行效果:

验证

![image-1](./pics/verify.png)

代码执行

![image-2](./pics/attack.png)
File Snapshot

[4.0K] /data/pocs/129bfedcbaa07e89a456129d42224c0c7b940d36 ├── [ 75K] conf1.zip ├── [ 74K] conf2.zip ├── [7.2K] CVE-2023-50386.py ├── [4.0K] pics │   ├── [ 68K] attack.png │   └── [ 58K] verify.png ├── [1.1K] README.md └── [4.0K] src └── [4.0K] main └── [4.0K] java └── [4.0K] zk_backup_0 └── [4.0K] configs └── [4.0K] conf1 ├── [ 52K] cmd.dll ├── [ 278] CommandExec.class ├── [ 116] CommandExec.java ├── [1.8K] ExpBypass1.java ├── [1.9K] ExpBypass4.java ├── [ 601] ExpBypass5.java ├── [1.5K] ExpBypass7.java ├── [1.6K] ExpBypassExec.java ├── [3.0K] ExpBypassLoader.java ├── [ 532] ExpBypassMain.java ├── [1013] Exp.java ├── [ 907] Main.java ├── [1.0K] zk_1backup_10_configs_conf1_CommandExec_exec.cpp └── [ 558] zk_backup_0_configs_conf1_CommandExec.h 7 directories, 20 files
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →