Bug #13
closedStored Cross-Site Scripting (XSS) in Event HTML field via /api/events/create
Description
Title
Stored Cross-Site Scripting (XSS) in Event HTML field via /api/events/create
Environment
Application: aKinder Wellness Admin Panel
URL: https://dev.akinderwellness.com/pages/events
API Endpoint: /api/events/create
Browser: Chrome 145
Environment: Development
Description
The Create Event API accepts HTML content in the html parameter without sanitizing user input.
An attacker can inject malicious JavaScript using HTML event attributes such as onclick.
The injected script is stored in the database and executed in the browser when a user interacts with the rendered content.
This results in a Stored Cross-Site Scripting (Stored XSS) vulnerability.
Steps To Reproduce
- Send Post Request to API:
POST /api/events/create - Use the following payload in the html field
HelloHi
- Post the request and create the event successfully
- Navigate to
https://dev.akinderwellness.com/pages/events - Click the Hi link
Actual Result
JavaScript executes in the browser and an alert popup appears showing the XSS payload.
Expected result
User supplied HTML should be sanitized before rendering. Dangerous attributes such as:
- onclick
- onload
- onerror
- javascript:
IMPACT
Attacker can inject malicious scripts that can be executed on user's browser which can cause impact like:
Data Theft
Unauthorized API Actions
Phishing Attack within the application UI
Files
Updated by Adhi Narayanan about 1 month ago
- % Done changed from 0 to 100
Thank you for reporting the Stored XSS vulnerability in the Event HTML field.
We have implemented server-side sanitization for both html and text fields using a whitelist-based HTML sanitizer.
Dangerous attributes such as onclick, onerror, onload, and javascript: URLs are now removed or escaped before saving to the database.
Please re-test the issue and confirm if it is resolved.
Updated by Vivek Kumar about 1 month ago
I checked it again. In Development environment and the bug persists. I can't check it on production server as I am not given permission for it.