Akamai to acquire LayerX to enforce AI usage control on any browser. Get details

Loose Lips Can Sink Websites Too

Alex Leung

Oct 21, 2024

Alex Leung

Alex Leung

Written by

Alex Leung

Alex Leung is a Senior Enterprise Architect at Akamai Technologies. With over nine years at Akamai, Alex has been instrumental in advancing the capabilities of streaming high-quality media content through Akamai.

Share

When we think about keeping websites safe, we often imagine complex firewalls, multi-layered defenses, and robust encryption. But sometimes, the weak link in your security chain is not that obvious. It can be as simple as a misplaced configuration or an exposed version number. Loose configuration settings can sink websites too. This blog will dive into how exposed version numbers in your tech stack can lead to serious vulnerabilities, and what you can do to tighten security.

A Real-World Example: Exposed PHP Version

During a routine security assessment, we discovered an outdated PHP version being openly advertised by a website’s server configuration. It’s a prime example of what not to do. Using tools like Wappalyzer, a quick glance revealed the PHP version: 8.2.19. On the surface, it might seem like a small oversight, but the repercussions can be severe.

This particular version of PHP has several critical vulnerabilities linked to it. One of the most concerning is CVE-2024-4577, which could potentially allow an attacker to execute arbitrary code remotely. In other words, by simply revealing that it uses this version of PHP, the website might as well have put a “Welcome Hackers” sign on its front door.

For more details on the vulnerabilities associated with this version, see Tenable’s analysis.

Why Do Exposed Version Numbers Matter?

Every technology stack — whether it’s a CMS, a server, or a scripting language — has a lifecycle. New versions come out regularly to patch vulnerabilities and improve performance. But when a website exposes the exact versions it’s running, bad actors can easily cross-reference known vulnerabilities for each version and tailor their attacks accordingly. This is known as a cyber supply chain attack — attackers target specific software versions within an organization’s tech stack to compromise its overall security.

A Practical Fix: Turning Loose Lips Into Tight Lips

So, how do you make sure your website isn’t leaking this crucial information? For starters, review your server configurations and make sure sensitive details aren’t being broadcast to the world. Let’s walk through a quick fix for one of the most common offenders: PHP.

  1. Find your php.ini configuration file. This file controls many of PHP’s settings and can often be found at /usr/local/lib/php.ini.
  2. Locate the line that reads:
    expose_php = On  
  3. Change the setting to:
    expose_php = Off  
  4. Restart your HTTP service to apply the changes.

With this small tweak, you’re effectively preventing your server from broadcasting its PHP version. While it’s a simple fix, it can significantly reduce your attack surface.

Beyond Version Obfuscation: Comprehensive LAMP Stack Security

Obfuscating your version numbers is a great first step, but true security requires a holistic approach. If you’re running a LAMP stack (Linux, Apache, MySQL, and PHP), you need to secure each component to prevent attackers from finding other points of entry. This means tightening configurations, managing permissions, and implementing tools like firewalls and intrusion detection systems.

For example, ensuring that your MySQL installation is locked down can prevent database attacks that might compromise sensitive data. Similarly, setting up proper file permissions and disabling unused modules in Apache can limit the reach of an attacker even if they do find a way in.

Another measure you can take is implementing a firewall like our Web Application Firewall to control traffic to your server, along with Fail2Ban to automatically block IP addresses that show signs of brute-forcing your SSH login.

Regular Audits and Best Practices

Securing your LAMP stack isn’t a one-time task. Regular audits using tools like Lynis or MySQL Security Tools can help identify weak points in your configuration and keep your stack resilient against emerging threats. This means running system scans, analyzing logs, and testing your configuration for potential gaps on an ongoing basis.

Protecting your website is about more than just hiding version numbers. While exposed versions are a common vulnerability, they are just one piece of the puzzle. To fully safeguard your LAMP stack, you need to take a comprehensive approach that addresses configuration management, access control, and continuous monitoring.

To dive deeper into securing each part of your LAMP stack—from locking down SSH to tightening MySQL permissions and implementing advanced security rules for Apache—check out the full guide on Securing Your LAMP Stack. It provides step-by-step instructions and advanced techniques to protect your server from the ground up, ensuring a robust and secure foundation for your web applications.

Alex Leung

Oct 21, 2024

Alex Leung

Alex Leung

Written by

Alex Leung

Alex Leung is a Senior Enterprise Architect at Akamai Technologies. With over nine years at Akamai, Alex has been instrumental in advancing the capabilities of streaming high-quality media content through Akamai.

Tags

Share

Related Blog Posts

Developers
Akamai Blog | Developers Push Coding to the Edge in Akamai
November 11, 2021
The first-ever Akamai EdgeWorkers Coding Challenge gave participants the opportunity to harness the power and potential of serverless computing using the Akamai Intelligent Edge Platform. Winning developer teams built functions using Akamai EdgeWorkers and EdgeKV products that ranged from DNS acceleration and cost-reducing traffic efficiencies to personalized experiences for news and cloud gaming.
Developers
Evolving Digital Experiences at the Edge
November 10, 2022
The modern application has evolved and shifted to the edge. This inevitable adoption is improving the digital experience for end users.
Cloud
What’s New for Developers: September 2024
September 20, 2024
We’ve got 7 new developer launches to announce, including updates for EdgeWorkers, EdgeKV, and Akamai Terraform Provider.