Package: release.debian.org
Severity: normal
Tags: trixie
X-Debbugs-Cc: [email protected]
Control: affects -1 + src:debci
User: [email protected]
Usertags: pu

[ Reason ]
This update fixes an information leak vulnerability. By enumerating
sequential ids, an attacker can obtain information about the existence
of embargoed updates. ci.debian.net is already fixed, and debci 4.5 has
been uploaded to unstable including the fix. All debci instances that I
know were notified in private but weren't using private jobs. The
security team doesn't think this is relevant enough for a DSA, thus I
want to fix this in a regular stable update.

[ Impact ]
debci instances using private jobs could have information about them
leaked by using the retry page URL with sequential job ids. The attacker
needs to be logged in to the instance with a valid user account.

[ Tests ]
The patch fixing the vulnerability includes automated tests, which fail
if I revert the fixes, and pass during the build and under autopkgtest.

[ Risks ]
The fix is pretty straightforward and I see no relevant risks.

[ Checklist ]
  [x] *all* changes are documented in the d/changelog
  [x] I reviewed all changes and I approve them
  [x] attach debdiff against the package in (old)stable
  [x] the issue is verified as fixed in unstable

[ Changes ]
The retry endpoints have been modified to only allow the owner of
private jobs to both see the retry page and request retries.

[ Other info ]
As this is a targetted fix that consists only of a patch cherry-picked
from the master branch, I have already uploaded it.
diff --git c/debian/changelog w/debian/changelog
index 4c18b4f1..dde266ad 100644
--- c/debian/changelog
+++ w/debian/changelog
@@ -1,3 +1,9 @@
+debci (3.12+deb13u1) trixie; urgency=medium
+
+  * self_service: deny access to private jobs owned by others
+
+ -- Antonio Terceiro <[email protected]>  Wed, 25 Nov 2026 18:18:23 -0300
+
 debci (3.12) unstable; urgency=medium
 
   * debian/changelog: fix typo found by codespell
diff --git c/lib/debci/job.rb w/lib/debci/job.rb
index 6a41d603..e83934ad 100644
--- c/lib/debci/job.rb
+++ w/lib/debci/job.rb
@@ -373,6 +373,14 @@ module Debci
       !always_failing?
     end
 
+    def public?
+      !is_private?
+    end
+
+    def accessible_to?(user)
+      public? || user.id == requestor.id
+    end
+
   end
 end
 
diff --git c/lib/debci/self_service.rb w/lib/debci/self_service.rb
index 76b1b036..80763643 100644
--- c/lib/debci/self_service.rb
+++ w/lib/debci/self_service.rb
@@ -141,8 +141,12 @@ module Debci
         run_id = params[:run_id]
         redirect "user/#{@user.username}/retry/#{run_id}" if params[:user] == ":user"
         @original_job = get_job_to_retry(run_id)
-        @same_jobs = get_same_pending_jobs(@original_job).count
-        erb :retry
+        if @original_job.accessible_to?(@user)
+          @same_jobs = get_same_pending_jobs(@original_job).count
+          erb :retry
+        else
+          [403, erb(:forbidden)]
+        end
       else
         [403, erb(:cant_retry)]
       end
@@ -151,8 +155,12 @@ module Debci
     post '/:user/retry/:run_id' do
       run_id = params[:run_id]
       j = get_job_to_retry(run_id)
-      j.retry
-      201
+      if j.accessible_to?(@user)
+        j.retry
+        201
+      else
+        403
+      end
     end
 
     get '/:user/getkey' do
diff --git c/spec/debci/self_service_spec.rb w/spec/debci/self_service_spec.rb
index 0655e5fd..51d1b374 100644
--- c/spec/debci/self_service_spec.rb
+++ w/spec/debci/self_service_spec.rb
@@ -527,6 +527,49 @@ describe Debci::SelfService do
         expect(last_response.status).to eq(200)
         expect(last_response.content_type).to match('text/html')
       end
+
+      it 'displays public jobs by someone else' do
+        package = Debci::Package.create!(name: 'mypackage')
+        requestor = Debci::User.create!(username: '[email protected]')
+        trigger = 'mypackage/0.0.1'
+        pin_packages = ['src:mypackage', 'unstable']
+        extra_apt_sources = ['bullseye-fasttrack']
+        job = Debci::Job.create(
+          package: package,
+          suite: suite,
+          arch: arch,
+          requestor: requestor,
+          trigger: trigger,
+          pin_packages: pin_packages,
+          is_private: false,
+          extra_apt_sources: extra_apt_sources
+        )
+        get "/user/[email protected]/retry/#{job.id}"
+        expect(last_response.status).to eq(200)
+        expect(last_response.body).to match(trigger)
+      end
+
+      it 'denies access to private jobs by someone else' do
+        package = Debci::Package.create!(name: 'mypackage')
+        requestor = Debci::User.create!(username: '[email protected]')
+        trigger = 'mypackage/0.0.1'
+        pin_packages = ['src:mypackage', 'unstable']
+        extra_apt_sources = ['bullseye-fasttrack']
+        job = Debci::Job.create(
+          package: package,
+          suite: suite,
+          arch: arch,
+          requestor: requestor,
+          trigger: trigger,
+          pin_packages: pin_packages,
+          is_private: true,
+          extra_apt_sources: extra_apt_sources
+        )
+        get "/user/[email protected]/retry/#{job.id}"
+        expect(last_response.status).to eq(403)
+        expect(last_response.body).to_not match(trigger)
+      end
+
       it 'can retrigger a valid request with key' do
         package = Debci::Package.create!(name: 'mypackage')
         user = Debci::User.find_by(username: '[email protected]')
@@ -622,6 +665,27 @@ describe Debci::SelfService do
 
         expect(last_response.status).to eq(403)
       end
+
+      it 'denies retrying private jobs by someone else' do
+        package = Debci::Package.create!(name: 'mypackage')
+        requestor = Debci::User.create!(username: '[email protected]')
+        trigger = 'mypackage/0.0.1'
+        pin_packages = ['src:mypackage', 'unstable']
+        extra_apt_sources = ['bullseye-fasttrack']
+        job = Debci::Job.create(
+          package: package,
+          suite: suite,
+          arch: arch,
+          requestor: requestor,
+          trigger: trigger,
+          pin_packages: pin_packages,
+          is_private: true,
+          extra_apt_sources: extra_apt_sources
+        )
+
+        post "/user/[email protected]/retry/#{job.run_id}"
+        expect(last_response.status).to eq(403)
+      end
     end
   end
 

Attachment: signature.asc
Description: PGP signature

Reply via email to