Page MenuHomePhabricator

In Git, always "sudo" to the daemon user if a daemon user is configured
ClosedPublic

Authored by epriestley on Apr 13 2022, 6:23 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Mar 26, 3:47 AM
Unknown Object (File)
Sun, Mar 24, 1:27 PM
Unknown Object (File)
Sun, Mar 24, 3:43 AM
Unknown Object (File)
Thu, Mar 14, 5:53 PM
Unknown Object (File)
Sun, Mar 10, 10:09 AM
Unknown Object (File)
Sun, Mar 10, 10:08 AM
Unknown Object (File)
Tue, Mar 5, 3:35 AM
Unknown Object (File)
Feb 11 2024, 3:17 PM
Subscribers
None

Details

Summary

See T13673. Recent versions of Git (and older versions with backported security patches) now refuse to run Git commands if the top-level repository directory is not owned by the user running the command.

Currently, we "sudo" to that user only when performing writes, so upgrading Git can aggressively break a Phabricator system by knocking out essentially all Diffusion/Conduit read pathways.

As an immediate mitigation, just "sudo" in all cases where a daemon user is available. This fixes the problem, and seems like the least-bad approach. The downside is that the web user may theoretically have fewer privileges than the daemon user and this could reduce the number of layers an attacker armed with some other Git vulnerability might have to get through to do something dangerous (e.g., perform a write on a pathway where only reads are expected), but any separation between the web and daemon accounts is essentially theoretical and has never been enforced.

Test Plan

Applied patch to impacted Phacility shard, saw Diffusion work properly again.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable