WordPress.org

Ready to get started?Download WordPress

Forums

Forms & Security (3 posts)

  1. jbeltran
    Member
    Posted 5 years ago #

    Hi,

    I was just wondering, how secure are the WordPress forms (e.g. the comment, search, contact forms etc)? I also noticed that WP allows comments to have HTML in them - does this pose as a security risk? If it does, is there a way I can disable them?

    Thanks!

  2. t31os
    Member
    Posted 5 years ago #

    Depends what HTML is allowed...

    Allowed tags are the same as those allowed here in the forums (i think)...

    Go test it yourself...

    Try <script>, or <iframe> ... etc..

    I'm yet to see any exploits appear as a result of someone allowing bold em, li, ul, etc.. or the like... :) ...

    You only need to remember one thing when it comes to security...
    NEVER TRUST USER INPUT... :)

    That's typically handled by the PHP side of things ... unless of course you allow all HTML input...

  3. asechrest
    Member
    Posted 5 years ago #

    Just checked this out recently after I read a question here on the forums. For comments, posts, (and a number of other input forms), WordPress uses the kses filter. Google it for some info.

    To see what HTML is allowed, you can go into wp-includes/kses.php and look at the multi-dem arrays. There's two of them.

    The allowable HTML for comments, user description, etc. is very small. The allowable HTML for posts is much larger, though still filtered.

    The filter functions are wp_filter_kses and wp_filter_posts_kses.

    You can utilize these functions in plugins, and as t31os advises, never trust the user, and never trust that someone couldn't log on with that user's account and enter code with malicious intent.

Topic Closed

This topic has been closed to new replies.

About this Topic