logo

drewdevault.com

[mirror] blog and personal website of Drew DeVault git clone https://hacktivis.me/git/mirror/drewdevault.com.git

MSG_PEEK-is-more-common-than-you-think-CVE-2016-10229.md (2364B)


  1. ---
  2. date: 2017-04-13
  3. layout: post
  4. title: MSG_PEEK is pretty common, CVE-2016-10229 is worse than you think
  5. tags: [security]
  6. ---
  7. I heard about [CVE-2016-10229](https://nvd.nist.gov/vuln/detail/CVE-2016-10229)
  8. earlier today. In a nutshell, it allows for arbitrary code execution via UDP
  9. traffic if userspace programs are using `MSG_PEEK` in their `recv` calls. I
  10. quickly updated my kernels and rebooted any boxes where necessary, but when I
  11. read the discussions on this matter I saw people downplaying this issue by
  12. claiming `MSG_PEEK` is an obscure feature.
  13. I don't want to be a fear monger and I'm by no means a security expert but I
  14. suspect that this is a deeply incorrect conclusion. If I understand this
  15. vulnerability right you need to drop everything and update any servers running
  16. a kernel <4.5 *immediately*. `MSG_PEEK` allows a programmer using UDP to
  17. read from the kernel's UDP buffer without consuming the data (so subsequent
  18. reads will continue to read the same data). This immediately sounds to me like
  19. a pretty useful feature that a lot of software might use, not an obscure one.
  20. I did quick search for software where `MSG_PEEK` appears in the source code
  21. somewhere. This does not necessarily mean that it's exploitable, but should
  22. certainly raise red flags. Here's a list of some notable software I found:
  23. * nginx
  24. * haproxy
  25. * curl
  26. * gnutls
  27. * jack2
  28. * lynx
  29. * plex (and kodi/xbmc)
  30. * busybox
  31. I also found a few things like programming languages and networking libraries
  32. that you might expect to have MSG_PEEK if only to provide that functionality to
  33. programmers leveraging them. I didn't investigate too deeply into whether or not
  34. that was the case or if this software is using the feature in a less apparent
  35. way, but in this category I found Python, Ruby, Node.js, smalltalk, octave,
  36. libnl, and socat. I used searchcode.com to find these - [here's the full search
  37. results](https://searchcode.com/?q=MSG_PEEK).
  38. Again, I'm not a security expert, but I'm *definitely* spooked enough to update
  39. my shit and I suggest you do so as well. Red Hat, Debian, and Ubuntu are all
  40. unaffected because of the kernel they ship. Note, however, that many cloud
  41. providers do not let you choose your own kernel. This could mean that you are
  42. affected even if you're running a distribution like Debian. Double check it -
  43. use `uname -r` and update+reboot if necessary.