Gitleaks Validation #25
+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')));
|
||||
|
||||
// ==========================================
|
||||
// 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 || '';
|
||||
// A vulnerabilidade crítica: devolver o input diretamente no HTML
|
||||
res.send(`
|
||||
@@ -37,6 +37,15 @@ app.get('/api/search', (req, res) => {
|
||||
</body>
|
||||
</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)
|
||||
|
||||
Reference in New Issue
Block a user