mirror of
https://github.com/github/codeql.git
synced 2025-12-17 09:13:20 +01:00
20 lines
430 B
JavaScript
20 lines
430 B
JavaScript
// dependencies
|
|
const axios = require('axios');
|
|
const express = require('express');
|
|
|
|
// start
|
|
const app = express();
|
|
|
|
app.get('/check-with-axios', validationMiddleware, req => {
|
|
axios.get("test.com/" + req.query.tainted); // OK is sanitized by the middleware - False Positive
|
|
});
|
|
|
|
|
|
const validationMiddleware = (req, res, next) => {
|
|
if (!Number.isInteger(req.query.tainted)) {
|
|
return res.sendStatus(400);
|
|
}
|
|
|
|
next();
|
|
}
|