Fix CodeQL log injections (#95)
This commit is contained in:
@@ -10,6 +10,7 @@
|
|||||||
try {
|
try {
|
||||||
|
|
||||||
//Debug
|
//Debug
|
||||||
|
login = login.replace(/[\n\r]/g, "")
|
||||||
console.debug(`metrics/compute/${login} > start`)
|
console.debug(`metrics/compute/${login} > start`)
|
||||||
console.debug(util.inspect(q, {depth:Infinity, maxStringLength:256}))
|
console.debug(util.inspect(q, {depth:Infinity, maxStringLength:256}))
|
||||||
|
|
||||||
|
|||||||
@@ -140,7 +140,7 @@
|
|||||||
//Metrics
|
//Metrics
|
||||||
app.get("/:login", ...middlewares, async (req, res) => {
|
app.get("/:login", ...middlewares, async (req, res) => {
|
||||||
//Request params
|
//Request params
|
||||||
const {login} = req.params
|
const login = req.params.login?.replace(/[\n\r]/g, "")
|
||||||
if ((restricted.length)&&(!restricted.includes(login))) {
|
if ((restricted.length)&&(!restricted.includes(login))) {
|
||||||
console.debug(`metrics/app/${login} > 403 (not in whitelisted users)`)
|
console.debug(`metrics/app/${login} > 403 (not in whitelisted users)`)
|
||||||
return res.sendStatus(403)
|
return res.sendStatus(403)
|
||||||
|
|||||||
Reference in New Issue
Block a user