Intel

AIKIDO-2026-194332

Microsoft.PowerShell.Commands.Diagnostics is vulnerable to Denial of service

Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.
Published Oct 16, 2026
October 16, 2026

25

CVE Score

Low

Denial of service

Are you affected? Scan for Free

TL;DR

When Get-Counter is run without -Counter, it localizes its built-in default counter paths through PdhHelper.TranslateLocalCounterPath, which calls LookupPerfNameByIndex. If PdhLookupPerfNameByIndex returns PDH_MORE_DATA, that method frees the native buffer with Marshal.FreeHGlobal and allocates a larger one with Marshal.AllocHGlobal. If that allocation throws, the finally block frees the stale pointer again and can crash the process. The fix assigns IntPtr.Zero to localizedPathPtr after the first free so a failed reallocation is not freed twice.

How do I fix this?

Upgrade the Microsoft.PowerShell.Commands.Diagnostics library to the patch version.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and you run Get-Counter without -Counter on Windows, which localizes the built-in default counter paths through PdhHelper.LookupPerfNameByIndex.

Versions

6.0.4 - 7.4.19

Fixed in 7.4.20

7.5.0 - 7.5.10

Fixed in 7.5.11

7.6.0 - 7.6.5

Fixed in 7.6.6

Background info

Microsoft.PowerShell.Commands.Diagnostics is vulnerable to Denial of service in versions 6.0.4 - 7.4.19, 7.5.0 - 7.5.10 and 7.6.0 - 7.6.5.

Get secure today,
quickly and for free.

Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.

No credit card required | Scan results in 32 seconds.

Trusted by 150k+ orgs
  • Revolut
  • n8n
  • Lovable
  • Deel
  • Prove
  • Omnea