Skip to content
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

Fix CVE-2018-5773: #285 #303

Merged
merged 1 commit into from
Sep 26, 2018
Merged

Conversation

thombashi
Copy link
Contributor

Add sanitization for incomplete HTML tags.

I believe this PR fix #285 (CVE-2018-5773) as follows:

>>> mark('<img src= onerror=alert(/XSS/)>', safe_mode=True)
<p>[HTML_REMOVED]</p>

>>> mark('<img src= onerror=alert(/XSS/) ', safe_mode=True)
<p>&lt;img src="" onerror=alert(/XSS/) </p>

>>> mark('<img src="" onerror=alert(/XSS/)>', safe_mode="escape")
<p>&lt;img src="" onerror=alert(/XSS/)&gt;</p>

>>> mark('<img src="" onerror=alert(/XSS/) ', safe_mode="escape")
<p>&lt;img src="" onerror=alert(/XSS/) </p>

Add sanitization for incomplete HTML tags.
@nicholasserra
Copy link
Collaborator

LGTM thanks!

@nicholasserra nicholasserra merged commit 1b1dcdd into trentm:master Sep 26, 2018
@thombashi thombashi deleted the fix_cve-2018-5773 branch September 29, 2018 02:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Possible XSS in safe_mode using incomplete tags
2 participants