Apache-Solr-RCE-via-Velocity-template
Reference link
Vulnerability Cause:
- When an attacker can directly access the Solr console, they can modify the node's configuration file by sending a POST request similar to /node_name/config.
- Apache Solr integrates the VelocityResponseWriter plugin by default. In the plugin's initialization parameters, the option params.resource.loader.enabled controls whether the parameter resource loader is allowed to specify templates in Solr request parameters. The default setting is false. When params.resource.loader.enabled is set to true, users are allowed to specify the loading of related resources by setting request parameters, which means an attacker can execute commands on the server by crafting a malicious attack request.
Vulnerability Reproduction: Recurring vulnerability
Method 1: Manual detection
Visit http://x.x.x.x:8983/solr/#/ to enter the main interface, and click Core Selector on the left to view the collection name.

Use the following two payloads
-
Modify the collection settings
