Kses is an HTML/XHTML filter written in PHP. It removes all unwanted HTML elements and attributes, and it also does several checks on attribute values. Kses can be used to avoid Cross-Site Scripting (XSS), Buffer Overflows and Denial of Service attacks.