sanitation

How to make HTML written by users on a site, not conflict with the site's stylesheets?

I have a website that allows a user to create blog posts. There are some backlisted tags but most standard HTML tags are acceptable. However, I'm having issues with how the pages get displayed. I keep the HTML wrapped in its own div. I would ultimately like to keep the HTML from the user separate from the main sites stylesheets so it...

Input Sanitation Best Practices

Our team has recently been working on a logic and data layer for our database. We were not approved to utilize Entity or Linq to SQL for the data layer. It was primarily built by hand. A lot of the SQL is auto generated. An obvious down fall of this is the need to sanitize inputs prior to retrieval and insertion. What are the best meth...

Bare-minimum text sanitation

In an application that accepts, stores, processes, and displays Unicode text (for the purpose of discussion, let's say that it's a web application), which characters should always be removed from incoming text? I can think of some, mostly listed in the C0 and C1 control codes Wikipedia article: The range 0x00-0x19 (mostly control char...