Skip to content

Commit e0b5a39

Browse files
committed
security: Fix ancestry validation to fail safely
- Return false instead of true when ancestry validation fails - Change warning to error message for clarity - Prevents potentially incorrect updates when validation is uncertain - Follows fail-safe principle for security-critical operations
1 parent 0cea893 commit e0b5a39

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

updater/scripts/cmake-functions.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ function Test-HashAncestry($repo, $oldHash, $newHash) {
8383
}
8484
}
8585
catch {
86-
Write-Host "Warning: Could not validate ancestry for $oldHash -> $newHash : $_"
87-
# When in doubt, allow the update (safer for automation)
88-
return $true
86+
Write-Host "Error: Could not validate ancestry for $oldHash -> $newHash : $_"
87+
# When in doubt, fail safely to prevent incorrect updates
88+
return $false
8989
}
9090
}
9191

0 commit comments

Comments
 (0)