Copy On Write – Introduction to Hacking ( No – not really )
On October 19, 2016, a privilege escalation vulnerability in the Linux kernel was disclosed. The bug is nicknamed Dirty COW because the underlying issue was a race condition in the way kernel handles copy-on-write (COW). Dirty COW has existed for a long time — at least since 2007, with kernel version 2.6.22 — so the vast majority of servers are at risk.
Exploiting this bug means that a regular, unprivileged user on your server can gain write access to any file they can read, and can therefore increase their privileges on the system.
There are quite a few great groups who write about CMS viruses like those that bother wordpress, joomla or drupal installations.
Fortunately, applying the fix is straightforward: update your system and reboot your server.
On Ubuntu and Debian, upgrade your packages using
- sudo apt-get update && sudo apt-get dist-upgrade
You can update all of your packages on CentOS 6 and 7 with
sudo yum update, but if you only want to update the kernel to address this bug, run:
- sudo yum update kernel
Right now, we’re still waiting on a fix for CentOS 5. In the interim, you can use this workaround from the Red Hat bug tracker.
On older Droplets with external kernel management, you’ll also need to select the DigitalOcean GrubLoader kernel. To do this, go to the control panel, click on the server you want to update. Then, click Kernel in the menu on the left and choose the GrubLoader kernel. Newer Droplets with internal kernel management can skip this step.
Finally, on all distributions, you’ll need to reboot your server to apply the changes.
- sudo reboot
Make sure to update your Linux servers to stay protected from this privilege escalation bug.
If you don’t have ssh access to your server, ask your host company or administrator if they have patched for COW yet.