poggit / libasynql

Asynchronous MySQL access library for PocketMine plugins.
https://poggit.github.io/libasynql
Apache License 2.0
134 stars 45 forks source link

Abolish the use of parameter escapes completely. #57

Open SOF3 opened 3 years ago

SOF3 commented 3 years ago

Currently, all parameters except MySQL strings are formatted on the main thread and interpolated into the query.

This is dangerous as it increases the risk of SQL injection attacks. Although there is no immediately known impact, this increases the risk in the future and relies on the correct implementation of integer formatting code, which is not guaranteed to be secure.

Furthermore, bound parameters do not need a formatting-parsing roundtrip and is likely to bring better performance for the query sending process.