We b & B r
- ws
e r S e c u r i t y
D a y T w
- :
A d v a n c e d X S S
A lecture by Dr.-Ing. Mario Heiderich
mario@cure53.de || mario.heiderich@rub.de
This is the day where we cover crazy stufg. Crazy.
We b & B r o ws e r S e c u r i t y D a y T - - PowerPoint PPT Presentation
We b & B r o ws e r S e c u r i t y D a y T w o : A d v a n c e d X S S This is the day where we cover A lecture by Dr.-Ing. Mario Heiderich crazy stufg. Crazy. mario@cure53.de || mario.heiderich@rub.de O
A lecture by Dr.-Ing. Mario Heiderich
mario@cure53.de || mario.heiderich@rub.de
This is the day where we cover crazy stufg. Crazy.
r .
n g n g . M a r i
e H e i d e r d e r i c h
x
e s e a r a r c h e r a n a n d n
L e c t u r e r , R u h r
n i B
h u m
h D T h e s i s a b
t C l i e n t S i d e S e c u r i t y a n d D e f e n s e
n d e r & D i r e c t
C u r e 5 3 5 3
e n t e s t
S e c u r i t y
i r m l
a t e d i n B e r l i n
e c u r i t y , C
s u l t i n g , Wo r k s h
s , T r a i n i n g s
s k f
a n i n t e r n s h i p i f t h e f
c e i s s t r
g w i t h y
u P u b l i s h e d A u t h
a n a n d S p e a k a k e r
p e c i a l i z e d
H T M L 5 , D O M a n d S V G S e c u r i t y
a v a S c r i p t , X S S a n d C l i e n t S i d e A t t a c k s
a i M a i n t a i n s D O M P u M P u r i f y f y
t
n
c h J S
l y S a n i t i z e r , a l s
c
p l e
h e r p r
e c t s
a n a n b e c
t a c a c t e d d b u t p r e f e r s n
t
e
r i
u r e 5 3 . d e
r i
h e i d e r i c h @r u b . d e
h i s a t t a c k i s b a s i c a l l y a n i g h t ma r e c
t r u e . B r
s e r s t u r n e d a g a i n s t w e b a p p s .
ma g i n e , t h e b r
s e r t u r n s h a r ml e s s H T M L i n t
d a n g e r
s a t t a c k v e c t
s .
h e s e r v e r w i l l a s s u me s a n e ma r k u p a n d n
i s k
h i s i s s u e i n d e e d e x i s t s , fj r s t r e p
t e d i n 2 6
B r
e n P r i n t
r e v i e w “ h t t p : / / i s . g d / f L V S c q
t r i n g
u t a t i
i n c e r t a i n D O M p r
e r t i e s
e s u l t : µ X S S , mX S S
“ M u t a t i
X S S ”
a c k t h e n , a fg e c t e d a p p l i c a t i
s a n d l i b r a r i e s :
+ M i l l i
l i b r a r i e s a c c
d i n g t
i t h u b
+ v e c t
c l a s s e s , a fg e c t w e b ma i l e r s , e v e r y
e w i t h a R T E
a h
M a i l , O WA , H
ma i l , S h a r e p
n t , e t c .
n d D O M P u r i f y
c
r s e , ma s s i v e l y s
e t ' t ' s h a h a v e a e a c c l
e e r e e r l
a a t t t h i t h i s !
a y s , t h a t l
s s a f e , a l l fj fj n e
e n d s i t b a c k t
r
s e r
e n d e r s i t i n i t i a l l y , a l l fj fj n e
D O M l
i c fj d d l e s w i t h i t
r
s e r r e
e n d e r s , H T M L mu t a t e s
r d
n i n t e r n a l s w i t c h i n d
u me n t t y p e s c h a n g e s t h e p a r s e r t y p e
s u d d e n c h a n g e i n d
u me n t s t r u c t u r e c h a n g e s t h e p a r s e r t y p e
This element we don’t want, let’s remove it.
And boom, we force the parser into XML-mode because SVG. Harmless becomes harmful.
c r i p t , N
mb e d a n d t h e l i k e s
r
S V G t
T M L a n d b a c k , M a t h M L
c i n g t h e a b
e u s i n g n
e r e mo v a l
n r e c e n t A n g u l a r J S v e r s i
s , w e c a n
s e r v e a n i n t e r e s t i n g mX S S c
n e r c a s e
h i s t i me i t ' s b a s e d
u n s a f e h a n d l i n g
document.createComment()
<!doctype html> <html ng-app> <head> <script src="angular.min.js"></script> </head> <body> <b class="ng-include:'somefile?- ?-- &g >& ;< t;svg vg&so sol;o ;onlo load= d=ale lert& t&lpa par;1 ;1&rp rpar; r;> gt;'">HELLO</b> <button onclick="body.innerHTML+=1">do the mXSS thing</button> </body>