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

  • SEARCH
  • Home
  • 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 827487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T03:34:57+00:00 2026-05-15T03:34:57+00:00

I’m creating a PHP CMS, one that I hope will be used by the

  • 0

I’m creating a PHP CMS, one that I hope will be used by the public. Security is a major concern and I’d like to learn from some of the popular PHP CMS’s like WordPress, Joomla, Drupal, etc. What are some security flaws or vulnerabilities that they have they had in the past that I can avoid in my application and what strategies can I use to avoid them? What are other issues that I need to be concerned with that they perhaps didn’t face as a vulnerability because they handled it correctly from the start? What additional security features or measures would you include, anything from minute details to system level security approaches? Please be as specific as possible. I’m generally aware of most of the usual attack vectors, but I want to make sure that all the bases are covered, so don’t be afraid to mention the obvious as well. Assume PHP 5.2+.

Edit: I’m changing this to a community wiki. Even though Arkh’s excellent answer is accepted, I’m still interested in further examples if you have them.

  • 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-05-15T03:34:58+00:00Added an answer on May 15, 2026 at 3:34 am

    Cross-Site Request Forgery (CSRF)

    Description :

    The basic idea is to trick a user to a page where his browser will initiate a POST or GET request to the CMS you attack.

    Imagine you know the email of a CMS powered site administrator. Email him some funny webpage with whatever you want in it. In this page, you craft a form with the data used by the admin panel of the CMS to create a new admin user. Send those data to the website admin panel, with the result in a hidden iframe of your webpage.
    Voilà, you got your own administrator account made.

    How to prevent it :

    The usual way is to generate random short-lived (15mn to hour) nonce in all your forms. When your CMS receive a form data, it checks first if the nonce is alright. If not, the data is not used.

    CMS examples :

    • CMS made simple
    • Joomla!
    • Drupal
    • ModX

    More information :

    On the wikipedia page and on the OWASP project.

    Bad password storing

    Description :

    Imagine your database get hacked and published on something like wikileak. Knowing that a big part of your users use the same login and password for a lot of websites, do you want them to be easy to get ?

    No. You need to mitigate the damages done if your database datas become public.

    How to prevent it :

    • A first idea is to hash them. Which is a bad idea because of rainbow tables (even if the hash is not md5 but sha512 for example).
    • Second idea : add a unique random salt before hashing so the hackers has to bruteforce each password. The problem is, the hacker can compute a lot of hash fast.
    • So, the current idea is to make it slow to hash the passwords : you don’t care because you don’t do it often. But the attacker will cry when he gets from 1000 hash generated per ms to 1.

    To ease the process, you can use the library phpass developped by some password guru.

    CMS examples :

    • Joomla! : salted md5
    • ModX : md5
    • Typo3 : cleartext
    • Drupal : switched to phpass after this discussion.

    More information :

    The phpass page.

    Cross Site Scripting (XSS)

    Description

    The goal of these attacks, is to make your website display some script which will be executed by your legitimate user.

    You have two kind of these : persistent or not. The first one comes usually from something your user can save, the other count on parameters given by a request sent. Here is an example, not persistent :

    <?php
    if(!is_numeric($_GET['id'])){
      die('The id ('.$_GET['id'].') is not valid');
    }
    ?>
    

    Now your attacker can just send links like http://www.example.com/vulnerable.php?id=<script>alert('XSS')</script>

    How to prevent it

    You need to filter everything you output to the client. The easiest way is to use htmlspecialchars if you don’t want to let your user save any html. But, when you let them output html (either their own html or some generated from other things like bbcode) you have to be very careful. Here is an old example using the “onerror” event of the img tag : vBulletin vulnerability. Or you have the old Myspace’s Samy.

    CMS examples :

    • CMS made simple
    • Mura CMS
    • Drupal
    • ModX

    More information :

    You can check wikipedia and OWASP. You also have a lot of XSS vector on ha.ckers page.

    Mail header injection

    Description :

    Mail headers are separated by the CRLF (\r\n) sequence. When you use some user data to send mails (like using it for the From: or To:) they can inject more headers. With this, they can send anonymous mails from your server.

    How to prevent it :

    Filter all the \n, \r, %0a and %0d characters in your headers.

    CMS examples :

    • Jetbox CMS

    More information :

    Wikipedia is a good start as usual.

    SQL Injection

    Description :

    The old classic. It happen when you form a SQL query using direct user input. If this input is crafted like needed, a user can do exactly what he want.

    How to prevent it :

    Simple. Don’t form SQL queries with user input. Use parameterized queries.
    Consider any input which is not coded by yourself as user input, be it coming from the filesystem, your own database or a webservice for example.

    CMS example :

    • Drupal
    • Joomla!
    • ModX
    • Pars CMS

    More information :

    Wikipedia and OWASP have really good pages on the subject.

    Http response splitting

    Description :

    Like e-mail headers, the http headers are separated by the CLRF sequence. If your application uses user input to output headers, they can use this to craft their own.

    How to prevent it :

    Like for emails, filter \n, \r, %0a and %0d characters from user input before using it as part of a header. You can also urlencode your headers.

    CMS examples :

    • Drake CMS
    • Plone CMS
    • WordPress

    More information :

    I’ll let you guess a little as to where you can find a lot of infos about this kind of attack. OWASP and Wikipedia.

    Session hijacking

    Description :

    In this one, the attacker want to use the session of another legitimate (and hopefully authenticated) user.
    For this, he can either change his own session cookie to match the victim’s one or he can make the victim use his (the attacker’s) own session id.

    How to prevent it :

    Nothing can be perfect here :
    – if the attacker steal the victim’s cookie, you can check that the user session matches the user IP. But this can render your site useless if legitimate users use some proxy which change IP often.
    – if the attacker makes the user use his own session ID, just use session_regenerate_id to change the session ID of a user when his rights change (login, logout, get in admin part of the website etc.).

    CMS examples :

    • Joomla! and Drupal
    • Zen Cart

    More information :

    Wikipedia page on the subject.

    Other

    • User DoSing : if you prevent bruteforcing of login attempt by disabling the usernames tried and not the IP the attempts come from, anyone can block all your users in 2mn. Same thing when generating new passwords : don’t disable the old one until the user confirm the new one (by loging with it for example).
    • Using user input to do something on your filesystem. Filter this like if it was cancer mixed with aids. This concern the use of include and require on files which path is made in part from the user input.
    • Using eval, system, exec or anything from this kind with user input.
    • Don’t put files you don’t want web accessible in web accessible directory.

    You have a lot of things you can read on the OWASP page.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I would like to count the length of a string with PHP. The string
I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
I'm trying to create an if statement in PHP that prevents a single post
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text

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.