Skip to content
This repository was archived by the owner on Sep 23, 2020. It is now read-only.

XSS vulnerability fixed. [ High Priority ] #66

Open
DrHazemAli wants to merge 1 commit intoJeremyFagis:masterfrom
DrHazemAli:master
Open

XSS vulnerability fixed. [ High Priority ] #66
DrHazemAli wants to merge 1 commit intoJeremyFagis:masterfrom
DrHazemAli:master

Conversation

@DrHazemAli
Copy link

Hi,
There is an XSS vulnerability inside dropify.min.js allows client-side to perform JS actions when the image being uploaded in the preview inner because the filename itself can be renamed to an html or javascript code.

Example : (">< img src = x onerror=prompt(1) >.png)

Org:
this.filenameWrapper.children(".dropify-filename-inner").html(this.file.name);

Fixes :

this.filenameWrapper.children(".dropify-filename-inner").html(cleanHTMLi(this.file.name));

I've written a function to perform HTML cleanup:

function cleanHTMLi(s) {
return s.replace(/&/g, '&').replace(/</g, '<').replace(/"/g, '"');
}

Thanks,

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant