wp-cli/wp-cli — pull request #973 by SpikesDivZero (2014-01-21 06:23:58+00:00)
Title: Don't allow wp-cli as root without --allow_root

I work for a hosting company, and we deploy wp-cli on our hosting machines. On some of our machines, we've observed customers accidentally(?) running wp-cli as root. It goes without saying, this is never ideal, and given what I've seen in the support histories, I'm not sure customers always understand just what root is capable of, and how dangerous it can be to run it as root.

We've been discussing doing this as a plug-in in our internal deployments, but this seems like something that would be nearly universally useful as a safety precaution for all wp-cli users.

The key fear we're hoping to address with this is just what will happen if wp-cli is run against a hacked site.

Seeing as this is a public forum, I'm hesitant to provide further details on a hypothetical attack vector here. If you'd like specifics, scribu, send me a message on freenode (wspikes or wspikes1) and I'll be happy to elaborate more there.

**NOTE:** My offer for an exploit vector applies **only** to scribu. I will not send potential exploit details to anyone else at this time.