Skip to content

[release/v7.7.0] Add warning for SHA-1 File Catalog - #28358

Merged
Justin Chung (jshigetomi) merged 1 commit into
release/v7.7.0from
backport/release/v7.7.0/27805-097b42e9b
Nov 5, 2026
Merged

Justin Chung (jshigetomi) merged 1 commit into
release/v7.7.0from
backport/release/v7.7.0/27805-097b42e9b

Conversation

@jshigetomi

@jshigetomi Justin Chung (jshigetomi) commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

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

  • Customer reported
  • Found internally

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

  • Yes
  • No

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

  • High
  • Medium
  • Low

Security-related catalog handling. The change is limited to advisory warnings when legacy catalog versions are used; hashing and validation logic are unchanged.

@jshigetomi
Justin Chung (jshigetomi) requested a review from a team as a code owner November 5, 2026 19:08
Copilot AI balanced review requested due to automatic review settings November 5, 2026 19:08
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@jshigetomi Justin Chung (jshigetomi) added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Nov 5, 2026
@jshigetomi Justin Chung (jshigetomi) changed the title Add warning for SHA-1 file catalog (#27805) [release/v7.7.0] Add warning for SHA-1 File Catalog Nov 5, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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));

@daxian-dbw Dongbo Wang (daxian-dbw) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot CLI reviewed this backport and confirmed that its changes match the original PR, #27805, as merged into master.

@jshigetomi
Justin Chung (jshigetomi) merged commit 318a65c into release/v7.7.0 Nov 5, 2026
37 of 38 checks passed
@daxian-dbw
Dongbo Wang (daxian-dbw) deleted the backport/release/v7.7.0/27805-097b42e9b branch November 5, 2026 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants