The vulnerability CVE-2026-106458 in Backstage's Bitbucket Server catalog provider allowed event-driven updates to ingest catalog locations from repositories that should have been excluded by the provider's configured filters. This occurred because the event processing path did not consistently apply the same filtering logic as the scheduled discovery process.
Upon analyzing the provided patch (commit 989db63b6f87c8fc04d440f296ad89e10c79b363), the core issue was identified in the BitbucketServerEntityProvider class, specifically within the methods responsible for handling incoming Bitbucket Server events and subsequently retrieving entity locations.
-
BitbucketServerEntityProvider.handleEvent: This function serves as the primary entry point for processing repo:push events. Before the patch, it would proceed to process an event and attempt to retrieve catalog entities without first verifying if the repository associated with the event matched the configured projectKey and repoSlug filters. This allowed an authenticated Bitbucket Server user to push to a filtered-out repository, triggering an event that Backstage would then process, leading to unintended catalog ingestion.
-
BitbucketServerEntityProvider.getLocationEntity: This function is called by handleEvent to fetch and parse catalog entities from the repository identified by the event. While handleEvent was the initial point of failure, getLocationEntity also lacked a comprehensive application of all repository filters, particularly for archived repositories. This meant that even if an event for an archived repository (which should be skipped) reached this stage, getLocationEntity would still attempt to process it. The patch introduces a new private helper method, matchesRepositoryFilters, and integrates calls to this method into both handleEvent and getLocationEntity. This ensures that all configured repository filters (project key, repository slug, and archived status) are consistently applied during event-driven updates, aligning their behavior with scheduled discovery and preventing the ingestion of untrusted catalog data.