Extended policy checks are buggy
A variable mix-up in Phabricator's policy filter code causes extended policy checks to be skipped for some objects after one object is filtered out. The reporter is unsure whether this has practical consequences, but suggests it could affect differential revisions if a repository fails to load.
- Fixed in 3 hours
- Paid in 3 hours
- Disclosed after 3 hours
Mongoose. This issue is in the class PhabricatorPolicyFilter, lines 324, 338 and 339. The code refers to the index $key (a leftover from a previous foreach loop) where it should refer to $extended_key.
This will lead to all policy checks being skipped after $extended_objects[$key] is filtered out. I'm not sure if this has any consequences in practice, since the extended policy interface seems to have a limited use. Maybe it would be more serious having subprojects?
I can imagine a risk for the differential revisions: if any of the repositories failed to load (no idea if that can happen), the bugs in lines 338 and 339 would filter out the revision at $extended_objects[$key], and all the other revisions would then skip the checks.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The code uses the loop variable $key from a previous loop instead of the current $extended_key, so the wrong array element is checked and subsequent checks are skipped.
Impact
Policy checks may be skipped for some objects, but the reporter is unsure whether this has any real consequences and notes the extended policy interface has limited use.
What the attacker needed
Extended policy interface in use; an object filtered out before others
The fix
The code should use $extended_key instead of $key in the affected lines.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
This is a bug in how a program checks permissions. The code uses the wrong variable name, so after it removes one item from a list, it stops checking the remaining items. The reporter is not sure it can actually be exploited.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.