diff --git a/api/server.js b/api/server.js index 627019f..75871f6 100644 --- a/api/server.js +++ b/api/server.js @@ -87,6 +87,19 @@ io.on("connection", (socket) => { return; } + try { + const priceInt = parseInt(price); + const amountInt = parseInt(amount); + + if (isNaN(priceInt) || isNaN(amountInt)) { + callback(false); + return; + } + } catch (e) { + callback(false); + return; + } + if (price < 0 || price > 10000 || amount < 0 || amount > 20) { callback(false); return;