Stored XSS in End page in limesurvey/limesurvey
Reported on
May 30th 2023
Description
Allows a user who only has the authority to create surveys (not the administrator) to bypass validation and embed javascript schemes when creating surveys
Step to reproduce
- Login as administrator
- Open
User management
and Create a user with create surveys only permissions. - Logout
- Attacker
- Login as user with create surveys only permissions
- Open
Create survey
and create a valid survey. - Click
Setting
and opentext elements
. - Fill
javascript:alert(1)//
inEnd URL
and Save. - javascript:scheme is validated and changed to
alert(1)//
. - Fill
javasjavascript:cript:alert(1)//
inEnd URL
and Save. - The saved result is
javascript:alert(1)//
and the javascript scheme can be embedded.(If you put text in the 'URL description:' field, the attack will be more successful because the URL will not be displayed when the link is displayed) - activate.
- Victim
- Open the attacker-generated survey and finish the survey.
- Click the link in final page.
- Javascript execute.
Impact
Cross site scripting attacks can have devastating consequences. Code injected into a vulnerable application can exfiltrate data or install malware on the user’s machine. Attackers can masquerade as authorized users via session cookies, allowing them to perform any action allowed by the user account.
Occurrences
LSYii_Validators.php L73
This validation only removes the javascript: once, so if you include more than one, they can be embedded. You need to recurse and remove all of them.