Pewarta Proxy

📋 Server Request & Proxy Logs

Loading active proxy settings...
Developed by Khairul Adha (adhexa.id)
Mengambil log server...

⚙️ Pengaturan Proxy Target

Skip to content

Validate updatable-help CAB extraction and limit module names to 128 characters - #28203

Merged
Justin Chung (jshigetomi) merged 2 commits into
masterfrom
136251
Oct 16, 2026
Merged

Justin Chung (jshigetomi) merged 2 commits into
masterfrom
136251

Conversation

@jshigetomi

@jshigetomi Justin Chung (jshigetomi) commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

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

@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 Oct 14, 2026
@jshigetomi Justin Chung (jshigetomi) changed the title Improve error handling for cab extraction and limit module name to 128 characters Validate updatable-help CAB extraction and limit module names to 128 characters Oct 14, 2026
@TravisEz13
Travis Plunk (TravisEz13) marked this pull request as ready for review October 14, 2026 21:04
Copilot AI balanced review requested due to automatic review settings October 14, 2026 21:04

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.

🔵 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)
@jshigetomi
Justin Chung (jshigetomi) merged commit 873d2fa into master Oct 16, 2026
37 checks passed
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