18 karma · joined March 5, 2022
Unfortunately, shellcheck did not catch that. At least not with the default settings. But if you are implementing anything remotely security-critical, you should not be using shell anyway.
Is there any dynamic content generation involved? I am wondering because the Gateway timeout hints at something behind nginx being the bottleneck. Don't you just serve static files? Maybe you could configure nginx to cache dynamic resources if they only change once a day or even consider turning dynamic resources into static resources by generating them once per day and serving them as static files.
I don't know the internals of the (binary) protocol used for communication with the MySQL server though. Couldn't one just save the extra round-trip with length-prefixed strings by sending the query together with the parameters in a single message?
[1]: http://www.gosecure.it/blog/art/483/sec/mysql_escape_string-...
[1]: https://dev.mysql.com/doc/refman/8.0/en/sql-prepared-stateme...