Injecting the script tag into XML

Firefox is now the browser I like hacking, there’s just so much stuff it can do. I simply don’t have enough time to explore everything, but what I have found was some very interesting XML behavior. I was helping Ronald a while back with a Firefox chrome security flaw and we discussed on slackers that some XML entities in Firefox contain sensitive information which it is possible to read using XHR.

I thought of what other interesting things I could do with XML entities and I found a way of injecting script tags using them. This could have implications if you offer a HTML upload service but you filter out dangerous tags for example. The proof of concept is very basic but displays the method clearly.

XML injection

Comments 8

  1. buherator wrote:

    It works on Opera 9.23 Linux too ;)

    Posted 09 Oct 2007 at 3:17 pm
  2. Gareth Heyes wrote:

    Hehe cool, I’ve not tried it in other browsers

    Posted 09 Oct 2007 at 3:36 pm
  3. thornmaker wrote:

    /me likes it. very clever

    Posted 09 Oct 2007 at 7:22 pm
  4. Jordan wrote:

    In case you’re curious, Safari 2.0.4 doesn’t like the inject entity:

    This page contains the following errors:

    error on line 11 at column 46: Entity ‘inject’ not defined

    iPhone version shows the alert(1) text itself, but not in a script element.

    Posted 09 Oct 2007 at 8:02 pm
  5. Gareth Heyes wrote:

    @Jordan

    Thanks for the info useful :)

    @thornmaker

    Cheers :)

    Posted 09 Oct 2007 at 8:42 pm
  6. kourge wrote:

    This works with WebKit 25438.

    Posted 10 Oct 2007 at 4:36 am
  7. Oniric wrote:

    Sweeeeet!

    Posted 10 Oct 2007 at 9:18 am
  8. raaka! wrote:

    Gareth Heyes

    Honestly

    i developed months ago,exploited google toolbar using this technique. i deserve some credit :D

    if you are intrested about POC. let me know

    Posted 14 Oct 2007 at 3:55 am

Post a Comment

Your email is never published nor shared. Required fields are marked *

Comment spam protected by SpamBam