Signed changes upload replay attack vulnerability

Bug #159304 reported by StefanPotyra
278
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
High
Julian Edwards

Bug Description

Hi,

we just discovered, that the packages page for PPAs (for example: <https://edge.launchpad.net/~siretart/+archive> )

has a link to changes files, which displays them unmodified (i.e. still signed), see
<http://launchpadlibrarian.net/9411509/devscripts_2.10.8ubuntu1%7Eppa1_source.changes> for example)

Since the distribution in the packages on PPA matches an ubuntu release and all files the source package consists of can be downloaded as well, anyone can basically upload that package to the real archive, if there is a newer version in the PPA than in the archive.

Hence, I'm marking this as a security vulnerability.

Cheers,
   Stefan.

Revision history for this message
James Henstridge (jamesh) wrote :

If Soyuz accepts the same signed build request twice sounds like a bug in and of itself (a replay attack vulnerability).

While that is the case, we definitely shouldn't be publishing links to the files.

Celso Providelo (cprov)
Changed in launchpad:
assignee: nobody → cprov
status: New → In Progress
Changed in soyuz:
importance: Undecided → Critical
milestone: none → 1.1.11
Revision history for this message
Celso Providelo (cprov) wrote :

Hi Stefan,

We could continue to present the changesfile link only for users with edit permissions in the PPA in question, this way correct "replays" could continue to be performed collaboratively inside team PPAs.

I don't feel strong about the utility of this use case, just want to check if we are heading toward the primary objective which is presenting as much useful information as we can without exposing vulnerabilities.

Revision history for this message
StefanPotyra (sistpoty) wrote : Re: [Bug 159304] Re: PPA pages shows changes files in edge

Hi Celso,

Am Montag, 12. November 2007 15:26 schrieb Celso Providelo:
> Hi Stefan,
>
> We could continue to present the changesfile link only for users with
> edit permissions in the PPA in question, this way correct "replays"
> could continue to be performed collaboratively inside team PPAs.

I guess that might lead to problems as well: If a team member can upload to
given PPA but not to universe for example, while another team member can,
this could still get abused (e.g. having a PPA set up where both MOTUs and
contributors can upload).

After a short discussion on #lp at Saturday evening, it looks like the real
solution would be to have soyuz not accept two identical changes files in a
row. That way the ticket functionality of changes files would be restored.
Since there is a date stamp in a signature, two identical uploads were still
ok (because the signature would then differ). Of course once a PPAs allow the
same distribution names as Debian (or a derivate) there could still arise
problems, but I guess that shouldn't happen in the first place anyways.

Thanks,
    Stefan.

Revision history for this message
Celso Providelo (cprov) wrote : Re: PPA pages shows changes files in edge

Ok, let's sort this with the simplest solution we have, a "damage-control" task. I will purge the changesfile reference from the UI for now.

Legit "replays" from PPA to ubuntu primary archive or to another PPA will be possible in the next milestone code via request w/o requiring a new upload. We will discuss further details with MOTU-team before release.

I think that the unique_changesfile suggestion is miss-conceptual, because it mixes distribution permissions with content uniqueness, but it requires further thinking.

Revision history for this message
Celso Providelo (cprov) wrote :

Let me correct myself, the "damage-control" task will consist of requiring Admin permission to view the changesfile link. I decided to do this because it will result in removing less code that might become necessary again in the future.

Revision history for this message
StefanPotyra (sistpoty) wrote : Re: [Bug 159304] Re: PPA pages shows changes files in edge

Hi Celso,

Am Freitag 16 November 2007 20:33:15 schrieb Celso Providelo:
> Ok, let's sort this with the simplest solution we have, a "damage-
> control" task. I will purge the changesfile reference from the UI for
> now.

Excellent, thanks a lot!

>
> Legit "replays" from PPA to ubuntu primary archive or to another PPA
> will be possible in the next milestone code via request w/o requiring a
> new upload. We will discuss further details with MOTU-team before
> release.

Great. I guess also core-devs might be interested in this ;).

>
> I think that the unique_changesfile suggestion is miss-conceptual,
> because it mixes distribution permissions with content uniqueness, but
> it requires further thinking.

Well, for a bit-identical source package, it's not necessary to have an
identical .changes-file. If I'd want to upload the same thing first to a PPA,
and then to the archive, I could easily sign the very same .changes file
again with debsign, which results in a different signature and an
content-wise unchanged .changes file.

Hope this helps you with thinking ;).

Cheers and thanks a lot,
    Stefan.

Revision history for this message
Celso Providelo (cprov) wrote : Re: PPA pages shows changes files in edge

RF 5200 hides the changesfile link, we will design a effective way to prevent replay-attacks during the next milestone.

Changed in soyuz:
importance: Critical → High
milestone: 1.1.11 → 1.1.12
Revision history for this message
James Henstridge (jamesh) wrote :

According to duplicate bug 177113, it is still quite easy to guess the URL to the changes file on the librarian even though we don't link to it.

Since all the files from the upload are stored in the librarian sequentially, they are likely to get consecutive IDs. As the filename is known, it doesn't take many guesses to find what the LibraryFileAlias ID is.

Revision history for this message
Julian Edwards (julian-edwards) wrote :

Re-targeting to 1.2.1 to complete the work.

Changed in soyuz:
milestone: 1.1.12 → 1.2.1
Changed in soyuz:
milestone: 1.2.1 → 1.2.2
Celso Providelo (cprov)
Changed in soyuz:
milestone: 1.2.2 → 1.2.5
Celso Providelo (cprov)
Changed in soyuz:
assignee: cprov → nobody
status: In Progress → Triaged
Changed in soyuz:
milestone: 1.2.5 → none
Revision history for this message
James Henstridge (jamesh) wrote :

Any news on this one? The problem came up in discussion on #launchpad again today, with someone asking whether other people could see the changes file links on his PPA page, and whether that would allow others to re-upload his packages to Ubuntu's main repository.

I guess https://blueprints.launchpad.net/soyuz/+spec/ssh-package-upload might mitigate the problem for Ubuntu developers, but might it still be a problem for users who also happen to be Debian developers?

Revision history for this message
Luca Falavigna (dktrkranz) wrote : Re: [Bug 159304] Re: Signed changes upload replay attack vulnerability

James Henstridge ha scritto:
> I guess https://blueprints.launchpad.net/soyuz/+spec/ssh-package-upload
> might mitigate the problem for Ubuntu developers, but might it still be
> a problem for users who also happen to be Debian developers?

I don't think this will harm Debian. We use different suites (e.g.
intrepid against unstable) and uploads for an unknown suite should be
rejected by dak.

Revision history for this message
StefanPotyra (sistpoty) wrote :

Hi,

almost one year later, I've had to discover that this security vulnerability is still not fixed, as I could easily guess the .changes file location of a PPA.

Please fix this within the next two weeks, otherwise I feel inclined to make this grave security bug public together with proof-of-concept methods how to exploit it.

Cheers,
   Stefan.

Joey Stanford (joey)
Changed in soyuz:
milestone: none → 2.1.8
Changed in soyuz:
status: Triaged → In Progress
assignee: nobody → julian-edwards
Revision history for this message
Julian Edwards (julian-edwards) wrote :

RF 6836

Changed in soyuz:
status: In Progress → Fix Committed
Revision history for this message
Julian Edwards (julian-edwards) wrote :

Changes files will no longer have signatures on them.

Changed in soyuz:
status: Fix Committed → Fix Released
Revision history for this message
Julian Edwards (julian-edwards) wrote :

The old changes files are still in the librarian, but they will be garbage collected in a day or two.

William Grant (wgrant)
visibility: private → public
To post a comment you must log in.
This report contains Public Security information  
Everyone can see this security related information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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