|
|
|
|
|
by menssen
2595 days ago
|
|
> you just need to parse incoming sql to sanitize it and make sure there is no role escalation "Just"? I guess I'm skeptical of a statement that begins "you just have to parse sql". Is this actually easier than I'm imagining it? I'd be curious to hear more about the security and authorization model of this approach. |
|
A good tool for this purpose is https://github.com/JavaScriptor/js-sql-parser as it will fail to parse complex statements that are likely to include an attack vector.
In terms of authorization, you can either create per user connection pools if using web sockets and log the user in directly that way (which makes things easy) or if you must use rest, use a single connection pool with a master user then use some form of token to tell the shim who to set role to before executing the query.