Summary
A stored cross-site scripting (XSS) vulnerability exists in the admin panel's user management functionality. An attacker can exploit this issue by injecting malicious payloads into the username field during user creation. This vulnerability allows unauthorized script execution whenever the admin views or interacts with the affected user entry, posing a significant risk to sensitive admin functionalities.
Details
The vulnerability lies in the failure to sanitize or escape input data in the username field of the admin panel. When an attacker creates a user with the payload img src = x onerror = alert(1) as the username, the user is successfully created without validation.
Later, when the admin attempts to delete the user, a confirmation prompt is displayed with the message:
Are you sure you want to delete user {username}.
Here, the injected payload executes as JavaScript, resulting in an alert popup (alert(1)). This confirms that the application is vulnerable to stored XSS, as the malicious script persists and executes in the admin's browser.
PoC
Log in to the admin panel.
Navigate to the "Add User" functionality.
Fill in the required details, and in the username field, enter the payload:
img src = x onerror = alert(1)
Complete the user creation process.
![1](https://private-user-images.githubusercontent.com/51159650/406648509-4bac80b9-b602-488c-89ba-ce24595041ad.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1NTEyNDgsIm5iZiI6MTczOTU1MDk0OCwicGF0aCI6Ii81MTE1OTY1MC80MDY2NDg1MDktNGJhYzgwYjktYjYwMi00ODhjLTg5YmEtY2UyNDU5NTA0MWFkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE0VDE2MzU0OFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWFhYzJlY2JmMjcwY2VjNjU0NzIyYmYxYWZlNWRiMmI5MjA3OWU3YmE5MDcxMmIxMmI5MGI0ZDQzYjdmZDFhOTYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.42YTQqSzC51tr-uhZTzgQKjQzEpHVyXklPncDUN6tfA)
Navigate to the user management section. Locate the created user and attempt to delete them.
![2](https://private-user-images.githubusercontent.com/51159650/406648512-256774a7-8007-4ed2-84a0-1f4f155b8927.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1NTEyNDgsIm5iZiI6MTczOTU1MDk0OCwicGF0aCI6Ii81MTE1OTY1MC80MDY2NDg1MTItMjU2Nzc0YTctODAwNy00ZWQyLTg0YTAtMWY0ZjE1NWI4OTI3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE0VDE2MzU0OFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWVlMTFiNTJkNDE0ZDRlMDg1YWU1NDVhMmI2YmM2ODAxZDRkM2ExOTdhYmUyYWU2NGUzMWRkOWYxM2M5MmU1NzkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.5D_AnDunPEkLIfaTMeCuNJYfLSSJ39wGv8aAyjazcUs)
Observe the confirmation prompt. The injected script executes, displaying a JavaScript alert (alert(1)).
![3](https://private-user-images.githubusercontent.com/51159650/406648517-b6cc4019-a23c-432b-90d4-fce415c71010.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1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C1BbXotU2lnbmF0dXJlPTc5NDgxZjZmNzQ0OTZhNjIwZTM3YzdlYWVhNzcyMTk0YzNiOTZhYjNiOGIxNjA1Y2U2NmFiMDM2YzBkMGY3NzYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.BM2vEveJSILwZMXcUjRkae0Mdq8uiSV2hsSDNEMxtXs)
Impact
This is a Stored XSS vulnerability. It impacts the admin panel and allows attackers to execute arbitrary JavaScript in the admin's browser, potentially leading to:
Theft of admin session tokens or sensitive information.
Unauthorized actions performed in the context of the admin.
Potential compromise of the entire application if administrative privileges are escalated.
The impact is significant as it targets high-privilege users (admins) and can compromise the security of the entire system.
Summary
A stored cross-site scripting (XSS) vulnerability exists in the admin panel's user management functionality. An attacker can exploit this issue by injecting malicious payloads into the username field during user creation. This vulnerability allows unauthorized script execution whenever the admin views or interacts with the affected user entry, posing a significant risk to sensitive admin functionalities.
Details
The vulnerability lies in the failure to sanitize or escape input data in the username field of the admin panel. When an attacker creates a user with the payload img src = x onerror = alert(1) as the username, the user is successfully created without validation.
Later, when the admin attempts to delete the user, a confirmation prompt is displayed with the message:
Are you sure you want to delete user {username}.
Here, the injected payload executes as JavaScript, resulting in an alert popup (alert(1)). This confirms that the application is vulnerable to stored XSS, as the malicious script persists and executes in the admin's browser.
PoC
![1](https://private-user-images.githubusercontent.com/51159650/406648509-4bac80b9-b602-488c-89ba-ce24595041ad.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1NTEyNDgsIm5iZiI6MTczOTU1MDk0OCwicGF0aCI6Ii81MTE1OTY1MC80MDY2NDg1MDktNGJhYzgwYjktYjYwMi00ODhjLTg5YmEtY2UyNDU5NTA0MWFkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE0VDE2MzU0OFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWFhYzJlY2JmMjcwY2VjNjU0NzIyYmYxYWZlNWRiMmI5MjA3OWU3YmE5MDcxMmIxMmI5MGI0ZDQzYjdmZDFhOTYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.42YTQqSzC51tr-uhZTzgQKjQzEpHVyXklPncDUN6tfA)
Log in to the admin panel.
Navigate to the "Add User" functionality.
Fill in the required details, and in the username field, enter the payload:
img src = x onerror = alert(1)
Complete the user creation process.
Navigate to the user management section. Locate the created user and attempt to delete them.
![2](https://private-user-images.githubusercontent.com/51159650/406648512-256774a7-8007-4ed2-84a0-1f4f155b8927.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1NTEyNDgsIm5iZiI6MTczOTU1MDk0OCwicGF0aCI6Ii81MTE1OTY1MC80MDY2NDg1MTItMjU2Nzc0YTctODAwNy00ZWQyLTg0YTAtMWY0ZjE1NWI4OTI3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE0VDE2MzU0OFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWVlMTFiNTJkNDE0ZDRlMDg1YWU1NDVhMmI2YmM2ODAxZDRkM2ExOTdhYmUyYWU2NGUzMWRkOWYxM2M5MmU1NzkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.5D_AnDunPEkLIfaTMeCuNJYfLSSJ39wGv8aAyjazcUs)
Observe the confirmation prompt. The injected script executes, displaying a JavaScript alert (alert(1)).
![3](https://private-user-images.githubusercontent.com/51159650/406648517-b6cc4019-a23c-432b-90d4-fce415c71010.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1NTEyNDgsIm5iZiI6MTczOTU1MDk0OCwicGF0aCI6Ii81MTE1OTY1MC80MDY2NDg1MTctYjZjYzQwMTktYTIzYy00MzJiLTkwZDQtZmNlNDE1YzcxMDEwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE0VDE2MzU0OFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTAyMWU1N2ExOGY1YTYxMGQ2YTdmOTc2NTE1MjNlYmI3NDdjOTNkZTljOWExMDlkMTgxNWY2Zjk5NTJhODQ4MTcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.yk9eHUicsbyxN1VHJOE7mQ0KSi6L_0I3_8MgxG74yFU)
![4](https://private-user-images.githubusercontent.com/51159650/406648520-a15ef982-b697-46ce-bc1f-15fb7f0a4723.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1NTEyNDgsIm5iZiI6MTczOTU1MDk0OCwicGF0aCI6Ii81MTE1OTY1MC80MDY2NDg1MjAtYTE1ZWY5ODItYjY5Ny00NmNlLWJjMWYtMTVmYjdmMGE0NzIzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE0VDE2MzU0OFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTc5NDgxZjZmNzQ0OTZhNjIwZTM3YzdlYWVhNzcyMTk0YzNiOTZhYjNiOGIxNjA1Y2U2NmFiMDM2YzBkMGY3NzYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.BM2vEveJSILwZMXcUjRkae0Mdq8uiSV2hsSDNEMxtXs)
Impact
This is a Stored XSS vulnerability. It impacts the admin panel and allows attackers to execute arbitrary JavaScript in the admin's browser, potentially leading to:
Theft of admin session tokens or sensitive information.
Unauthorized actions performed in the context of the admin.
Potential compromise of the entire application if administrative privileges are escalated.
The impact is significant as it targets high-privilege users (admins) and can compromise the security of the entire system.