Description
Kiota is an OpenAPI based HTTP Client code generator. Prior to 1.29.1 and 1.32.0, Kiota's Ruby generator embedded OpenAPI default fields, property names, and other schema-derived strings through CodeMethodWriter.cs and SanitizeForQuotedLiteral() in Writers/StringExtensions.cs into Ruby double-quoted literals without escaping #, allowing attacker-controlled #{expr}, #$var, or #@var interpolation markers to inject arbitrary Ruby code into generated model classes. This issue is fixed in version 1.29.1 and 1.32.0.
Published: 2026-07-16
Score: 7.5 High
EPSS: 2.0% Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

Kiota’s Ruby code generator embeds OpenAPI default fields, property names, and other schema‑derived strings through CodeMethodWriter.cs and SanitizeForQuotedLiteral() into Ruby double‑quoted literals without escaping the # character. This allows attacker‑controlled interpolation markers such as #{…}, #$var, or #@var to be inserted by a malicious OpenAPI document. When the generated Ruby source file is loaded, the Ruby interpreter evaluates these markers, leading to arbitrary Ruby code execution under the privileges of the consuming application. This constitutes a code‑injection vulnerability (CWE‑94).

Affected Systems

Microsoft Kiota, the open‑source OpenAPI‑based HTTP client generator, is affected for all versions prior to 1.32.0. The flaw exists in the Ruby code generator; other language generators are not implicated in the CVE. Any installation that has produced Ruby client classes from an untrusted OpenAPI document before the 1.32.0 release is vulnerable.

Risk and Exploitability

The CVSS score of 7.5 indicates a high‑severity vulnerability. The EPSS score of 1 % implies that, at present, the likelihood of the vulnerability being actively exploited is low, and it is not listed in the CISA KEV catalogue. The attack requires the ability to influence or supply the OpenAPI specification that Kiota uses during generation. Once a malicious document is processed, the resulting Ruby source file contains interpolated expressions that will run when the file is loaded or required by a Ruby application. Therefore, an attacker who can get the generated code to execute in a target environment can achieve arbitrary code execution in that environment.

Generated by OpenCVE AI on August 17, 2026 at 20:25 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade Kiota to version 1.32.0 or later
  • Only use trusted OpenAPI specifications when generating Ruby client code
  • If an upgrade cannot be performed immediately, manually review and remove any interpolation syntax from the generated Ruby files before deploying them

Generated by OpenCVE AI on August 17, 2026 at 20:25 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-xg2h-5xr2-29jw Microsoft Kiota: Code Generation Literal Injection in Kiota Ruby Generator
History

Mon, 17 Aug 2026 15:15:00 +0000

Type Values Removed Values Added
Description Kiota is an OpenAPI based HTTP Client code generator. Prior to 1.32.0, Kiota's Ruby generator embedded OpenAPI default fields, property names, and other schema-derived strings through CodeMethodWriter.cs and SanitizeForQuotedLiteral() in Writers/StringExtensions.cs into Ruby double-quoted literals without escaping #, allowing attacker-controlled #{expr}, #$var, or #@var interpolation markers to inject arbitrary Ruby code into generated model classes. This issue is fixed in version 1.32.0. Kiota is an OpenAPI based HTTP Client code generator. Prior to 1.29.1 and 1.32.0, Kiota's Ruby generator embedded OpenAPI default fields, property names, and other schema-derived strings through CodeMethodWriter.cs and SanitizeForQuotedLiteral() in Writers/StringExtensions.cs into Ruby double-quoted literals without escaping #, allowing attacker-controlled #{expr}, #$var, or #@var interpolation markers to inject arbitrary Ruby code into generated model classes. This issue is fixed in version 1.29.1 and 1.32.0.

Wed, 29 Jul 2026 20:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Thu, 16 Jul 2026 16:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Thu, 16 Jul 2026 15:45:00 +0000

Type Values Removed Values Added
First Time appeared Microsoft
Microsoft kiota
Vendors & Products Microsoft
Microsoft kiota

Thu, 16 Jul 2026 14:45:00 +0000

Type Values Removed Values Added
Description Kiota is an OpenAPI based HTTP Client code generator. Prior to 1.32.0, Kiota's Ruby generator embedded OpenAPI default fields, property names, and other schema-derived strings through CodeMethodWriter.cs and SanitizeForQuotedLiteral() in Writers/StringExtensions.cs into Ruby double-quoted literals without escaping #, allowing attacker-controlled #{expr}, #$var, or #@var interpolation markers to inject arbitrary Ruby code into generated model classes. This issue is fixed in version 1.32.0.
Title Kiota: Code Generation Literal Injection in Kiota Ruby Generator
Weaknesses CWE-94
References
Metrics cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H'}


cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-08-17T15:02:02.208Z

Reserved: 2026-07-07T15:41:53.606Z

Link: CVE-2026-59861

cve-icon Vulnrichment

Updated: 2026-07-16T15:19:20.813Z

cve-icon NVD

Status : Deferred

Published: 2026-07-16T15:16:35.440

Modified: 2026-08-17T15:16:56.520

Link: CVE-2026-59861

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-17T20:30:17Z

Weaknesses
  • CWE-94

    Improper Control of Generation of Code ('Code Injection')