Problem/Motivation
The module has a potential XSS vulnerability because it does not sanitize the value of alt attributes before using it as caption.
Steps to reproduce
Enable the ImageLightBox formatter on an image field.
Upload an image in this field and set this value as alternative text:
<img src=x onerror="alert()">
When clicking on the image, the malicious JS is executed.
Proposed resolution
captionReset() could use $captionObject.text() instead of $captionObject.html() to ensure the caption is sanitized.
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork imagelightbox-3518704
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #5
piridium commentedComment #8
piridium commentedComment #9
piridium commentedWe just released imagelightbox 2.2.5 which includes the fix for this issue. Thanks @prudloff for reporting it.
Comment #10
piridium commented