Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7941137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T23:34:43+00:00 2026-06-03T23:34:43+00:00

I am currently using django-ckeditor to allow users to enter a rich description for

  • 0

I am currently using django-ckeditor to allow users to enter a rich description for their profile.

However, this opens the door to malicious users that will try to do XSS and other code injection.

I was wondering what would be the best way to go about this?

I looked at Python HTML sanitizer / scrubber / filter, but it seems that these solutions get rid of attributes such as “style=”, which totally contradict the usage of ckeditor to have, for example, coloured text, or other stuff that depend on these attributes.

Should I use another tool instead of ckeditor? Or what can I do?

My main goal is to allow the user to show pictures, coloured text, etc in their “profile”

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T23:34:46+00:00Added an answer on June 3, 2026 at 11:34 pm

    You should decide and write a “whitelist” of what is allowed to post. Then, parse posted data thoroughly and clean up everything what is not in that whitelist. If it is some style – parse style attribute and remove everything except whitelisted stuff.

    You can do it with old good BeautifulSoup, for example.

    Surely, don’t whitelist <script> tags or onSOMETHING handlers – they usually bring more pain than the gain.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently using Django Users model. Very simple. However, I'd like to add
I'm using django-avatars to handle user profile avatars for my website. I'm currently developing
I am currently using this syntax in my Django 1.1.2 template: {% ifnotequal myvalue
Currently, this is how I do my login: (r'^login/?$','django.contrib.auth.views.login',{'template_name':'login.html'}), I'm using Django's built in
I am currently using Django and my model is like this. class City(models.Model): name
I am currently using Django to construct JSON encoded objects which a retrieved using
I'm currently using django with tastypie. I need to implement an api for Questions
Currently using MySQL version 5.1.6 This is my first real world build and so
I'm currently using a the pre_save django signals and it works fine when calling
I'm currently using Django 1.0 on my Mac OS X 10.5.7 box. It's installed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.