From de4978a854094fbb0303f44891bc2c8259806d6a Mon Sep 17 00:00:00 2001 From: Daniel Lugo Date: Mon, 17 Jan 2022 16:07:58 -0400 Subject: [PATCH] Validate request parameters --- src/routes.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/routes.js b/src/routes.js index 00e69897..22aa4254 100644 --- a/src/routes.js +++ b/src/routes.js @@ -1899,6 +1899,12 @@ module.exports = async ( app.get('/api/lnd/transactions', (req, res) => { const { lightning } = LightningServices.services const { page, paginate = true, itemsPerPage } = req.query + if (typeof page !== 'number') { + throw new TypeError('page is not a number') + } + if (typeof itemsPerPage !== 'number') { + throw new TypeError('itemsPerPage is not a number') + } lightning.getTransactions({}, (err, { transactions = [] } = {}) => { if (err) { return handleError(res, err)