NoScript InjectionChecker
NoScript InjectionChecker
XSS Filter
Giorgio Maone Ever
[email protected]
about Giorgio Maone (@ma1)
noscript.net
about NoScript
THOU SHALL
NOT REINVENT THE WHEEL
ETC. ETC.
The Injection Checker module
Imminent changes
● Hooks cross-site HTTP requests
● Checks document loads
● If triggered, transforms suspends the request
● Sanitizes the document rendering context if
needed
● Notifies user with analyze/bypass options
using a “Safe Browsing-like” page
Origins
Whitelist + XSS =
No NoScript
!!!
Origins
Origins
7 years later...
Legacy
Yeah, right.
Legacy
Object.keys(
document.querySelector("#changelog")
.textContent.match(/\n(?:[x+]) .*(\n {2}.*)*/g)
.map(s => let (m = s.match(
/(?:XSS|Inj)[\s\S]*\bthanks\s+(?:to\s+)?\s*([\s\S]+)?\b(?:(?:,\s*)see|for|\))/
)) m && m[1].replace(/\s+/g, ' ').replace(/\s*(?:\bfor\b|\))[\s\S]*|\s+$/g, ''))
.filter(s => !!s)
.reduce((o, s) => s.split(/\s*(?:\band|&|,)\s+/).reduce((o, s) => o[s] = o, o), {})
).sort((a,b) => a.localeCompare(b)).join(", ")
Credits
$ unzip noscript-2.6.9.6rc3.xpi
$ unzip chrome/noscript.jar
$ vi content/noscript/RequestWatchdog.js
$ find ./ -name "*.js" | xargs cat \
| sed '/^\s*$/d' | wc -l
22300
$ cat content/noscript/RequestWatchdog.js \
| sed '/^\s*$/d' | wc -l
2437
back to the origins
Origins
● (un)escape VS (d)encodeURI(component) VS
form encoding
● Base64
● XML and HTML entities
● CSS escapes
● ASCII & Unicode escapes in string literals
● Unicode escapes in JavaScript source
↖ ADDITIVE OMG!!! ↗
Escaping escapings
● HTML injections
● Attribute breaking/insertion
● CSS injections
● JavaScript injections
Looking for injections
maybeJS()
Looking for injections
Regular expressions +
DOM Parser +
JavaScript interpreter =
WIN!
Sanitizer
● [email protected]
● hackademix.net
● @ma1
● noscript.net