







Posted by Jad S. Boutros, Security Team Building on our earlier posts on defenses against web application flaws [ "Automating Web Applicatio...
XSS Rays - The Spanner
I've developed a new XSS scanner tool that's written in Javascript called XSS Rays for Microsoft. They have given me permission to release the tool as open source which is awesome because it can be used for other open source applications. I recommend you use it as part of the web development process to make sure you've filtered XSS correctly on your application. It works as a bookmarklet and scans any links, paths or forms on the target scanning page (even cross domain). You can add vectors to it quite easily and it includes some of the most common injections I've found on sites over the years. I've tested it on IE7/IE8 and Firefox but it could work in other browsers. The advantage of the bookmarklet is that vectors can be customised for each browser and they are executed in the context of the browser, in IE8 standards mode were css expressions are disabled in IE8 the vector won't be executed for example. Hopefully there should be no false positives either because each vector is actually executed and it reported back as successful, in fact if there is a false positive it will be a bug in my code (lets hope not). Technical details The code works by creating connections to the target links/paths using iframes, each iframe is assign a name which is the url to return to on successful execution (the originating url). This allows cross domain links to be checked. The vectors are stored in a simple object, each vector has the following properties:- input, name, browser, form, url, path (there's a optional second input). Input is the XSS vector, the string "XSS" is used to replace with a logger or a poc url and is required by all vectors. Name is just a meaningful name applied to the vector, browser supports ALL|FF|IE and helps to save time when testing specific browser vectors as XSS Rays will only target those versions for the vector. Form, url, path allows you to disable the vector for scanning forms etc, supports TRUE|FALSE. There are a few configuration properties supported:- 1. externalLog - Sends all executions to a external logger by default "http://127.0.0.1/XSSRays/logging/xsslogger.php", the vector is encoded and sent to a get variable xss and can be easily customised to log in another language, each field is sent tab separated. 2. excludeURLS - allows you to exclude certain urls from the scan, the variable is a regular expression so remember to double escape special characters. 3. sameorigin - When enabled it should stay to the same site and not scan external links, this has not be tested fully yet. There's a interesting little hack for IE to enable the onload event of a dynamic iframe, I use the following code to create a specific IE loader:- <pre lang="javascript"> var ieLoader = "document.getElementById('"+'ray'+self.uniqueID+"').ieonload()"; if(self.isIE()) { try { var iframe = document.createElement('<iframe name="'+location + '#xss'+'" onload="'+ieLoader+'">'); } catch (e) { var iframe = document.createElement('iframe'); } } else { var iframe = document.createElement('iframe'); } </pre> Download & Instructions Download here 1. You need to install a local web server like xampp:- http://www.apachefriends.org/en/xampp.html 2. Once installed copy the XSSRays directory to your web server root xampp root is :- C:\xampp\htdocs\ 3. Open the bookmarklet.html file in the helpers directory of XSSRays. Drag to your bookmarks toolbar on Firefox or on IE right click the link and click add to favorites (You might get a security warning in IE). 4. Find your web site that you wish to scan, click your bookmarklet. Then press CTRL+SHIFT+X which will now run XSS Rays on the target site. Thanks Big thanks to David Ross, Manuel Caballero and you (you know who you are) for testing and feedback. Thanks to Microsoft for supporting the development of XSS Rays. Updates.... The latest version of XSS Rays is now online (0.5.0), it contains some speed improvements and bug fixes. 1. Fixed conflicts with form elements with the name action or submit was causing form posts not to be submitted. Thanks Mike W 2. Removed unneeded cleanup code now the IE onload works. 3. Added the ability to exclude certain field types and names from being XSS'd. 4. Fixed name vector to specify window.name which was causing conflicts with image elements. 5. Fixed and checked same origin code. Thanks to Arshan who gave me a kick up the backside :) 6. Removed keyboard shortcut and added a button instead. New update 0.5.5 1. Fixed Firefox bug with same origin 2. Fixed form Post to allow field names with submit. Thanks Kuza55 for the awesome form post hack :)

w3c/trusted-types
A browser API to prevent DOM-Based Cross Site Scripting in modern web applications.
WebAppSec/Secure Coding Guidelines - MozillaWiki
The purpose of this page is to establish a concise and consistent approach to secure application development of Mozilla web applications and web services. The information provided here will be focused towards web based applications; however, the concepts can be universally applied to applications to implement sound security controls and design.
Sanitize: A whitelist-based Ruby HTML sanitizer - wonko.com
Supporting Embedded Content | Web Browser Engineering
While our browser can render complex styles, visual effects, and animations, all of those apply basically just to text. Yet web pages contain a variety of non-text embedded content, from images to other web pages. Support for embedded content has powerful implications for browser architecture, performance, security, and open information access, and has played a key role throughout the web’s history.
Universal XSS from website-driven element picker
### Summary As reported: > For the Firefox MV2 extension, it’s possible for a webpage to iframe the element picker and control it to add arbitrary trusted filters when a user clicks on the...
A few HTML tips – Mozilla Hacks - the Web developer blog
A while ago I wrote an article with some CSS tips, now it’s time to give some polish to our HTML! In this article I’ll share some tips and advice ...

Progress report on cross-platform Open Web Apps – Mozilla Hacks - the Web developer blog
Here in the Hacks blog we've written a lot about building apps for Firefox OS using HTML, JS, and CSS. We're working to ensure that those same apps can also ...

Advanced web security topics
(Updated 22 May 2020) This post discusses web security issues that I come across – so far thankfully mostly by reading about them. It is a work in progress which I’ll keep updating. The…

chardetng: A More Compact Character Encoding Detector for the Legacy Web
chardetng is a new small-binary-footprint character encoding detector for Firefox written in Rust. Its purpose is user retention by addressing an ancient—and for non-Latin scripts page-destroying—Web compat problem that Chrome already addressed. It puts an end to the situation that some pages showed up as unreadable garbage in Firefox but opening the page in Chrome remedied the situation more easily than fiddling with Firefox menus. The deployment of chardetng in Firefox 73 marks the first time in the history of Firefox (and in the entire Netscape lineage of browsers since the time support for non-ISO-8859-1 text was introduced) that the mapping of HTML bytes to the DOM is not a function of the browser user interface language. This is accomplished at a notably lower binary size increase than what would have resulted from adopting Chrome’s detector. Also, the result is more explainable and modifiable as well as more suitable for standardization, should there be interest, than Chrome’s detector
Adult sites are stashing exploit code inside racy .svg files
Running JavaScript from inside an image? What could possibly go wrong?

Progressive Web Apps: Escaping Tabs Without Losing Our Soul - Infrequently Noted
Progressive Web Apps are aren't packaged and deployed through stores, they're just websites that took all the right vitamins.
Using Claude Code: The Unreasonable Effectiveness of HTML
Thought-provoking piece by Thariq Shihipar (on the Claude Code team at Anthropic) advocating for HTML over Markdown as an output format to request from Claude. The article is crammed with …

Using Claude Code: The Unreasonable Effectiveness of HTML
Thought-provoking piece by Thariq Shihipar (on the Claude Code team at Anthropic) advocating for HTML over Markdown as an output format to request from Claude. The article is crammed with …

shikoshib/winerr
A fast and accurate Windows fake error messages generator made with HTML5 Canvas
Angelina Fabbro | Return of Inspector Web: Web Components a Year Later | Fronteers 2013
A little over a year ago at JSConf EU, Angelina tried to inspire developers to take an interest in Web Components, which includes Shadow Dom, HTML Templates, HTML Imports, and Custom Elements. In this talk we'll take a look at how far we've come in a year: what has been implemented, what hasn't, the current state of the relevant specifications, and discuss various frameworks and libraries that have emerged either with patterns similar to web components or embracing the technology completely. We will take a look at these changes, and also dive into some code for a comprehensive overview of 'the state of things' - spoiler: it's still always changing.