by hn_throwaway_99 · 4y ago · 0 comments
This is solely a mysqljs bug.
A library in a strongly typed language would still need to use parameterised queries or escape the strings just like a JS library. And it would be just as easy or difficult to have an incorrect sanitising function.
In fact, the specified string is not invalid input, it would be perfectly valid to store backticks in a string field in MySQL. They just need to be correctly escaped before being submitted to the database.
Again, the only bug here is the completely incorrect serialization that mysqljs does.