1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-15 03:12:41 +01:00
phorge-phorge/src/applications/policy/__tests__
epriestley faaaff0b6f 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.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D7721
2013-12-05 17:00:53 -08:00
..
PhabricatorPolicyAwareTestQuery.php Lock policy queries to their applications 2013-10-21 17:20:27 -07:00
PhabricatorPolicyDataTestCase.php Rename ACTION_ACCEPT into ACTION_ALLOW 2013-10-14 12:05:11 -07:00
PhabricatorPolicyTestCase.php Fix an error in the PolicyFilter algorithm 2013-12-05 17:00:53 -08:00
PhabricatorPolicyTestObject.php Make PhabricatorPolicyInterface require a getPHID() method 2013-10-14 14:35:47 -07:00