Support

Admin Tools

#26826 PHPMailer vulnerability

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Admin Tools version
n/a

Latest post by appnweb on Wednesday, 04 January 2017 03:38 CST

appnweb
 Hi,

I come today with questions that are not directly related to admintools but that I thought maybe you could answer, security being one of your main skills.

They concern PHPMailer vulnerability discovered late december : https://github.com/PHPMailer/PHPMailer/wiki/About-the-CVE-2016-10033-and-CVE-2016-10045-vulnerabilities

Joomla actually will not issue a security update for it as it is not possible to exploit it within the core but it could be exploited via third party extensions relying on core library to send mails and it's quite difficult to be sure that all of them are avoiding bad practices that could allow the vulnerability to be exploited.

That's why we are trying to know if :

- Setting websites to send via SMTP instead of PHP mail would get us safe or not.
- Trying to manually update the Joomla core library may be of some use.
- There is a another way to protect a website globally against this type of exploit.

Thanks in advance for your help.

nicholas
Akeeba Staff
Manager
General information

The security issue only affects developers who bypass Joomla's mail interface (JMail) and use PHPmailer directly, either the copy shipped with Joomla or, more typically, a copy they bundle with their software; or developers who pass a custom sender (From) e-mail address to JMail. In both cases the attack is only possible IF, AND ONLY IF, the sender (From) e-mail address originates from an untrusted source, i.e. unvalidated, unfiltered user input coming from unprivileged, untrusted users.

When you use Joomla's default e-mail API (JMail) the mail sender address is stored in the site's Global Configuration (configuration.php) which means that only a Super User or someone with full filesystem access to your site can modify it.

Joomla itself is NOT vulnerable and developers are required to validate and filter the input data to their own software. In fact, Joomla provides a very robust email address validator which, if used on data entry, will prevent entering the kind of data required to exploit this vulnerability in PHPmailer. Therefore, if the developers use core Joomla correctly their software will be immune to this issue, just like Joomla. That's why Joomla is not releasing an update.

In the light of this information let's address your concerns:

- Setting websites to send via SMTP instead of PHP mail would get us safe or not.


No. The mail delivery gateway is irrelevant as it'd come into play long, LONG, REALLY LONG after the attack vector (parsing of the From headers preparing an email for sending) runs.

- Trying to manually update the Joomla core library may be of some use.


Joomla is immune to this attack by the nature of its mail API (JMail) as we discussed above.

Only extensions which set the sender (From) address of the email field to unfiltered, unvalidated data originating from unprivileged users are affected. Due to e-mail security features like SPF and DKIM almost nobody does this... except apparently some mass mailer (newsletter) components, like AcyMailing, which were updated immediately after this exploit was made known.

To put things in perspective, setting the From address is not unheard of. We let you do that in Akeeba Ticket System but ONLY if you are a Super User who's configuring support Categories and we do use Joomla's email validation rules. So unless you go and edit your database by hand with the explicit purpose of hacking yourself (which is no different to taking apart a wall socket with a screwdriver with the explicit purpose of electrocuting yourself) you're just fine.

- There is a another way to protect a website globally against this type of exploit.


No. There is no magic bullet. What you should do is employ the standard security best practices: do not run outdated software, always monitor your software for available updates and install them promptly and so on.

In conclusion

This security issue has been blown out of proportion by people who don't really understand how Joomla works. They thought "PHPmailer has a security issue, Joomla uses PHPmailer, ergo Joomla has a security issue". WRONG! Exploiting this vulnerability requires bad data being fed to the PHPmailer library. Joomla's default behavior is to populate this field with safe data, entered and audited by Super Users only. In fact, due to SPF and DKIM, this is probably the only data which will ever really work for sending out an email.

For the more rare, yet legitimate, cases a developer needs a different sender address Joomla provides email validation rules (JFormRuleEmail) which would catch and prevent the malicious data required to exploit PHPMailer. It should be noted that the most fundamental security lesson a developer is taught is something that seems to be taken straight out of The X-Files: "Trust No-one". All user data is to be considered malicious unless proven safe. Developers ignore that mantra at their own (and their clients') risk and peril.

So as long as you use software by reputable developers who know what they are doing AND stay on top of updates you are safe.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

appnweb
Hi Nicholas,

Thanks a lot for your answer, it's exactly the explanations I needed and thus helps me a lot.

Have a nice day !

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!