Repository navigation
Validate updatable-help CAB extraction and limit module names to 128 characters - #28203
Merged
Merged
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Travis Plunk (TravisEz13)
marked this pull request as ready for review
October 14, 2026 21:04
Travis Plunk (TravisEz13)
requested review from
a team,
Aditya Patwardhan (adityapatwardhan) and
Dongbo Wang (daxian-dbw)
as code owners
October 14, 2026 21:04
Travis Plunk (TravisEz13)
approved these changes
Oct 14, 2026
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Native extraction failure contracts lack regression coverage sufficient to establish safe behavior.
2 open findings
What changed in this PR
This PR hardens PowerShell’s updatable-help extraction and limits module names used in generated help paths.
Changes:
- Adds CAB path checks and improves native callback failure handling.
- Enforces a 128-character module-name limit with a dedicated error message.
| File | Description |
|---|---|
| src/System.Management.Automation/resources/HelpDisplayStrings.resx | Adds the oversized module-name error message. |
| src/System.Management.Automation/help/UpdatableHelpModuleInfo.cs | Defines the module-name length limit. |
| src/System.Management.Automation/help/UpdatableHelpCommandBase.cs | Enforces the limit during module selection. |
| src/System.Management.Automation/help/CabinetNativeApi.cs | Strengthens extraction validation and failure handling. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+486
to
+488
| if (closeResult != 0) | ||
| { | ||
| return IntPtr.Zero; |
| return; | ||
| } | ||
|
|
||
| if (module.Name.Length > UpdatableHelpModuleInfo.MaxModuleNameLength) |
Justin Chung (jshigetomi)
enabled auto-merge (squash)
October 14, 2026 21:43
12 tasks
Aditya Patwardhan (adityapatwardhan)
approved these changes
Oct 16, 2026
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.

PR Summary
This pull request introduces several important improvements to the handling of CAB extraction and module name validation in PowerShell's updatable help system. The main changes focus on strengthening error handling during file operations, improving path validation to prevent security issues, and enforcing limits on module name lengths to avoid filesystem problems.
PR Context
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright header