File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -124,7 +124,17 @@ def _identify_trivial_xss(self, mutant):
124
124
# Add data for the persistent xss checking
125
125
if self ._check_persistent_xss :
126
126
self ._xss_mutants .append ((trivial_mutant , response .id ))
127
-
127
+
128
+ # This is something I've seen in as a false positive during my
129
+ # assessments and is better explained in this stackoverflow question
130
+ # https://goo.gl/BgXVJY
131
+ ct_options , _ = response .get_headers ().iget ('X-Content-Type-Options' )
132
+ content_type , _ = response .get_headers ().iget ('Content-Type' )
133
+
134
+ if content_type == 'application/json' and ct_options == 'nosniff' :
135
+ # No luck exploiting this JSON XSS
136
+ return False
137
+
128
138
if payload in response .get_body ().lower ():
129
139
self ._report_vuln (mutant , response , payload )
130
140
return True
You can’t perform that action at this time.
0 commit comments