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

[VIVO-1697] Add sanitization to fix SPARQL injection vulnerability #111

Merged
merged 1 commit into from
Jul 15, 2019
Merged

[VIVO-1697] Add sanitization to fix SPARQL injection vulnerability #111

merged 1 commit into from
Jul 15, 2019

Conversation

kevinbackhouse
Copy link
Contributor

@kevinbackhouse kevinbackhouse commented Jan 28, 2019

There is a SPARQL query injection vulnerability in VIVO. Below is an example of a request that triggers the vulnerability:

curl http://172.18.0.10:8080/vivo/individual?uri=http%3A%2F%2Fvivoweb.org%2Fontology%2Fcore%23FacultyMember%3E%20%3Fp%20%3Fo%20.%20FILTER%20regex%28%22aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa%21%22%2C%20%22%28.%2Aa%29%7B50%7D%22%29%20%7D%20%23%20

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.

@kevinbackhouse
Copy link
Contributor Author

@awoods
Copy link
Member

awoods commented Jan 29, 2019

Thank you, @kevinbackhouse.

Copy link
Member

@gneissone gneissone left a comment

Choose a reason for hiding this comment

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

Tested proposed injection vulnerability and confirmed VIVO hangs. Tested with fix and 'Individual not found' is returned as expected.

@gneissone gneissone changed the title Add sanitization to fix SPARQL injection vulnerability [VIVO-1697] Add sanitization to fix SPARQL injection vulnerability Jul 9, 2019
@gneissone
Copy link
Member

Added a Jira ticket to track: https://jira.duraspace.org/browse/VIVO-1697

@awoods
Copy link
Member

awoods commented Jul 12, 2019

Thanks, @gneissone

@gneissone gneissone merged commit dd04f3d into vivo-project:develop Jul 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants