ie8 fix
madison

Zero Day

Ryan Naraine, Emil Protalinski and Dancho Danchev

URL rewriting can help thwart Web app attacks

By | February 27, 2009, 8:28am PST

Summary: A Microsoft Web application security specialist is suggesting an offbeat defense-in-depth strategy to protect Web sites and applications from cross-site scripting (XSS) and cross-site request forgery (XSRF) attacks. According to Bryan Sullivan, security program manager for Redmond’s Security Development Lifecycle team, Web developers should consider URL Rewriting as a technique to ward off hackers looking to [...]

A Microsoft Web application security specialist is suggesting an offbeat defense-in-depth strategy to protect Web sites and applications from cross-site scripting (XSS) and cross-site request forgery (XSRF) attacks.

According to Bryan Sullivan, security program manager for Redmond’s Security Development Lifecycle team, Web developers should consider URL Rewriting as a technique to ward off hackers looking to exploit Web app vulnerabilities.

Here’s the gist of Sullivan’s recommendation:

  • Attacks like cross-site scripting (XSS), cross-site request forgery (XSRF), and open-redirect phishing are routinely propagated through malicious hyperlinks sent in e-mail messages. (If you’re unfamiliar with these attacks, I recommend reading about them at the Open Web Application Security Project (OWASP) Web.) We could mitigate much of the risk of these vulnerabilities by frequently changing our URLs — not once every 200 years but once every 10 minutes. Attackers would no longer be able to exploit application vulnerabilities by mass e-mailing poisoned hyperlinks because the links would be broken and invalid by the time the messages reached their intended victims.

Of course, there are some caveats, especially in cases where bookmarking and e-mailing static links are necessary:

  • URL rewriting may not be appropriate for all applications. One negative side effect of this approach is that although attackers are no longer able to e-mail malicious hyperlinks, legitimate users are similarly prevented from sending valid links or even from bookmarking pages in the application. Any page marked as a landing page could be bookmarked, but as I mentioned before, you need to be very cautious when using landing pages. Therefore, if you expect users of your application to bookmark pages other than the home page, URL rewriting is probably not a good solution for you.
  • Additionally, while URL rewriting is a fast and easy defense-in-depth mechanism, it is just that: defense-in-depth. It is by no means a silver bullet against XSS or any other attacks. An automatically expiring URL can still be exploited by an attacker with access to a Web server of his own. Instead of sending out malicious hyperlinks that point directly to the vulnerable page, he can send out hyperlinks that point to his own site. When his site gets a hit from one of the phished e-mails, it can contact a landing page on the vulnerable site to obtain a valid time stamp and then redirect the user accordingly.

Sullivan argues that URL rewriting does make the attacker’s work more difficult: he now has to convince a user to follow a hyperlink to his Web site (evil.contoso.com) rather than a trusted one (www.msn.com), and he is also leaving a very clear trail back to himself for law enforcement agencies to follow. However, this will probably be of little comfort to any victims who fall for the phished e-mail and have their identities stolen as a result.

  • Do use URL rewriting as an extra defensive measure, but always be sure to address vulnerabilities at the root of the problem.

Read the entire article here.

Kick off your day with ZDNet's daily e-mail newsletter. It's the freshest tech news and opinion, served hot. Get it.

Topics

Ryan Naraine is a journalist and social media enthusiast specializing in Internet and computer security issues.

Disclosure

Ryan Naraine

The most important disclosure is of my employment with Kaspersky Lab as a member of the global research and analysis team. Kaspersky Lab is a global company specializing in anti-malware and secure content management technologies. I do not own stocks or other investments in any technology company.

Biography

Ryan Naraine

Ryan Naraine is a journalist and social media enthusiast specializing in Internet and computer security issues. He is currently security evangelist at Kaspersky Lab, an anti-malware company with operations around the globe. He is taking a leadership role in developing the company's online community initiative around secure content management technologies.

Prior to joining Kaspersky Lab, Ryan was Editor-at-Large/Security at eWEEK, leading the magazine's and Web site's coverage of Internet and computer security issues and managing the popular SecurityWatch blog, covering the daily threats, vulnerabilities and IT security technologies. He also covered IT security, hacker attacks and secure content management topics for Jupiter Media's internetnetnews.com.

Ryan can be reached at naraine SHIFT 2 gmail.com. For daily updates on Ryan's activities, follow him on Twitter.

Related Discussions on TechRepublic

Did you know you can take part in these discussions with your ZDNet membership?
13
Comments

Join the conversation!

Just In

RE: URL rewriting can help thwart Web app attacks
birumut Updated - 3rd May 2011
Well done! Thank you very much for professional templates and community edition
seslisohbet seslichat
0 Votes
+ -
Clear Trail?
rpmyers1 27th Feb 2009
How many phish sites are on compromised boxes?
0 Votes
+ -
Pen testing and vuln testing find many, many "hidden" holes.

If good, solid programming were adopted, you'd never find anything.

No need to break bookmarks and other "defense in depth" fixes.

Just insist on good programming.
0 Votes
+ -
*ALWAYS* Use defense in depth
rpmyers1 2nd Mar 2009
People make mistakes. Period. It doesn't matter how good a programmer you are, or the processes you use, there WILL be mistakes made. The best you can do is minimize the effect of those mistakes.

0 Votes
+ -
This works...as long as developers don't use the HTTP session ID for the URL rewriting portion (which is likely what most of them will do). If that happens, you end up with session IDs in log files (via Referer [sic] for example). In that case, you are protecting from one attack, but making another easier. So IMO, it's important to mention just don't use your session ID for the variant part of the URL rewriting.

-kevin wall
0 Votes
+ -
Like that?
dusan.vrban@... Updated - 2nd Mar 2009
Since I ain't no security expert... just
wondering if
this is ok?

http://www.svetijuraj.com/appartments-in-
croatian-coast.aspx

(hmm, link is too long for this editor or what?
)


0 Votes
+ -
RE: URL rewriting can help thwart Web app attacks
alf@... Updated - 3rd Mar 2009
Wow. Break bookmarks and your webapp is safe! Shut down the webserver, and it's safer still!
(From: Great Moments in Web Application Security)
0 Votes
+ -
Search Engine Optimisation
Sunday Ironfoot 3rd Mar 2009
This is a terrible idea, not only does it break bookmarks, but it breaks Search Engine Optimisaion. Google et al. will index your site via the URLs, if the URLs change then the search links are no longer valid. Search engines are extremely protective of their search results returning accurate results and will regularly re-index websites to see if anything has changed. If your URLs keep changing, the search engine will simply shy way from indexing your website entirely.

Also it's going to break URLs posted in forums, message boards, emails, instant messenger programs, blogs etc. etc.

A great way to add a little bit of extra security while completely destroying your online business in the process!
0 Votes
+ -
The article is missing the entire point.

First of all, it's a suggestion from a Microsoft Web application security specialist which tells those in the know that this guy doesn't really know what he's talking about as there is no such thing.

True Web application experts will tell their people to NOT use IE, NOT use Active-X and NOT use Microsoft's web page building tools which incorporate the majority of the problems of cross-site scripting which the rest of this article attemps to explain.

As for re-writing the page every 10 minutes... (* ROFLOL *)

It would be much easier... and much more secure to invest in a NON-Microsoft solution that isn't as succeptible to such attacks as Microsoft based solutions are!

Nuff Said.

Walt
0 Votes
+ -
Utter nonsense! Not just a Microsoft problem!
Sunday Ironfoot 5th Mar 2009
Sorry, I'm not usually rude to people on internet message boards/forums etc, but your post has forced my hand. What you're saying is utter nonsense! The security issue here is XSS (Cross Site Scripting) which effects every server-side web technology there is (PHP, Java, Ruby etc etc) not just Microsoft technologies. It's more a fundamental issue to the way the web works in general, and has nothing to with Microsoft or their tools. Different server-side technologies have different ways of dealing with it, but it effects them all, and if any website becomes vilnerable to XSS it's more down to bad programmers and lack of understand (which you seem to demonstrate here) than the technology itself.

It's not an IE issue either which you seem to think it is, Firefox, Safari et al. are also effected.

I'd recommend you go and learn what XSS actually is!
0 Votes
+ -
This just sounds like a bad solution.

The first analogy that came to mind was cutting ones leg off to avoid stubbing ones toes.

We need a better solution.
0 Votes
+ -
not to be curmudgeonous
vilppuu@... 3rd Mar 2009
Yeah I can see it now, AJAX and DHTML in hand with
DURL...... or maybe XURL (eXchange URL) Web2.1
Social Engineering does that mean uncover the "Stupidity Quotient"?
0 Votes
+ -
Please delete!
Sunday Ironfoot Updated - 5th Mar 2009
Sorry, please delete this message, I was suppose to be replying to another comment in here (hit the wrong button) happy
0 Votes
+ -
RE: URL rewriting can help thwart Web app attacks
birumut Updated - 3rd May 2011
Well done! Thank you very much for professional templates and community edition
seslisohbet seslichat

Join the conversation!

Formatting +
BB Codes - Note: HTML is not supported in forums
  • [b] Bold [/b]
  • [i] Italic [/i]
  • [u] Underline [/u]
  • [s] Strikethrough [/s]
  • [q] "Quote" [/q]
  • [ol][*] 1. Ordered List [/ol]
  • [ul][*] · Unordered List [/ul]
  • [pre] Preformat [/pre]
  • [quote] "Blockquote" [/quote]
ie8 fix
Click Here
ie8 fix

The best of ZDNet, delivered

ZDNet Newsletters

Get the best of ZDNet delivered straight to your inbox

Facebook Activity

White Papers, Webcasts, & Resources
ie8 fix
ie8 fix