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 8871317
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:57:42+00:00 2026-06-14T17:57:42+00:00

WHMCS uses Smarty for it’s template system, though a great template system it has

  • 0

WHMCS uses Smarty for it’s template system, though a great template system it has a flaw, the {php} tags. These tags allow smarty to interpret PHP code directly in the template, or in this case through the ticket system when a new ticket is created. This hack happens all the time to WHMCS systems, you can try blocking the code in WHMCS through block text option in configuration. But most of the time this doesn’t work.

What happens is that WHMCS accepts the ticket and the hacker added the following to the ticket message:

{php}eval(base64_decode(encoded message));{\php}

So smarty sees the {php} part and immediately let’s PHP run that command. So it first decodes the PHP encoded in base64. This will bring out some PHP function/script that the hacker is trying to run.

Then eval takes over and actually evaluates the PHP code and runs it on server side.

A lot of hackers get in this way, they run codes that they know will work in WHMCS that then grab Database information and echo it to a file. Then they just grab this file through the browser URL and get the information they wanted.

This works on only some WHMCS install’s, though WHMCS says that the most recent version doesn’t allow this and {php} is disabled in Smarty, at times the hacker’s do find a way to get around that and eval their code.

  • 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-14T17:57:43+00:00Added an answer on June 14, 2026 at 5:57 pm

    This is actually a very simple hack to fix using mod_security. First off find where your mod_security config file is located, this all depends on your install of mod_security and OS but it’s normally called modsec.conf or modsec2.conf, sometimes security.conf but very seldom.

    You can find it using the locate command, if installed, on most linux systems.

    sudo updatedb
    locate modsec.conf
    or
    locate modsec2.conf
    

    If you don’t have locate your going to need to go to the / directory and just run find, this will take some time but sometimes panels install it in weird places not just in /etc.

    cd /
    find . -type f -iname 'modsec*.conf'
    

    Either way will work to find the config file. Once found use your favorite editor to edit the file and go to the very bottom and add the following:

    SecRuleEngine On    
    SecRule ARGS {php} "severity:4,log,deny"
    SecRule ARGS eval "severity:4,log,deny"
    SecRule ARGS base64_decode "severity:4,log,deny"
    

    Basically your telling it to filter arguments in GET and POST. That’s it, restart apache now:

    CentOS:
    service httpd restart
    
    Ubuntu:
    service apache2 restart
    

    Now you might be thinking this will block you from using those commands in scripts, not at all. That only blocks those words from being sent over GET or POST. If someone tries they get a Not Acceptable error and it just doesn’t work at all.

    This saves you from having to block a bunch of IP’s from your firewall or WHMCS and potential customer’s.

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

Sidebar

Related Questions

Many popular applications such as Wordpress, WHMCS and the majority of PHP forums allow
I am looking at a very simple PHP code that uses our billing system's
I currently edit one template of WHMCS, it's written by Smarty. Can I use
I need to get a script working for our billing system (WHMCS) using their
We use WHMCS for our billing system for our hosting business. WHMCS is written
Very simple question, is it possible to use a smarty var inside the {php}{/php}
I'm reworking a WHMCS menu to be responsive and touch sensitive. Everything is fine
Is there a way to change the WHMCS language programmaticaly, even with the use
I am trying to insert some extra client details using WHMCS API's 'add client'.
I have a form, in whmcs that I want user to only be able

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.