Re:Format Strings in Rust 1.58
by Latty on Friday January 14, 2022 @08:01AM
(#29933907)
Implementing string formatting the right way can actually solve this problem, of course. In modern JS/TS, for example, string formatting isn't just used for constructing strings, and it can limit input types as well.
This means you can construct some kind of prepared statement or similar object with a string format, and it will force the correct handling of potential injections.
Of course you can still just format a string and shove it in, but I'd argue that a good SQL library should simply not accept pure string queries and require the format that guarantees injection-safety.
This means you can construct some kind of prepared statement or similar object with a string format, and it will force the correct handling of potential injections.
Of course you can still just format a string and shove it in, but I'd argue that a good SQL library should simply not accept pure string queries and require the format that guarantees injection-safety.