-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Hi there!
First of all, thanks for publishing this set of rdf-related libraries, I've been having a lot of fun getting back in LD and using them.
I encountered something while building a small app on top of this, and I wondered if you might have some thoughts on this: how to handle (potentially untrusted) user input in SPARQL queries?
The two approaches I usually see in SQL are
- To use some form of placeholders in the query (eg
WHERE id = ?). It doesn't seem to be an option in sparql-ex, nor in another implementation of SPARQL I was looking at (oxigraph). - String concatenation with explicit escaping (though the previous option is often preferred). A few hits on stackoverflow (https://stackoverflow.com/questions/29601839/standard-regex-to-prevent-sparql-injection) suggest that this can be done in sparql by using triple quotes and escaping all backslashes, and single and double quotes.
Is that a topic you've encountered? If so, how do you usually deal with this?
I'd be happy to write a bit of documentation with what I can learn on the topic, if that sounds interesting to you.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels