Skip to main content
Vulnerability Database/CVE-2025-54363

CVE-2025-54363: Microsoft Knack ReDoS DOS Vulnerability

CVE-2025-54363 is a Regular expression Denial of Service flaw in Microsoft Knack 0.12.0 that allows attackers to trigger excessive CPU consumption through crafted docstrings. This article covers technical details, impact analysis, and mitigation strategies.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2025-54363 Overview

CVE-2025-54363 is a Regular Expression Denial of Service (ReDoS) vulnerability in Microsoft Knack version 0.12.0, a Python command-line framework used by Azure CLI. The flaw resides in the knack.introspection module, specifically within the extract_full_summary_from_signature function. The function uses an inefficient regular expression pattern that is susceptible to catastrophic backtracking. An attacker who can control or inject docstring content into affected applications can trigger excessive CPU consumption. The vulnerability is tracked under CWE-1333: Inefficient Regular Expression Complexity.

Critical Impact

Attackers who control docstring input to applications built on Knack can trigger sustained CPU exhaustion, degrading or halting availability of Azure CLI and other Knack-based tooling.

Affected Products

  • Microsoft Knack Python package version 0.12.0
  • Azure CLI (depends on the Knack framework)
  • Any downstream Python application built on top of the Knack framework

Discovery Timeline

  • 2025-08-20 - CVE-2025-54363 published to NVD
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2025-54363

Vulnerability Analysis

The Knack framework parses command and parameter documentation by scanning Python docstrings. The extract_full_summary_from_signature function in the knack.introspection module applies the regular expression \s(:param)\s+(.+?)\s:(.*) to extract parameter descriptions. This pattern contains overlapping quantifiers that match whitespace characters in multiple ways. When the regex engine encounters a crafted docstring with large runs of whitespace and no terminating colon, it must explore every possible combination of matches before failing. This behavior is known as catastrophic backtracking.

The result is CPU time that grows super-linearly with input length. A relatively small docstring can tie up a single CPU core for seconds or minutes. Because Azure CLI and other Knack-based tools execute this parsing path during command introspection, any workflow that loads attacker-controlled docstring content becomes a denial of service primitive.

Root Cause

The root cause is an inefficient regular expression pattern combined with the absence of input length limits or execution timeouts around the regex evaluation. The \s+ quantifier adjacent to .+? and additional \s tokens creates ambiguous match paths that the Python re engine explores exhaustively on failure.

Attack Vector

Exploitation requires an attacker to influence docstring content processed by a Knack-based application. In the Azure CLI context, this typically means supplying a malicious extension, plugin, or module whose Python docstrings reach the introspection routine. Once loaded, invoking the parsing path triggers catastrophic backtracking and exhausts the CPU of the host process. The attack vector is local, and successful exploitation impacts availability only; confidentiality and integrity are not affected.

See the VulnCheck Advisory for Knack and GitHub Issue #281 for additional technical context.

Detection Methods for CVE-2025-54363

Indicators of Compromise

  • Python processes running Azure CLI or Knack-based tools consuming 100% of a CPU core for extended periods without producing output.
  • Command invocations that hang during help text rendering, command discovery, or parameter introspection.
  • Presence of unexpected Python packages or Azure CLI extensions containing abnormally large or malformed :param docstring blocks.

Detection Strategies

  • Inventory Python environments for the knack package and flag any installation at version 0.12.0 or earlier.
  • Audit third-party Azure CLI extensions and Python modules for docstrings containing long whitespace sequences within :param directives.
  • Monitor command execution telemetry for Knack-based tools exceeding baseline CPU time or wall-clock duration.

Monitoring Recommendations

  • Collect process-level CPU and runtime metrics for az and other Knack-based binaries, alerting on anomalous resource consumption.
  • Capture package installation events in developer, CI/CD, and shared administrator environments to detect introduction of untrusted extensions.
  • Correlate hung CLI processes with recent extension or dependency changes using endpoint telemetry.

How to Mitigate CVE-2025-54363

Immediate Actions Required

  • Upgrade the knack package to a patched release above 0.12.0 once published by Microsoft. Track the fix status via the GitHub Knack Project.
  • Remove or disable untrusted Azure CLI extensions and third-party Python modules that feed docstrings into Knack-based tools.
  • Restrict installation privileges for Azure CLI extensions on shared administrator workstations and build agents.

Patch Information

Microsoft maintains the Knack project on GitHub. Review the GitHub Issue #281 tracker and the project release notes for the fixed version. Rebuild container images and refresh virtual environments after upgrading to ensure the vulnerable version is not retained in cached layers.

Workarounds

  • Pin Azure CLI and dependent tooling to use only vetted, first-party extensions until a patched Knack release is deployed.
  • Enforce process-level CPU time limits (for example, with ulimit -t) around automated Azure CLI invocations to bound the impact of catastrophic backtracking.
  • Run Knack-based automation in isolated containers with constrained CPU shares so a hung parser cannot degrade neighboring workloads.
bash
# Example: cap CPU time for Azure CLI invocations in automation
ulimit -t 30
az --help

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.