XSS vulnerability

Author: emizzzCreated Dec 8, 2022Updated Jan 7, 2025

Magnific Popup uses a parameter called preloader, which by default is set to true.

Using a specifically crafted payload (in src URL) two things happen:

Initially, the text variable in the updateStatus function is set to “Loading…”

magnific_popup_vulnerability_debug1

Then it takes the value passed to it by the default error handling function (which contains the URL).

mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) );

magnific_popup_vulnerability_debug2

The problem here is that the .html() function does not escape HTML and could be used to inject code.

The vulnerability, if exploitable, can even lead to "stored XSS".

Source: dimsemenov/Magnific-Popup