Skip to content
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.

Prevent user from entering HTML through the forms #72

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Prevent user from entering HTML through the forms #72

wants to merge 2 commits into from

Conversation

marksweb
Copy link
Collaborator

The use of CharField in forms is vulnerable to stored cross site scripting attacks.

User supplied data through the forms needs to be sanitised to prevent malicious use. Currently a user could enter into the various CharFields something like <script>alert("Hi")</script> and when an administrator opens that form submission in the admin, the script would be executed & the alert would appear.

This change introduces a dependency on django-bleach but it then uses it to sanitise HTML entered by the user.

@marksweb
Copy link
Collaborator Author

This fixes #71

@marcosguedes
Copy link

Tested with Python 3, Django 1.11 and Django CMS 3.5.3. It looks great and it works fine

selection_145

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.

2 participants