-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Logo "alt" attribute not escaped; possible (self) XSS #19269
Comments
Hi @KevinGimbel. Thank you for your report.
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
where @KevinGimbel do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?
|
@magento-engcom-team give me 2.2.6 instance |
Hi @KevinGimbel. Thank you for your request. I'm working on Magento 2.2.6 instance for you |
Hi @KevinGimbel, here is your Magento instance. |
Reproduced on http://34.228.235.121/i-19269-2-2-6/ |
Hi @engcom-backlog-nazar. Thank you for working on this issue.
|
@engcom-backlog-nazar Thank you for verifying the issue. Based on the provided information internal tickets |
This is not XSS. XSS is if someone (not an admin but a normal user) adds JavaScript to the URL / address bar (or forms) and it happens. Also just admins can edit this field. |
This is the same in many other places. No (special) XSS here, just missing escaping. It is up to the admin who can edit this field / data. In fact, this is not cross-site. |
See https://www.owasp.org/index.php/Cross-site_Scripting_(XSS) A typical (reflected) XSS is for example something like |
@DanielRuf you're right, it's not XSS - my bad! I still think it is a small attack vector even if it requires an admin to enter text - they could be tricked into copy-pasting very long alt texts which end in |
Sure but this would be the case for every config field and for every CMS and WYSIWYG editor. Still the escaping makes sense but this specific case is not a real attack vector (never saw someone saying It's similar to |
Just because you haven't seen it doesn't mean it does not happen. What if a non-technical person searches for ways to rank up in Google and they and up on a shady website that promises perfect alt texts for images based on AI-whatever-fancy-buzzwords. They might copy HTML into their alt texts; Said website might even offer a selection of what CMS they use to exploit such things. Just because you wouldn't make the mistake doesn't mean nobody else might do it. If I, in any way, manage to inject a piece of JS into your site I can for example easily read out the Admin URL which is randomized since Magento 2. Or sent all cookies and
It is similar and people fall for these fishing emails and scams. |
Then social engineering is a bigger problem ;-) But in general: you are right. |
Hi @KevinGimbel. Thank you for your report.
The fix will be available with the upcoming 2.3.1 release. |
Preconditions (*)
Steps to reproduce (*)
Content -> Design -> Configuration
Logo Image Alt
fieldNotice the leading
"
Expected result (*)
alt
attribute on the image is properly escapedActual result (*)
"
)onload
is added as attribute to the image which evaluates the javascript on loadThe problem is
getLogoAlt()
inMagento\Theme\Block\Html\Header\Logo
.This function should escape all special characters like
"
to prevent this (self) XSS attack.Here is the line in the code https://github.com/magento/magento2/blob/2.3-develop/app/code/Magento/Theme/Block/Html/Header/Logo.php#L73
The text was updated successfully, but these errors were encountered: