Discussion about this post

User's avatar
Craig Francis's avatar

Nice write up, can I go on a bit of a tangent, and talk about how Types can be used to prevent SQL Injection… specifically, we know we need to use parameterised queries, but mistakes still happen, so we can introduce the idea of a “literal-string” type (a string defined in the program, aka by the programmer), these can be concatenated together, but cannot include user data. Enforcing this type on the SQL string ensures that it’s safe from an Injection vulnerability. This can be done in Python and PHP today, but also in other languages via similar techniques: https://eiv.dev/

Expand full comment
2 more comments...

No posts