Skip to content

Commit ac03e65

Browse files
Fix GitHub release assets URL validation (#35287) (#35290)
Backport #35287 by @alexblackie GitHub changed where the attachments on releases are stored, which means repo migrations with releases now fail because the redirect URLs don't match the base URL validation. We need to update the base URL check to check for the `release-assets` subdomain as well. Co-authored-by: Alex Blackie <[email protected]>
1 parent f3e6672 commit ac03e65

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

services/migrations/github.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,8 @@ func (g *GithubDownloaderV3) convertGithubRelease(ctx context.Context, rel *gith
354354

355355
// Prevent open redirect
356356
if !hasBaseURL(redirectURL, g.baseURL) &&
357-
!hasBaseURL(redirectURL, "https://objects.githubusercontent.com/") {
357+
!hasBaseURL(redirectURL, "https://objects.githubusercontent.com/") &&
358+
!hasBaseURL(redirectURL, "https://release-assets.githubusercontent.com/") {
358359
WarnAndNotice("Unexpected AssetURL for assetID[%d] in %s: %s", asset.GetID(), g, redirectURL)
359360

360361
return io.NopCloser(strings.NewReader(redirectURL)), nil

0 commit comments

Comments
 (0)