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.
Published: 2026-07-16
Score: 7.5 High
EPSS: 1.5% Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

Kiota’s Ruby generator embeds OpenAPI default fields, property names, and other schema‑derived strings directly into double‑quoted Ruby literals without escaping the characters that start string interpolation. An attacker who can supply a crafted OpenAPI definition can insert interpolation markers such as #{…}, #$var or #@var. When the generated Ruby client is loaded, the Ruby interpreter evaluates these markers, causing arbitrary Ruby code to execute with the same privileges as the consumer of the client. Because the generator writes these strings to a file, the flaw 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 July 31, 2026 at 01:55 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 July 31, 2026 at 01:55 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

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-07-29T19:26:44.162Z

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

Link: CVE-2026-59861

cve-icon Vulnrichment

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

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-07-31T02:00:05Z

Weaknesses
  • CWE-94

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