fix: prevent silent abort of webhook payload when a single repo validation fails#6360
Open
AftAb-25 wants to merge 1 commit intomindersec:mainfrom
Open
fix: prevent silent abort of webhook payload when a single repo validation fails#6360AftAb-25 wants to merge 1 commit intomindersec:mainfrom
AftAb-25 wants to merge 1 commit intomindersec:mainfrom
Conversation
0b41aa4 to
b58a74b
Compare
b58a74b to
2fca364
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR patches a massive loop abort vulnerability inside the GitHub App Webhook processor (processInstallationRepositoriesAppEvent) that was causing data starvation and ghost-access leaks.
When an
installation_repositoriespayload arrives from GitHub, it iterates through bothaddedReposandremovedReposto synchronize the installation. Previously, if any single repository failed the basic name or ID parsing validation (e.g. an empty name string), the function would instantly return anerror.This broke three major things:
addedReposbatch was completely dropped.event.GetRepositoriesRemoved(). Any repositories the user explicitly revoked access to in that same batch were ignored, causing Minder to inappropriate retain data access tracking indefinitely.Changes
return nil, erracross both the added and removed loops with a gracefulzerologwarning and acontinue.repo.GetID() != 0and safely surface errors rather than blinding panicking or injecting zero-values.Fixes #6359
Checklist