SonarQube Validation v4
DevSecOps Enterprise Pipeline / security-gate-and-deploy (pull_request) Failing after 10s
DevSecOps Enterprise Pipeline / security-gate-and-deploy (pull_request) Failing after 10s
This commit is contained in:
+11
-2
@@ -23,9 +23,9 @@ app.get('/careers', (req, res) => res.sendFile(path.join(__dirname, '../frontend
|
|||||||
app.get('/contact', (req, res) => res.sendFile(path.join(__dirname, '../frontend/contact.html')));
|
app.get('/contact', (req, res) => res.sendFile(path.join(__dirname, '../frontend/contact.html')));
|
||||||
|
|
||||||
// ==========================================
|
// ==========================================
|
||||||
// VULNERÁVEL (OWASP ZAP) / SonarQube
|
// VULNERÁVEL (OWASP ZAP)
|
||||||
// ==========================================
|
// ==========================================
|
||||||
app.get('/api/search', (req, res) => {
|
/*app.get('/api/search', (req, res) => {
|
||||||
const termo = req.query.q || '';
|
const termo = req.query.q || '';
|
||||||
// A vulnerabilidade crítica: devolver o input diretamente no HTML
|
// A vulnerabilidade crítica: devolver o input diretamente no HTML
|
||||||
res.send(`
|
res.send(`
|
||||||
@@ -37,6 +37,15 @@ app.get('/api/search', (req, res) => {
|
|||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
`);
|
`);
|
||||||
|
});*/
|
||||||
|
|
||||||
|
app.get('/api/calculate', (req, res) => {
|
||||||
|
const mathExpression = req.query.expr || '2+2';
|
||||||
|
|
||||||
|
// VULNERABILIDADE CRÍTICA: O eval() executa qualquer código cego que o utilizador envie
|
||||||
|
const result = eval(mathExpression);
|
||||||
|
|
||||||
|
res.json({ result: result });
|
||||||
});
|
});
|
||||||
|
|
||||||
// Configuração do transporte de E-mail (Mocks de teste vs Produção)
|
// Configuração do transporte de E-mail (Mocks de teste vs Produção)
|
||||||
|
|||||||
Reference in New Issue
Block a user