branch visibility queries do not consider visibility of stacked on branches

Bug #900431 reported by David Owen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Triaged
High
Unassigned

Bug Description

Report
======
I'm an indirect member of canonical-isd-hackers. When logged in to LP, going to https://code.launchpad.net/~canonical-isd-hackers/+activereviews gives me a "Not allowed here" page. If I log out and go back, I can see some of the active reviews (maybe not all, though).

Analysis
========

A private branch in a merge proposal was stacked on a different private branch which was not visible to ~dsowen. The query that returns merge proposals did not filter that proposal out because the queries don't check the transitive visibility status, only the proximate status.

Revision history for this message
Robert Collins (lifeless) wrote :

This almost certainly means we have a bug where the logged in query is returning a MP that the security adapters think you can't access. As its a public team, and our defense-in-depth precautions are working, this doesn't imply a security vulnerability.

Did you get an OOPS id on the page?

security vulnerability: yes → no
visibility: private → public
Changed in launchpad:
status: New → Incomplete
Revision history for this message
David Owen (dsowen) wrote :

No OOPS. Here's a screenshot.

Revision history for this message
Curtis Hovey (sinzui) wrote :

I am not sure if this is about a private branch or a private team. The purple squad has a tasks to ensure private teams work with branches. If issue is about private teams, it might be fixed indirectly. I am adding the disclosure tag to track this issue.

tags: added: 403 branches privacy
tags: added: disclosure
Revision history for this message
William Grant (wgrant) wrote :

OOPS-38b7c8c2b9576ab5692e2c6adfbc8f37

Revision history for this message
William Grant (wgrant) wrote :

+activereviews was failing to show a merge proposal for lp:~michael.nelson/software-center-agent/scaclient-add-distroseries-filter into lp:~canonical-isd-hackers/software-center-agent/scaclient. ~canonical-isd-hackers is subscribed to the proposed branch, owns the target branch, and has a requested review on the merge proposal.

The problem is that noodles' branch is stacked on lp:software-center-agent, which used to be lp:~canonical-isd-hackers/software-center-agent/trunk, but was recently moved to lp:~canonical-ca-hackers/software-center-agent/trunk -- its owner was changed. Access transitivity over stacking results in ~canonical-isd-hackers not being able to see the source branch, nor the MP.

To fix the immediate +activereviews issue, subscribe ~canoncial-isd-hackers to lp:software-center-agent. If ISD shouldn't have access any more, the project's branch visibility policies will need tweaking to point at ~canonical-ca-hackers instead.

The bug here is that the visibility checks in LP's branch queries don't include the transitive stacking check. WITH RECURSIVE ftw?

Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 900431] Re: ~<team>/+activereviews forbidden to team member, allowed to public

On Tue, Dec 6, 2011 at 2:07 PM, William Grant <email address hidden> wrote:
> +activereviews was failing to show a merge proposal for
> lp:~michael.nelson/software-center-agent/scaclient-add-distroseries-
> filter into lp:~canonical-isd-hackers/software-center-agent/scaclient.
> ~canonical-isd-hackers is subscribed to the proposed branch, owns the
> target branch, and has a requested review on the merge proposal.
>
> The problem is that noodles' branch is stacked on lp:software-center-
> agent, which used to be lp:~canonical-isd-hackers/software-center-
> agent/trunk, but was recently moved to lp:~canonical-ca-hackers
> /software-center-agent/trunk -- its owner was changed. Access
> transitivity over stacking results in ~canonical-isd-hackers not being
> able to see the source branch, nor the MP.
>
> To fix the immediate +activereviews issue, subscribe ~canoncial-isd-
> hackers to lp:software-center-agent. If ISD shouldn't have access any
> more, the project's branch visibility policies will need tweaking to
> point at ~canonical-ca-hackers instead.
>
> The bug here is that the visibility checks in LP's branch queries don't
> include the transitive stacking check. WITH RECURSIVE ftw?

I thought rvba recently overhauled this?

-Rob

Revision history for this message
Julian Edwards (julian-edwards) wrote : Re: ~<team>/+activereviews forbidden to team member, allowed to public

Please remember to remove the security contact when you mark a bug no longer security-related.

Gavin Panella (allenap)
Changed in launchpad:
status: Incomplete → Triaged
importance: Undecided → Critical
Revision history for this message
Raphaël Badin (rvb) wrote :

What I've done recently on this page (+activrevreviews) is preload things to avoid repeated sql queries… looking at the oops, this bug is not related to those modifications.

Revision history for this message
Robert Collins (lifeless) wrote :

LP is meant to remove the security contact subscription automatically :(

Curtis Hovey (sinzui)
Changed in launchpad:
importance: Critical → High
Revision history for this message
Robert Collins (lifeless) wrote :

"The bug here is that the visibility checks in LP's branch queries don't include the transitive stacking check. WITH RECURSIVE ftw?"
This highlights a defect in the denormalisation of is_private: we actually have to scan and include access to all the stacked on branches; just permitting access based on the top level one is insufficient.

This suggests we may which to undo the denormalisation of is_private : but that can be left up to whomever works on this bug.

summary: - ~<team>/+activereviews forbidden to team member, allowed to public
+ branch visibility queries do not consider visibility of stacked-on
+ branches
summary: - branch visibility queries do not consider visibility of stacked-on
+ branch visibility queries do not consider visibility of stacked on
branches
description: updated
Curtis Hovey (sinzui)
tags: added: sharing
Curtis Hovey (sinzui)
tags: removed: disclosure
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.