Dopo la scansione della mia applicazione Web con Acunetix, i risultati hanno mostrato 9 istanze di "Modulo HTML trovato nella pagina di reindirizzamento". Le intestazioni HTTP per riprodurre l'attacco di prova sono i seguenti:Test di sicurezza del sito Web Mostra Response.Redirect vulnerabile a un attacco
Request
GET /entities/add HTTP/1.1
Pragma: no-cache
Referer: https://test.mysite.com/entities/view
Acunetix-Aspect: enabled
Acunetix-Aspect-Password: 082119f75623eb7abd7bf357698ff66c
Acunetix-Aspect-Queries: filelist;aspectalerts
Cookie: __AntiXsrfToken=97c0a6bb164d4121b07327df405f9db4; mysitecookie=
Host: test.mysite.com
Connection: Keep-alive
Accept-Encoding: gzip,deflate
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
Acunetix-Product: WVS/8.0 (Acunetix Web Vulnerability Scanner - NORMAL)
Acunetix-Scanning-agreement: Third Party Scanning PROHIBITED
Acunetix-User-agreement: http://www.acunetix.com/wvs/disc.htm
Accept: */*
Response
HTTP/1.1 302 Found
Cache-Control: private
Content-Type: text/html; charset=utf-8
Location: /login
Server: Microsoft-IIS/7.5
X-AspNet-Version: 4.0.30319
Set-Cookie: mysitecookie=; expires=Mon, 11-Oct-1999 22:00:00 GMT; path=/; HttpOnly
X-Powered-By: ASP.NET
Date: Tue, 24 Sep 2013 10:38:12 GMT
Content-Length: 9447
La Location: /login
parte della risposta mi ha portato a credere che se ho finito la risposta dopo reindirizzando l'utente alla pagina di login, la vulnerabilità potrebbe essere collegato. Così ho cambiato tutte le istanze di questo codice:
protected void Page_Load(object sender, EventArgs e)
{
if (!HttpContext.Current.User.Identity.IsAuthenticated)
{
Response.Redirect("/login");
}
else
{
// etc
}
}
a:
protected void Page_Load(object sender, EventArgs e)
{
if (!HttpContext.Current.User.Identity.IsAuthenticated)
{
Response.Redirect("/login", true);
}
else
{
// etc
}
}
Quale potrebbe essere il motivo per cui è ancora mostrando come vulnerabile?
Acunetix ha un sacco di documentazione. Invece di chiedere la gente qui, perché non leggi la documentazione di Acunetix? http://www.acunetix.com/blog/web-security-zone/html-form-found-in-redirect-page/ descrive il tuo scenario particolare. Il problema teorico qui è che avresti potuto rendere * la * pagina * reale * con un reindirizzamento alla pagina di accesso. – bzlm