Page MenuHomePhabricator

Fix an error in the PolicyFilter algorithm
ClosedPublic

Authored by epriestley on Dec 5 2013, 10:59 PM.
Tags
None
Referenced Files
F14066796: D7721.diff
Tue, Nov 19, 11:54 AM
F14043848: D7721.diff
Tue, Nov 12, 1:24 PM
F14004880: D7721.id.diff
Sun, Oct 27, 4:21 AM
F14000138: D7721.diff
Thu, Oct 24, 7:29 PM
Unknown Object (File)
Sep 23 2024, 12:07 AM
Unknown Object (File)
Sep 4 2024, 7:20 AM
Unknown Object (File)
Aug 25 2024, 8:31 AM
Unknown Object (File)
Aug 17 2024, 1:02 AM
Subscribers
Tokens
"Grey Medal" token, awarded by btrahan.

Details

Reviewers
btrahan
Commits
Restricted Diffusion Commit
rPfaaaff0b6f60: Fix an error in the PolicyFilter algorithm
Summary

PhabricatorPolicyFilter has a bug right now where it lets through objects incorrectly if:

  • the query requests two or more policies;
  • the object satisfies at least one of those policies; and
  • policy exceptions are not enabled.

This would be bad, but there's only one call in the codebase which satisfies all of these conditions, in the Maniphest batch editor. And it's moot anyway because edit operations get another policy check slightly later. So there is no policy/security impact from this flaw.

(The next diff relies on this behavior, which is how I caught it.)

Test Plan
  • Added a failing unit test and made it pass.
  • Grepped the codebase for requireCapabilities() and verified that there is no security impact. Basically, 99% of callsites use executeOne(), which throws anyway and moots the filtering.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped