Persistent XSS using DAST Security Tab
HackerOne report #418757 by ngalog on 2018-10-04:
PoC: Private project: https://gitlab.com/golduserngalog/awesomesecurityproject/pipelines/31950734 Click Security Tab Click : Web Browser XSS Protection Not Enabled Click first link next to GET Popup
Steps to reproduce:
Create a new project
Create following files, .gitlab-ci.yml
and gl-dast-report.json
gl-dast-report.json
dast:
script:
- echo hi
artifacts:
paths: [gl-dast-report.json]
.gitlab-ci.yml
{"@version":"2.7.0","@generated":"Wed, 3 Oct 2018 22:21:29","site":{"@name":"http://165.227.53.194","@host":"165.227.53.194","@port":"80","@ssl":"false","alerts":[{"pluginid":"10016","alert":"Web Browser XSS Protection Not Enabled","name":"Web Browser XSS Protection Not Enabled","riskcode":"1","confidence":"2","riskdesc":"Low (Medium)","desc":"<p>Web Browser XSS Protection is not enabled, or is disabled by the configuration of the 'X-XSS-Protection' HTTP response header on the web server<\/p>","instances":[{"uri":"javascript:alert('RonChan')//http://165.227.53.194/phpinfo.php","method":"GET","param":"X-XSS-Protection"},{"uri":"http://165.227.53.194/manual","method":"GET","param":"X-XSS-Protection"},{"uri":"http://165.227.53.194","method":"GET","param":"X-XSS-Protection"},{"uri":"http://165.227.53.194/sitemap.xml","method":"GET","param":"X-XSS-Protection"},{"uri":"http://165.227.53.194/","method":"GET","param":"X-XSS-Protection"},{"uri":"http://165.227.53.194/robots.txt","method":"GET","param":"X-XSS-Protection"}],"count":"6","solution":"<p>Ensure that the web browser's XSS filter is enabled, by setting the X-XSS-Protection HTTP response header to '1'.<\/p>","otherinfo":"<p>The X-XSS-Protection HTTP response header allows the web server to enable or disable the web browser's XSS protection mechanism. The following values would attempt to enable it: <\/p><p>X-XSS-Protection: 1; mode=block<\/p><p>X-XSS-Protection: 1; report=http://www.example.com/xss<\/p><p>The following values would disable it:<\/p><p>X-XSS-Protection: 0<\/p><p>The X-XSS-Protection HTTP response header is currently supported on Internet Explorer, Chrome and Safari (WebKit).<\/p><p>Note that this alert is only raised if the response body could potentially contain an XSS payload (with a text-based content type, with a non-zero length).<\/p>","reference":"<p>https://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet<\/p><p>https://blog.veracode.com/2014/03/guidelines-for-setting-security-headers/<\/p>","cweid":"933","wascid":"14","sourceid":"3"},{"pluginid":"10027","alert":"Information Disclosure - Suspicious Comments","name":"Information Disclosure - Suspicious Comments","riskcode":"0","confidence":"2","riskdesc":"Informational (Medium)","desc":"<p>The response appears to contain suspicious comments which may help an attacker.<\/p>","instances":[{"uri":"http://165.227.53.194/","method":"GET"},{"uri":"http://165.227.53.194","method":"GET"}],"count":"2","solution":"<p>Remove all comments that return information that may help an attacker and fix any underlying problems they refer to.<\/p>","otherinfo":"<p><!--<\/p><p> Modified from the Debian original for Ubuntu<\/p><p> Last updated: 2016-11-16<\/p><p> See: https://launchpad.net/bugs/1288690<\/p><p> --><\/p><p><\/p>","reference":"<p><\/p>","cweid":"200","wascid":"13","sourceid":"3"},{"pluginid":"10021","alert":"X-Content-Type-Options Header Missing","name":"X-Content-Type-Options Header Missing","riskcode":"1","confidence":"2","riskdesc":"Low (Medium)","desc":"<p>The Anti-MIME-Sniffing header X-Content-Type-Options was not set to 'nosniff'. This allows older versions of Internet Explorer and Chrome to perform MIME-sniffing on the response body, potentially causing the response body to be interpreted and displayed as a content type other than the declared content type. Current (early 2014) and legacy versions of Firefox will use the declared content type (if one is set), rather than performing MIME-sniffing.<\/p>","instances":[{"uri":"http://165.227.53.194/phpinfo.php","method":"GET","param":"X-Content-Type-Options"},{"uri":"http://165.227.53.194","method":"GET","param":"X-Content-Type-Options"},{"uri":"http://165.227.53.194/icons/ubuntu-logo.png","method":"GET","param":"X-Content-Type-Options"},{"uri":"http://165.227.53.194/","method":"GET","param":"X-Content-Type-Options"}],"count":"4","solution":"<p>Ensure that the application/web server sets the Content-Type header appropriately, and that it sets the X-Content-Type-Options header to 'nosniff' for all web pages.<\/p><p>If possible, ensure that the end user uses a standards-compliant and modern web browser that does not perform MIME-sniffing at all, or that can be directed by the web application/web server to not perform MIME-sniffing.<\/p>","otherinfo":"<p>This issue still applies to error type pages (401, 403, 500, etc) as those pages are often still affected by injection issues, in which case there is still concern for browsers sniffing pages away from their actual content type.<\/p><p>At \"High\" threshold this scanner will not alert on client or server error responses.<\/p>","reference":"<p>http://msdn.microsoft.com/en-us/library/ie/gg622941%28v=vs.85%29.aspx<\/p><p>https://www.owasp.org/index.php/List_of_useful_HTTP_headers<\/p>","cweid":"16","wascid":"15","sourceid":"3"},{"pluginid":"10020","alert":"X-Frame-Options Header Not Set","name":"X-Frame-Options Header Not Set","riskcode":"2","confidence":"2","riskdesc":"Medium (Medium)","desc":"<p>X-Frame-Options header is not included in the HTTP response to protect against 'ClickJacking' attacks.<\/p>","instances":[{"uri":"http://165.227.53.194/","method":"GET","param":"X-Frame-Options"},{"uri":"http://165.227.53.194","method":"GET","param":"X-Frame-Options"},{"uri":"http://165.227.53.194/phpinfo.php","method":"GET","param":"X-Frame-Options"}],"count":"3","solution":"<p>Most modern Web browsers support the X-Frame-Options HTTP header. Ensure it's set on all web pages returned by your site (if you expect the page to be framed only by pages on your server (e.g. it's part of a FRAMESET) then you'll want to use SAMEORIGIN, otherwise if you never expect the page to be framed, you should use DENY. ALLOW-FROM allows specific websites to frame the web page in supported web browsers).<\/p>","reference":"<p>http://blogs.msdn.com/b/ieinternals/archive/2010/03/30/combating-clickjacking-with-x-frame-options.aspx<\/p>","cweid":"16","wascid":"15","sourceid":"3"}]}}
Impact
Persistent XSS
Attachments
Warning: Attachments received through HackerOne, please exercise caution!
Edited by Alexander Dietrich