You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 10, 2025. It is now read-only.
Thanks @katopz
wasm-joey has a single function which performs the SQL request so I think the best way to implement escaping is to use the generic ? placeholder (and pass in both the query string and an array of the parameters to map).
functionperformSqlQuery(string_query,parameter_array){returnnewPromise(function(resolve,reject){connection.query(string_query,parameter_array,function(err,resultSelect){if(err){res.status(400).send("Perhaps a bad request, or database is not running");}resolve(resultSelect);});});}
The code calling this single performSqlQuery would then be updated to look like the following.
functionupdateAOT(_wasm_id,_ssvm_options,_is_an_update){// snipvarsqlSelect="SELECT wasm_binary from wasm_executables WHERE wasm_id = ?;";varparameterArray=[_wasm_id];performSqlQuery(sqlSelect,parameterArray).then((result,error)=>{// snip});}
Placeholders have been implemented up until line 1563 and will continue to be updated from line 1592 onwards (approximately 19 of 52 have been updated at this stage)
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Is your feature request related to a problem? Please describe.
I think current SQL code didn't escape or prevent SQL injection? e.g.
Describe the solution you'd like
We should prevent SQL injection somehow.
as explain here https://blog.sqreen.com/preventing-sql-injection-in-node-js-and-other-vulnerabilities/
The text was updated successfully, but these errors were encountered: