Add limit to number of manifests (#2055)

Signed-off-by: AdamKorcz <adam@adalogics.com>
This commit is contained in:
AdamKorcz 2023-10-26 17:03:38 +01:00 committed by GitHub
parent 7fa331b544
commit 1d94c1afb7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -60,6 +60,10 @@ func GetPlatformImage(ref, platform string) (string, error) {
return "", fmt.Errorf("cannot get index manifest: %w", err)
}
if len(idxMft.Manifests) > 1000 {
return "", fmt.Errorf("platform image has too many manifests")
}
for _, manifest := range idxMft.Manifests {
if plat.OS == manifest.Platform.OS &&
plat.Architecture == manifest.Platform.Architecture {