From 936cea8723fdba362a06feb6809d3a06ae31659c Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sun, 10 Jan 2021 22:49:14 -0800 Subject: validate amounts --- routes/assets.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'routes/assets.js') diff --git a/routes/assets.js b/routes/assets.js index 270a3e78..9a9c6836 100644 --- a/routes/assets.js +++ b/routes/assets.js @@ -286,11 +286,13 @@ app.post( ah(async (req, res) => { const { user } = req; const { asset, amount } = req.body; + amount = parseInt(amount); try { await db.transaction(async transaction => { let { account } = user; + if (amount < 0) throw new Error("Amount to load cannot be negative"); if (account.asset !== config.liquid.btcasset) throw new Error( "Faucet has to be funded with bitcoin. Try sending from another wallet." -- cgit v1.2.3