Web Server Load Balancing with NGINX Plus

There is a new zero day exploit in Joomla. Details are described in CVE-2015-8562.

We recommend that you update Joomla immediately, but if you cannot do that or cannot change the files on your backend servers, you can apply a fix in NGINX or NGINX Plus on the frontend.

Note: We strongly advise to update your Joomla installations as soon as possible, even if you patch your site today with this NGINX configuration.

You can read about the exploit and the patch at the Sucuri blog or Ars Technica, among others.

Identifying the Attack

The original attacks came from these IP addresses:

  • On 12 December 2015 –
  • On 13 December 2015 – and

The attack is usually performed by modifying the User-Agent header and can be identified by these values inside the header: JDatabaseDriverMysqli and O: (capital letter O followed by the colon).

Joomla provides the following sample log entry from an attack.

2015 Dec 12 16:49:07 clienyhidden.access.log
Src IP: 74.3.XX.XX / CAN / Alberta
74.3.XX.XX [12/Dec/2015:16:49:40 -0500] GET /contact/ HTTP/1.1 403 5322 }__test|O:21:x22JDatabaseDriverMysqlix22:3:..{s:2:x22fcx22;O:17:x22JSimplepieFactoryx22:0:..{}s:21:x22x5C0x5C0x5C0disconnectHandlersx22;a:1:{i:0;a:2:{i:0;O:9:x22SimplePiex22:5:..{s:8:x22sanitizex22;O:20:x22JDatabaseDriverMysqlx22:0:{}s:8:x22feed_urlx22;s:60:..

Applying a Fix in NGINX or NGINX Plus

Use this snippet of NGINX configuration to block the original IP addresses and any request where the User-Agent header contains O: or JDatabaseDriverMysqli. To block additional IP addresses, add them to the list in the second map block.

http {
    map $http_user_agent $blocked_ua {
        ~(?i)O: 1;
        ~(?i)JDatabaseDriverMysql 1;
        default 0;

    map $remote_addr $blocked_ip { 1; 1; 1;
        default 0;
    server {
        listen 80;
        if ($blocked_ua) { return 403; }
        if ($blocked_ip) { return 403; }
        # ...

For further information on restricting access to your site, see the NGINX Plus Admin Guide.

Post your experience in the Comments below.

Hero image
Are Your Applications Secure?

Learn how to protect your apps with NGINX and NGINX Plus


Floyd Smith


自 Macintosh 推出以来,Floyd Earl Smith 一直在参与应用开发,并撰写了 20 多本有关硬件和软件主题的书籍。他是 NGINX 博客的撰稿人之一,内容包括有关 NGINX 微服务参考架构(一种突破性的微服务框架)的多篇文章和线上讲座。


F5, Inc. 是备受欢迎的开源软件 NGINX 背后的商业公司。我们为现代应用的开发和交付提供一整套技术。我们的联合解决方案弥合了 NetOps 和 DevOps 之间的横沟,提供从代码到用户的多云应用服务。访问 了解更多相关信息。