Skip to content

How to sanitize user inputs from untrusted sources? #2500

Closed Answered by bakaq
jjtolton asked this question in Q&A
Discussion options

You must be logged in to vote

That would be the "deserialization" part (in quotes because there is more to it than that). What I think would actually be necessary to use that as escaping is to have some way of turning a Value into something akin to what write_canonical/2 would print, because then you can really just interpolate it into a query string and it would just work. This doesn't seem all that difficult, but there are a lot of edge cases, and any string would get ~7 times bigger because of '.'(a,'.'(b,...)) shenanigans. Even better would be to have an API to put the term directly into the Scryer Prolog heap and let it handle the rest, but with what I know of the internals that seems to have even more tricky edg…

Replies: 3 comments 14 replies

Comment options

You must be logged in to vote
9 replies
@jjtolton
Comment options

@jjtolton
Comment options

@hurufu
Comment options

@jjtolton
Comment options

@hurufu
Comment options

Comment options

You must be logged in to vote
1 reply
@bakaq
Comment options

Answer selected by jjtolton
Comment options

You must be logged in to vote
4 replies
@hurufu
Comment options

@jjtolton
Comment options

@jjtolton
Comment options

@hurufu
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants