Escaping Docker container using waitid() – CVE-2017-5123
This exploit is interesting, but if you are doing container security correctly it’s actually not a big deal. In particular if you are setting per-container usernamespaces, like you ought to be, then this exploit doesn’t do anything. In fact you can actively give a usernamespaced container any CAPs you want, because they are isolated to that container’s uid:gid offset.<p>Obviously, giving containers unecessary CAP privileges in unwise, but if you are practicing sound security best practices then there would be multiple layers of defense between you and this CVE. I think a strong AppArmor profile and SecComp profile would also make this CVE moot.<p>Edit:
Also, this exploit relies on you being able to fork up to a certain pid value. You can and should take advantage of Linux’s per cgroup ulimit functionality. No container needs more than 255 threads (even if they do you can make special exceptions for such applications).<p>Edit2:
Additionally this CVE relies on the getuid syscall being available, there is no reason to give a container this syscall, you should block it, ala this guide:
<a href="https:&#x2F;&#x2F;rhelblog.redhat.com&#x2F;2016&#x2F;10&#x2F;17&#x2F;secure-your-containers-with-this-one-weird-trick&#x2F;" rel="nofollow">https:&#x2F;&#x2F;rhelblog.redhat.com&#x2F;2016&#x2F;10&#x2F;17&#x2F;secure-your-container...</a><p>I have to say I’m more than a little dissapointed in Twistlock for not pointing out what countermeasures you can employ against this and other CVEs.