|
|
|
|
|
by Sohcahtoa82
999 days ago
|
|
> I just got beaten up in HN for asking how the hell sql injection is still a problem. It's possible for developers to think they're actually doing the right thing, but it turns out they're not. https://www.npmjs.com/package/mysql#escaping-query-values > This looks similar to prepared statements in MySQL, however it really just uses the same connection.escape() method internally. And depending on how the MySQL server is configured, connection.escape() can be bypassed. |
|
So yeah, I'm coming from a PHP mindset where you can generally trust your engine to bind and escape values. My experience with Nodejs in this particular area caused me to write a lot of excess code (mostly to satisfy my own curiosity) and still convinced me not to trust it for the purpose.
In that light, I can understand how someone who jumped into the Nodejs ecosystem would think they were dealing with reliably safe escaping, and didn't realize what they were actually getting if they didn't read the fine print.