Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SOLR-13971: CVE-2019-17558: Velocity custom template RCE vulnerability #1156

Closed
wants to merge 2 commits into from

Conversation

Sachpat
Copy link

@Sachpat Sachpat commented Jan 8, 2020

Description

This is the fix for CVE-2019-17558: Velocity custom template RCE vulnerability, which was fixed for 8.3 and I provided the same fix for 7.7 as per the discussion here:
https://issues.apache.org/jira/browse/SOLR-13971?focusedCommentId=17010489&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17010489

Checklist

Please review the following and check all that apply:

  • I have reviewed the guidelines for How to Contribute and my code conforms to the standards described there to the best of my ability.
  • I have created a Jira issue and added the issue ID to my pull request title.
  • I have given Solr maintainers access to contribute to my PR branch. (optional but recommended)
  • I have developed this patch against the master branch.
  • I have run ant precommit and the appropriate test suite.
  • I have added tests for my changes.
  • I have added documentation for the Ref Guide (for Solr changes only).

@Sachpat
Copy link
Author

Sachpat commented Jan 8, 2020

@chatman please take a look :)

@Sachpat Sachpat changed the title SOLR-13971 SOLR-13971: CVE-2019-17558: Velocity custom template RCE vulnerability Jan 8, 2020
@Sachpat
Copy link
Author

Sachpat commented Jan 8, 2020

@erikhatcher I also committed the changes for SOLR-14025 in this.

</queryResponseWriter>
*/
// Custom tools can override any of the built-in tools provided above, by registering one with the same name
if (request.getCore().getCoreDescriptor().isConfigSetTrusted()) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it checks request.getCore().getCoreDescriptor().isConfigSetTrusted() twice. I suppose one check may be removed.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's right @artem-smotrakov . Actually I tried to align the code according to the original patch 9dfee35. It was also the same there :) @erikhatcher , should I change it or keep it as it is?

@chatman
Copy link
Contributor

chatman commented Jan 13, 2020

Merged. Thanks. Lets close this PR.

@Sachpat
Copy link
Author

Sachpat commented Jan 13, 2020

Thanks for merging it @chatman . Will close this PR now.

@Sachpat Sachpat closed this Jan 13, 2020
@rhtham
Copy link

rhtham commented Feb 10, 2021

@chatman I am trying to figure out if the following is a mitigation step for CVE-2019-17558 on SOLR 6.1. None of our solrconfig.xml contains the lib references to the velocity jar files as follows:

lib dir="${solr.install.dir:../../../..}/contrib/velocity/lib" regex="..jar"
lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-velocity-\d.
.jar"

It doesn't appear that you can add these jars references using the config API. Without these references, you are not able to flip the params.resource.loader.enabled to true using the config API. If you are not able to flip the flag and none of your cores have these lib references then is the risk present?

Thanks in advance!

@erikhatcher
Copy link
Contributor

No. Without those libs, no risk present.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants