Velociraptor uses a DOM sanitizer to protect against XSS attacks. Vulnerable versions of Velociraptor used a weaker regular expression to permit certain HTML attributes, which matched the right click handler (oncontextmenu). This allowed a stored XSS attack by permitting Javascript to be attached to the right click handler. The vulnerable code was triggered in an error path reachable from artifact viewer.
The attacker needs to send the user a malicious link with JS code. After clicking the link, the user is presented with an error box listing the entire decoded malicious payload.
Only after the user right clicks a different part of the screen would the JS be run.
In practice this is hard to trigger without the user noticing something is wrong.