Repository navigation
[release/v7.7.0] Add warning for SHA-1 File Catalog - #28358
Merged
Justin Chung (jshigetomi) merged 1 commit intoNov 5, 2026
Merged
Justin Chung (jshigetomi) merged 1 commit into
Justin Chung (jshigetomi) merged 1 commit into
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
SHA-1 file catalog (#27805)
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The warning text inaccurately describes version 1 catalogs, and tests lack assertions that catalog creation and validation warn for version 1 but remain silent for version 2.
2 open issues
What changed in this PR
Adds an advisory warning to PowerShell’s file catalog commands when generating or validating version 1 catalogs that use SHA-1.
Changes:
- Introduces a shared warning helper for catalog generation and validation.
- Adds warning text recommending regeneration with
-CatalogVersion 2.
| File | Description |
|---|---|
src/System.Management.Automation/security/CatalogHelper.cs |
Emits the legacy-catalog warning during generation and validation. |
src/System.Management.Automation/resources/CatalogStrings.resx |
Adds the warning message and regeneration guidance. |
Review effort: Balanced
| <value>Catalog version is not valid. We only support catalog version {0} and version {1}.</value> | ||
| </data> | ||
| <data name="WeakCatalogHashAlgorithm" xml:space="preserve"> | ||
| <value>'{0}' is a version catalog that uses SHA0 or SHA1. Consider regenerating this catalog with '-CatalogVersion 2'.</value> |
Comment on lines
+157
to
+159
| if (catalogVersion < 2) | ||
| { | ||
| _cmdlet.WriteWarning(StringUtil.Format(CatalogStrings.WeakCatalogHashAlgorithm, catalogFilePath)); |
Justin Chung (jshigetomi)
enabled auto-merge (squash)
November 5, 2026 19:56
Dongbo Wang (daxian-dbw)
approved these changes
Nov 5, 2026
Dongbo Wang (daxian-dbw)
left a comment
Member
There was a problem hiding this comment.
Copilot CLI reviewed this backport and confirmed that its changes match the original PR, #27805, as merged into master.
Justin Chung (jshigetomi)
merged commit Nov 5, 2026
318a65c
into
release/v7.7.0
37 of 38 checks passed
Dongbo Wang (daxian-dbw)
deleted the
backport/release/v7.7.0/27805-097b42e9b
branch
November 5, 2026 23:09
3 of 9 tasks
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.

Backport of #27805 to release/v7.7.0
Triggered by Justin Chung (@jshigetomi) on behalf of Anam Navied (@anamnavi)
Original CL Label: CL-General
/cc @PowerShell/powershell-maintainers
Impact
Customer Impact
Warns when generating or validating legacy SHA-1 file catalogs and recommends regenerating with -CatalogVersion 2. Catalog generation and validation remain supported for compatibility; hashing and validation behavior are unchanged.
Regression
This is not a regression.
Testing
No tests were added in the original diff. The backport cherry-picked without conflicts and the working tree is clean. Local tests were not run; backport CI must pass before merge.
Risk
Security-related catalog handling. The change is limited to advisory warnings when legacy catalog versions are used; hashing and validation logic are unchanged.