Jcase released a root method for the M8 and other htc devices right around the time that the M8 was released. The root method Weaksauce was patched pretty quickly with an update. There have actually been a few updates since the patch was released. Jcase and Beaups were tyring to hold out releasing this method until HTC and Verizon released Android 5.0 but apparently these methods were already patched in 5.0 so they decided to go ahead and release it now. The method is super simple just head to the link below to download WeakSauce 2 and run the app to obtain root. After the app has ran you will need to head to the play store and install the SuperSU app. Be sure to update the binaries from within the app. Root will reload on every reboot. Grab this from the link below.