diff options
author | kaotisk <kaotisk@arching-kaos.org> | 2024-06-04 16:48:40 +0300 |
---|---|---|
committer | kaotisk <kaotisk@arching-kaos.org> | 2024-06-04 16:48:40 +0300 |
commit | b9ba1a96e6a93e203f26da3e20ce1d4987925318 (patch) | |
tree | aa0820c5fa85bdd003df727016727965a94e73e1 /api/routes/getMrk | |
parent | 8f5f4a30da8f3226ff5337d1da8f76f7eed08034 (diff) | |
download | arching-kaos-tools-b9ba1a96e6a93e203f26da3e20ce1d4987925318.tar.gz arching-kaos-tools-b9ba1a96e6a93e203f26da3e20ce1d4987925318.tar.bz2 arching-kaos-tools-b9ba1a96e6a93e203f26da3e20ce1d4987925318.zip |
Path traversal fix + validation
Diffstat (limited to 'api/routes/getMrk')
-rw-r--r-- | api/routes/getMrk/index.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/api/routes/getMrk/index.js b/api/routes/getMrk/index.js index 6cc61b8..35a0a2d 100644 --- a/api/routes/getMrk/index.js +++ b/api/routes/getMrk/index.js @@ -46,7 +46,7 @@ function fetchFmrk(mrk, res){ module.exports = (req, res) => { console.log(req.params) res.set('Content-Type', 'application/json'); - if ( (req.params.mrk) && req.params.mrk.length === 128 ){ + if ( (req.params.mrk) && typeof req.params.mrk === "string" && req.params.mrk.length === 128 ){ regex= /[a-f0-9]{128}/; if (regex.test(req.params.mrk)){ let mrk = req.params.mrk; |