Is any of the Android rooting software open source? As an example, the post here for rooting the LG G3:

http://www.reddit.com/r/LGG3/comments/2cdz0y/guide_rooting_roming_xposed/

Gives links to posts elsewhere for downloading APKs which do something and then allow su to work, I think:

Stump:  http://forum.xda-developers.com/lg-g3/orig-development/root-stump-root-lg-g3-sprint-verizon-t2850906/

PurpleDrake:  http://forum.xda-developers.com/tmobile-lg-g3/development/root-twrp-root-twrp-tmo-lg-g3-t2821005

Are there any more details about what these or other root techniques actually do?  Are any of them open source?
I've been battling the same issue. Using closed-source from a private company is a huge mistake if you care about security and privacy. Open-source, though arguably not thst much more secure, has one benefit over closed source from a private company: paid programmers are expensive. What's their motive for paying people to do this? Money. Is the root software free/cheap? Don't use it.  Open Source, on the other hand, though while not totally free from malicious additions, is being handled mostly by programmers who, collectively, want to use the software they are helping create. That being said, here's what I've mustered up.

Most actively developed is by this guy, phhusson, who posted an article (https://www.xda-developers.com/the-importance-of-open-source-in-root/) about it in 2015. Then started this (still active) thread (https://forum.xda-developers.com/android/software-hacking/wip-selinux-capable-superuser-t3216394/page246)
Here's the repo:
https://github.com/phhusson/super-bootimg

Here's another
https://github.com/android-rooting-tools

Both of these are still under heavy development.