Reflected cross-site scripting vulnerabilities arise when data is copied from a request and echoed into the application's immediate response in an unsafe way. An attacker can use the vulnerability to construct a request which, if issued by another application user, will cause JavaScript code supplied by the attacker to execute within the user's browser in the context of that user's session with the application.
The attacker-supplied code can perform a wide variety of actions, such as stealing the victim's session token or login credentials, performing arbitrary actions on the victim's behalf, and logging their keystrokes.
Users can be induced to issue the attacker's crafted request in various ways. For example, the attacker can send a victim a link containing a malicious URL in an email or instant message. They can submit the link to popular web sites that allow content authoring, for example in blog comments. And they can create an innocuous looking web site which causes anyone viewing it to make arbitrary cross-domain requests to the vulnerable application (using either the GET or the POST method).
The security impact of cross-site scripting vulnerabilities is dependent upon the nature of the vulnerable application, the kinds of data and functionality which it contains, and the other applications which belong to the same domain and organisation. If the application is used only to display non-sensitive public content, with no authentication or access control functionality, then a cross-site scripting flaw may be considered low risk. However, if the same application resides on a domain which can access cookies for other more security-critical applications, then the vulnerability could be used to attack those other applications, and so may be considered high risk. Similarly, if the organisation which owns the application is a likely target for phishing attacks, then the vulnerability could be leveraged to lend credibility to such attacks, by injecting Trojan functionality into the vulnerable application, and exploiting users' trust in the organisation in order to capture credentials for other applications which it owns. In many kinds of application, such as those providing online banking functionality, cross-site scripting should always be considered high risk.
Issue remediation
In most situations where user-controllable data is copied into application responses, cross-site scripting attacks can be prevented using two layers of defences:
Input should be validated as strictly as possible on arrival, given the kind of content which it is expected to contain. For example, personal names should consist of alphabetical and a small range of typographical characters, and be relatively short; a year of birth should consist of exactly four numerals; email addresses should match a well-defined regular expression. Input which fails the validation should be rejected, not sanitised.
User input should be HTML-encoded at any point where it is copied into application responses. All HTML metacharacters, including < > " ' and =, should be replaced with the corresponding HTML entities (< > etc).
In cases where the application's functionality allows users to author content using a restricted subset of HTML tags and attributes (for example, blog comments which allow limited formatting and linking), it is necessary to parse the supplied HTML to validate that it does not use any dangerous syntax; this is a non-trivial task.
The value of the lang request parameter is copied into the value of an HTML tag attribute which is encapsulated in single quotation marks. The payload 11fb3'><script>alert(1)</script>afcb75d21ba was submitted in the lang parameter. This input was echoed as 11fb3\'><script>alert(1)</script>afcb75d21ba in the application's response.
This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response.
Request
GET /integrationwizard/ecpaypal/cart.php?lang=aspeead5%3Cscript%3Ealert(document.location)%3C/script%3E82c0e9918a371876c11fb3'><script>alert(1)</script>afcb75d21ba&txtReturnURL=http%3A%2F%2Fxss.cx%2F&txtCancelURL=http%3A%2F%2Fxss.cx%2F&payment_type=Sale¤cy=USD HTTP/1.1 Host: www.paypal-labs.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20110504 Namoroka/3.6.13 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 115 Connection: keep-alive Referer: http://burp/show/10
The value of the lang request parameter is copied into the HTML document as plain text between tags. The payload eead5<script>alert(1)</script>82c0e9918a371876c was submitted in the lang parameter. This input was echoed unmodified in the application's response.
This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response.
The original request used the POST method, however it was possible to convert the request to use the GET method, to enable easier demonstration and delivery of the attack.
The value of the lang request parameter is copied into the value of an HTML tag attribute which is encapsulated in single quotation marks. The payload dfc7b'><script>alert(1)</script>d4cb26743aac871d3 was submitted in the lang parameter. This input was echoed as dfc7b\'><script>alert(1)</script>d4cb26743aac871d3 in the application's response.
This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response.
The original request used the POST method, however it was possible to convert the request to use the GET method, to enable easier demonstration and delivery of the attack.
The value of the lang request parameter is copied into the HTML document as plain text between tags. The payload 8b595<script>alert(1)</script>0c4ff89473d was submitted in the lang parameter. This input was echoed unmodified in the application's response.
This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response.
Request
GET /integrationwizard/ecpaypal/cart.php?lang=aspeead5%3Cscript%3Ealert(document.location)%3C/script%3E82c0e9918a371876c8b595<script>alert(1)</script>0c4ff89473d&txtReturnURL=http%3A%2F%2Fxss.cx%2F&txtCancelURL=http%3A%2F%2Fxss.cx%2F&payment_type=Sale¤cy=USD HTTP/1.1 Host: www.paypal-labs.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20110504 Namoroka/3.6.13 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 115 Connection: keep-alive Referer: http://burp/show/10
The cookie appears to contain a session token, which may increase the risk associated with this issue. You should review the contents of the cookie to determine its function.
Issue background
If the secure flag is set on a cookie, then browsers will not submit the cookie in any requests that use an unencrypted HTTP connection, thereby preventing the cookie from being trivially intercepted by an attacker monitoring network traffic. If the secure flag is not set, then the cookie will be transmitted in clear-text if the user visits any HTTP URLs within the cookie's scope. An attacker may be able to induce this event by feeding a user suitable links, either directly or via another web site. Even if the domain which issued the cookie does not host any content that is accessed over HTTP, an attacker may be able to use links of the form http://example.com:443/ to perform the same attack.
Issue remediation
The secure flag should be set on all cookies that are used for transmitting sensitive data when accessing content over HTTPS. If cookies are used to transmit session tokens, then areas of the application that are accessed over HTTPS should employ their own session handling mechanism, and the session tokens used should never be transmitted over unencrypted communications.
Request
GET /integrationwizard/index.php HTTP/1.1 Accept: text/html, application/xhtml+xml, */* Accept-Language: en-US User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0) Accept-Encoding: gzip, deflate Host: www.paypal-labs.com Connection: Keep-Alive
Response
HTTP/1.1 200 OK Date: Fri, 12 Aug 2011 02:00:36 GMT Server: Apache Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Set-Cookie: PHPSESSID=deleted; expires=Thu, 12-Aug-2010 02:00:35 GMT; path=/ Content-Length: 4161 Connection: close Content-Type: text/html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title ...[SNIP]...
The cookie appears to contain a session token, which may increase the risk associated with this issue. You should review the contents of the cookie to determine its function.
Issue background
If the HttpOnly attribute is set on a cookie, then the cookie's value cannot be read or set by client-side JavaScript. This measure can prevent certain client-side attacks, such as cross-site scripting, from trivially capturing the cookie's value via an injected script.
Issue remediation
There is usually no good reason not to set the HttpOnly flag on all cookies. Unless you specifically require legitimate client-side scripts within your application to read or set a cookie's value, you should set the HttpOnly flag by including this attribute within the relevant Set-cookie directive.
You should be aware that the restrictions imposed by the HttpOnly flag can potentially be circumvented in some circumstances, and that numerous other serious attacks can be delivered by client-side script injection, aside from simple cookie stealing.
Request
GET /integrationwizard/index.php HTTP/1.1 Accept: text/html, application/xhtml+xml, */* Accept-Language: en-US User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0) Accept-Encoding: gzip, deflate Host: www.paypal-labs.com Connection: Keep-Alive
Response
HTTP/1.1 200 OK Date: Fri, 12 Aug 2011 02:00:36 GMT Server: Apache Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Set-Cookie: PHPSESSID=deleted; expires=Thu, 12-Aug-2010 02:00:35 GMT; path=/ Content-Length: 4161 Connection: close Content-Type: text/html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title ...[SNIP]...
The application appears to disclose some server-side source code written in ASP.
Issue background
Server-side source code may contain sensitive information which can help an attacker formulate attacks against the application.
Issue remediation
Server-side source code is normally disclosed to clients as a result of typographical errors in scripts or because of misconfiguration, such as failing to grant executable permissions to a script or directory. You should review the cause of the code disclosure and prevent it from happening.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <ti ...[SNIP]... <!-- #include file ="paypalfunctions.asp" --> <% if PaymentOption = "PayPal" then
' ================================== ' PayPal Express Checkout Module ' ================================== On Error Resume Next
'------------------------------------ ' The currencyCodeType and paymentType ' are set to the selections made on the Integration Assistant '------------------------------------ currencyCodeType = "USD" paymentType = "Sale"
'------------------------------------ ' The returnURL is the location where buyers return to when a ' payment has been succesfully authorized. ' ' This is set to the value entered on the Integration Assistant '------------------------------------ returnURL = "http://xss.cx/"
'------------------------------------ ' The cancelURL is the location buyers are sent to when they click the ' return to XXXX site where XXX is the merhcant store name ' during payment review on PayPal ' ' This is set to the value entered on the Integration Assistant '------------------------------------ cancelURL = "http://xss.cx/"
'------------------------------------ ' The paymentAmount is the total value of ' the shopping cart, that was set ' earlier in a session variable ' by the shopping cart page '------------------------------------ paymentAmount = Session("Payment_Amount")
'------------------------------------ ' When you integrate this code ' set the variables below with ' shipping address details ' entered by the user on the ' Shipping page. '------------------------------------ shipToName = "<<ShiptoName>>" shipToStreet = "<<ShipToStreet>>" shipToStreet2 = "<<ShipToStreet2>>" 'Leave it blank if there is no value shipToCity = "<<ShipToCity>>" shipToState = "<<ShipToState>>" shipToCountryCode = "<<ShipToCountryCode>>" ' Please refer to the PayPal country codes in the API documentation shipToZip = "<<ShipToZip>>" phoneNum = "<<PhoneNumber>>"
'------------------------------------ ' Calls the SetExpressCheckout API call ' ' The CallMarkExpressCheckout function is defined in PayPalFunctions.asp ' included at the top of this file. '------------------------------------------------- Set resArray = CallMarkExpressCheckout (paymentAmount, currencyCodeType, paymentType, returnURL, cancelURL, shipToName, shipToStreet, shipToCity, shipToState, shipToCountryCode, shipToZip, shipToStreet2, phoneNum )
ack = UCase(resArray("ACK"))
If ack="SUCCESS" Then ' Redirect to paypal.com SESSION("token") = resArray("TOKEN") ReDirectURL( resArray("TOKEN") ) Else 'Display a user friendly Error on the page using any of the following error information returned by PayPal ErrorCode = URLDecode( resArray("L_ERRORCODE0")) ErrorShortMsg = URLDecode( resArray("L_SHORTMESSAGE0")) ErrorLongMsg = URLDecode( resArray("L_LONGMESSAGE0")) ErrorSeverityCode = URLDecode( resArray("L_SEVERITYCODE0")) End If
Else If (((PaymentOption = "Visa") Or (PaymentOption = "MasterCard") Or (PaymentOption = "Amex") or (PaymentOption = "Discover")) and ( PaymentProcessorSelected = "PayPal Direct Payment"))
'------------------------------------ ' The paymentAmount is the total value of ' the shopping cart, that was set ' earlier in a session variable ' by the shopping cart page '------------------------------------ paymentAmount = Session("Payment_Amount")
'------------------------------------ ' The paymentType that was selected earlier '------------------------------------ paymentType = "Sale"
' Set these values based on what was selected by the user on the Billing page Html form
creditCardType = "<<Visa/MasterCard/Amex/Discover>>" ' Set this to one of the acceptable values (Visa/MasterCard/Amex/Discover) match it to what was selected on your Billing page creditCardNumber = "<<CC number>>" ' Set this to the string entered as the credit card number on the Billing page expDate = "<<Expiry Date>>" ' Set this to the credit card expiry date entered on the Billing page cvv2 = "<<cvv2>>" ' Set this to the CVV2 string entered on the Billing page firstName = "<<firstName>>" ' Set this to the customer's first name that was entered on the Billing page lastName = "<<lastName>>" ' Set this to the customer's last name that was entered on the Billing page street = "<<street>>" ' Set this to the customer's street address that was entered on the Billing page city = "<<city>>" ' Set this to the customer's city that was entered on the Billing page state = "<<state>>" ' Set this to the customer's state that was entered on the Billing page zip = "<<zip>>" ' Set this to the zip code of the customer's address that was entered on the Billing page countryCode = "<<PayPal Country Code>>" ' Set this to the PayPal code for the Country of the customer's address that was entered on the Billing page currencyCode = "<<PayPal Currency Code>>" ' Set this to the PayPal code for the Currency used by the customer
'------------------------------------------------ ' Calls the DoDirectPayment API call ' ' The DirectPayment function is defined in PayPalFunctions.asp included at the top of this file. '------------------------------------------------- Set resArray = DirectPayment (paymentType, paymentAmount, creditCardType, creditCardNumber, expDate, cvv2, firstName, lastName, street, city, state, zip, countryCode, currencyCode )
ack = UCase(resArray("ACK"))
If ack <> "SUCCESS" Then 'Display a user friendly Error on the page using any of the following error information returned by PayPal ErrorCode = URLDecode( resArray("L_ERRORCODE0")) ErrorShortMsg = URLDecode( resArray("L_SHORTMESSAGE0")) ErrorLongMsg = URLDecode( resArray("L_LONGMESSAGE0")) ErrorSeverityCode = URLDecode( resArray("L_SEVERITYCODE0"))
' DirectPayment related error information ErrorAVSCode = URLDecode( resArray("AVSCODE")) ErrorCVV2Match = URLDecode( resArray("CVV2MATCH")) ErrorTransactionId = URLDecode( resArray("TRANSACTIONID"))
When a web browser makes a request for a resource, it typically adds an HTTP header, called the "Referer" header, indicating the URL of the resource from which the request originated. This occurs in numerous situations, for example when a web page loads an image or script, or when a user clicks on a link or submits a form.
If the resource being requested resides on a different domain, then the Referer header is still generally included in the cross-domain request. If the originating URL contains any sensitive information within its query string, such as a session token, then this information will be transmitted to the other domain. If the other domain is not fully trusted by the application, then this may lead to a security compromise.
You should review the contents of the information being transmitted to other domains, and also determine whether those domains are fully trusted by the originating application.
Today's browsers may withhold the Referer header in some situations (for example, when loading a non-HTTPS resource from a page that was loaded over HTTPS, or when a Refresh directive is issued), but this behaviour should not be relied upon to protect the originating URL from disclosure.
Note also that if users can author content within the application then an attacker may be able to inject links referring to a domain they control in order to capture data from URLs used within the application.
Issue remediation
The application should never transmit any sensitive information within the URL query string. In addition to being leaked in the Referer header, such information may be logged in various locations and may be visible on-screen to untrusted parties.
Request
GET /integrationwizard/ecpaypal/cart.php?lang=aspeead5%3Cscript%3Ealert(document.location)%3C/script%3E82c0e9918a371876c&txtReturnURL=http%3A%2F%2Fxss.cx%2F&txtCancelURL=http%3A%2F%2Fxss.cx%2F&payment_type=Sale¤cy=USD HTTP/1.1 Host: www.paypal-labs.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20110504 Namoroka/3.6.13 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 115 Connection: keep-alive Referer: http://burp/show/10
When an application includes a script from an external domain, this script is executed by the browser within the security context of the invoking application. The script can therefore do anything that the application's own scripts can do, such as accessing application data and performing actions within the context of the current user.
If you include a script from an external domain, then you are trusting that domain with the data and functionality of your application, and you are trusting the domain's own security to prevent an attacker from modifying the script to perform malicious actions within your application.
Issue remediation
Scripts should not be included from untrusted domains. If you have a requirement which a third-party script appears to fulfil, then you should ideally copy the contents of that script onto your own domain and include it from there. If that is not possible (e.g. for licensing reasons) then you should consider reimplementing the script's functionality within your own code.
The response dynamically includes the following script from another domain:
https://www.google-analytics.com/urchin.js
Request
GET /integrationwizard/ecpaypal/legaldisclaimer.php HTTP/1.1 Host: www.paypal-labs.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close
Response
HTTP/1.1 200 OK Date: Fri, 12 Aug 2011 13:46:45 GMT Server: Apache Content-Length: 4785 Connection: close Content-Type: text/html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <titl ...[SNIP]... </script> <script src="https://www.google-analytics.com/urchin.js" type="text/javascript"> </script> ...[SNIP]...
The following email address was disclosed in the response:
lherczeg@paypal.com
Issue background
The presence of email addresses within application responses does not necessarily constitute a security vulnerability. Email addresses may appear intentionally within contact information, and many applications (such as web mail) include arbitrary third-party email addresses within their core content.
However, email addresses of developers and other individuals (whether appearing on-screen or hidden within page source) may disclose information that is useful to an attacker; for example, they may represent usernames that can be used at the application's login, and they may be used in social engineering attacks against the organisation's personnel. Unnecessary or excessive disclosure of email addresses may also lead to an increase in the volume of spam email received.
Issue remediation
You should review the email addresses being disclosed by the application, and consider removing any that are unnecessary, or replacing personal addresses with anonymous mailbox addresses (such as helpdesk@example.com).
Request
GET /integrationwizard/ecpaypal/expresscheckout.asp HTTP/1.1 Host: www.paypal-labs.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close
Response
HTTP/1.1 404 Not Found Date: Fri, 12 Aug 2011 13:46:47 GMT Server: Apache Vary: accept-language,accept-charset Accept-Ranges: bytes Connection: close Content-Type: text/html; charset=iso-8859-1 Content-Language: en Content-Length: 1018
<?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" l ...[SNIP]... <link rev="made" href="mailto:lherczeg@paypal.com" /> ...[SNIP]... <a href="mailto:lherczeg@paypal.com"> ...[SNIP]...
The following RFC 1918 IP address was disclosed in the response:
10.191.193.20
Issue background
RFC 1918 specifies ranges of IP addresses that are reserved for use in private networks and cannot be routed on the public Internet. Although various methods exist by which an attacker can determine the public IP addresses in use by an organisation, the private addresses used internally cannot usually be determined in the same ways.
Discovering the private addresses used within an organisation can help an attacker in carrying out network-layer attacks aiming to penetrate the organisation's internal infrastructure.
Issue remediation
There is not usually any good reason to disclose the internal IP addresses used within an organisation's infrastructure. If these are being returned in service banners or debug messages, then the relevant services should be configured to mask the private addresses. If they are being used to track back-end servers for load balancing purposes, then the addresses should be rewritten with innocuous identifiers from which an attacker cannot infer any useful information about the infrastructure.
Unless directed otherwise, browsers may store a local cached copy of content received from web servers. Some browsers, including Internet Explorer, cache content accessed via HTTPS. If sensitive information in application responses is stored in the local cache, then this may be retrieved by other users who have access to the same computer at a future time.
Issue remediation
The application should return caching directives instructing browsers not to store local copies of any sensitive data. Often, this can be achieved by configuring the web server to prevent caching for relevant paths within the web root. Alternatively, most web development platforms allow you to control the server's caching directives from within individual scripts. Ideally, the web server should return the following HTTP headers in all responses containing sensitive content:
GET / HTTP/1.1 Host: www.paypal-labs.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close
Response
HTTP/1.1 200 OK Date: Fri, 12 Aug 2011 13:46:44 GMT Server: Apache Last-Modified: Thu, 11 Nov 2010 20:56:21 GMT ETag: "10eea-f8-34bf4740" Accept-Ranges: bytes Content-Length: 248 Connection: close Content-Type: text/html
GET /integrationwizard/ecpaypal/download.php HTTP/1.1 Host: www.paypal-labs.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close
Response
HTTP/1.1 200 OK Date: Fri, 12 Aug 2011 13:46:47 GMT Server: Apache Content-Length: 64 Connection: close Content-Type: text/html
Attempt to download file without the appropriate input parameter
GET /integrationwizard/ecpaypal/legaldisclaimer.php HTTP/1.1 Host: www.paypal-labs.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close
Response
HTTP/1.1 200 OK Date: Fri, 12 Aug 2011 13:46:45 GMT Server: Apache Content-Length: 4785 Connection: close Content-Type: text/html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <titl ...[SNIP]...
GET /integrationwizard/processHandler.php HTTP/1.1 Host: www.paypal-labs.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close
Response
HTTP/1.1 200 OK Date: Fri, 12 Aug 2011 13:46:45 GMT Server: Apache Content-Length: 0 Connection: close Content-Type: text/html
If a web response states that it contains HTML content but does not specify a character set, then the browser may analyse the HTML and attempt to determine which character set it appears to be using. Even if the majority of the HTML actually employs a standard character set such as UTF-8, the presence of non-standard characters anywhere in the response may cause the browser to interpret the content using a different character set. This can have unexpected results, and can lead to cross-site scripting vulnerabilities in which non-standard encodings like UTF-7 can be used to bypass the application's defensive filters.
In most cases, the absence of a charset directive does not constitute a security flaw, particularly if the response contains static content. You should review the contents of the response and the context in which it appears to determine whether any vulnerability exists.
Issue remediation
For every response containing HTML content, the application should include within the Content-type header a directive specifying a standard recognised character set, for example charset=ISO-8859-1.
GET / HTTP/1.1 Host: www.paypal-labs.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close
Response
HTTP/1.1 200 OK Date: Fri, 12 Aug 2011 13:46:44 GMT Server: Apache Last-Modified: Thu, 11 Nov 2010 20:56:21 GMT ETag: "10eea-f8-34bf4740" Accept-Ranges: bytes Content-Length: 248 Connection: close Content-Type: text/html
GET /integrationwizard/ecpaypal/download.php HTTP/1.1 Host: www.paypal-labs.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close
Response
HTTP/1.1 200 OK Date: Fri, 12 Aug 2011 13:46:47 GMT Server: Apache Content-Length: 64 Connection: close Content-Type: text/html
Attempt to download file without the appropriate input parameter
The response contains the following Content-type statement:
Content-Type: text/html
The response states that it contains HTML. However, it actually appears to contain plain text.
Issue background
If a web response specifies an incorrect content type, then browsers may process the response in unexpected ways. If the specified content type is a renderable text-based format, then the browser will usually attempt to parse and render the response in that format. If the specified type is an image format, then the browser will usually detect the anomaly and will analyse the actual content and attempt to determine its MIME type. Either case can lead to unexpected results, and if the content contains any user-controllable data may lead to cross-site scripting or other client-side vulnerabilities.
In most cases, the presence of an incorrect content type statement does not constitute a security flaw, particularly if the response contains static content. You should review the contents of the response and the context in which it appears to determine whether any vulnerability exists.
Issue remediation
For every response containing a message body, the application should include a single Content-type header which correctly and unambiguously states the MIME type of the content in the response body.
Request
GET /integrationwizard/ecpaypal/download.php HTTP/1.1 Host: www.paypal-labs.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close
Response
HTTP/1.1 200 OK Date: Fri, 12 Aug 2011 13:46:47 GMT Server: Apache Content-Length: 64 Connection: close Content-Type: text/html
Attempt to download file without the appropriate input parameter
The server presented a valid, trusted SSL certificate. This issue is purely informational.
The server presented the following certificates:
Server certificate
Issued to:
www.paypal-labs.com
Issued by:
VeriSign Class 3 Extended Validation SSL CA
Valid from:
Tue Dec 15 18:00:00 GMT-06:00 2009
Valid to:
Tue Jan 31 17:59:59 GMT-06:00 2012
Certificate chain #1
Issued to:
VeriSign Class 3 Extended Validation SSL CA
Issued by:
VeriSign Class 3 Public Primary Certification Authority - G5
Valid from:
Tue Nov 07 18:00:00 GMT-06:00 2006
Valid to:
Mon Nov 07 17:59:59 GMT-06:00 2016
Certificate chain #2
Issued to:
VeriSign Class 3 Public Primary Certification Authority - G5
Issued by:
Class 3 Public Primary Certification Authority
Valid from:
Tue Nov 07 18:00:00 GMT-06:00 2006
Valid to:
Sun Nov 07 17:59:59 GMT-06:00 2021
Certificate chain #3
Issued to:
Class 3 Public Primary Certification Authority
Issued by:
Class 3 Public Primary Certification Authority
Valid from:
Sun Jan 28 18:00:00 GMT-06:00 1996
Valid to:
Wed Aug 02 17:59:59 GMT-06:00 2028
Issue background
SSL helps to protect the confidentiality and integrity of information in transit between the browser and server, and to provide authentication of the server's identity. To serve this purpose, the server must present an SSL certificate which is valid for the server's hostname, is issued by a trusted authority and is valid for the current date. If any one of these requirements is not met, SSL connections to the server will not provide the full protection for which SSL is designed.
It should be noted that various attacks exist against SSL in general, and in the context of HTTPS web connections. It may be possible for a determined and suitably-positioned attacker to compromise SSL connections without user detection even when a valid SSL certificate is used.Report generated by XSS.CX at Fri Aug 12 09:34:03 GMT-06:00 2011.