owasp zap config v13
DevSecOps Enterprise Pipeline / security-gate-and-deploy (pull_request) Successful in 44s
DevSecOps Enterprise Pipeline / security-gate-and-deploy (pull_request) Successful in 44s
This commit is contained in:
+11
-1
@@ -35,6 +35,16 @@ describe('Enterprise Application Flow & API Validation', () => {
|
||||
const response = await request(app).get('/invalid-admin-route');
|
||||
expect(response.status).toBe(404);
|
||||
});
|
||||
|
||||
// NOVO TESTE: Valida a nossa armadilha para o OWASP ZAP (corrigido para /api/search)
|
||||
it('Should reflect the search query in the HTML response (/api/search) - Vulnerable to XSS', async () => {
|
||||
const maliciousPayload = '<script>alert("ZAP")</script>';
|
||||
const response = await request(app).get(`/api/search?q=${maliciousPayload}`);
|
||||
|
||||
expect(response.status).toBe(200);
|
||||
// Verifica se o payload é refletido exatamente como entrou (confirmando a vulnerabilidade)
|
||||
expect(response.text).toContain(`Resultados para: ${maliciousPayload}`);
|
||||
});
|
||||
});
|
||||
|
||||
// ==========================================
|
||||
@@ -58,7 +68,7 @@ describe('Enterprise Application Flow & API Validation', () => {
|
||||
// Lemos o response.text (HTML) em vez do response.body (JSON)
|
||||
// ==========================================
|
||||
expect(response.text).toContain('Erro de Validação');
|
||||
expect(response.text).toContain('John'); // Garante que o input foi refletido na página (a vulnerabilidade XSS)
|
||||
expect(response.text).toContain('John'); // Garante que o input foi refletido na página
|
||||
});
|
||||
|
||||
it('Should process request, return 200 OK, and invoke SMTP transporter with valid data', async () => {
|
||||
|
||||
Reference in New Issue
Block a user