[VIVO-1697] Add sanitization to fix SPARQL injection vulnerability #111
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There is a SPARQL query injection vulnerability in VIVO. Below is an example of a request that triggers the vulnerability:
I sent an email to info@duraspace.org on 2019-01-21 to report this vulnerability. Nobody replied so I am posting this pull request to fix the issue.
I have written up the reproduction steps in more detail here.
There are numerous places in the code that look like similar bugs, but I have not investigated whether any of the others are exploitable. I would recommend that you add sanitization to all of them though. You can see the list of source locations that should be fixed here:
https://lgtm.com/query/6380177318884151820/
I will apply for a CVE for this vulnerability.