0

When I scanned ASP.NET application using Burp Scanner Tool I got 'Open redirection (DOM-based)' issue in asp.net webresource.axd file. Please let me know if anyone experienced same issue, or if you have any idea or workaround can fix this issue.

Issue details are below:

Issue detail The application may be vulnerable to DOM-based open redirection. Data is read from document.location.pathname and written to the open() function of an XMLHttpRequest object via the following statements:

var action = theForm.action || document.location.pathname, fragmentIndex = action.indexOf('#');
action = action.substr(0, fragmentIndex);
action = encodeURI(path) + action.substr(queryIndex);
xmlRequest.open("POST", action, true);
Nico
  • 12,493
  • 5
  • 42
  • 62
Robin Joseph
  • 1
  • 1
  • 3

1 Answers1

0

Pardon my .NET ignorance, but let me attempt answer anyway, since this is a complex vulnerability and is language independent.

As you are crafting a URL to post to before doing your POST, it certainly opens a door for a hacker to inject malicious code on your page, then stealing data and identities. I presume this AXD file will land in Javascript somewhere.

Fixing this is doable. BURP complains about this pattern for a reason. Remove it. Instead, POST the data to your server as soon as you can, don't temper with the URLs in JS... Once the request lands on your server, validate your parameters (error our if your params contain js snippets).

In short, it's crafting a URL to redirect to (or AJAX POST to) that's not safe. Don't use that pattern.

Patrice Gagnon
  • 1,276
  • 14
  • 14