# CVE-2026-59861: Kiota: Code Generation Literal Injection in Kiota Ruby Generator

- Severity: High 7.5 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.45%, higher than 74% of CVEs (2026-12-01)
- Published: 2026-07-16T14:36:32.010Z
- Modified: 2026-10-24T21:10:00.130Z
- Also known as: GHSA-xg2h-5xr2-29jw
- Weaknesses: CWE-94
- SSVC (CISA-ADP): exploitation none, automatable yes, technical impact total
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- microsoft kiota: >= 1.30.0, < 1.31.1; < 1.29.1
- Microsoft.OpenAPI.Kiota (NuGet): from 1.30.0 before 1.32.0; before 1.29.1
- Microsoft.OpenAPI.Kiota.Builder (NuGet): from 1.30.0 before 1.32.0; before 1.29.1

## Every score

- GitHub_M: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- GitHub: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`

## References

- <https://github.com/microsoft/kiota/security/advisories/GHSA-xg2h-5xr2-29jw> (web)
- <https://github.com/microsoft/kiota/pull/7746> (web)
- <https://github.com/microsoft/kiota/commit/fee1b648bb4394ba7ba72de9c0ce4f2a0bad0cb6> (web)
- <https://github.com/microsoft/kiota/releases/tag/v1.32.0> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-59861> (advisory)
- <https://github.com/microsoft/kiota> (package)

## Sources

- CVE List: [CVE-2026-59861](https://www.cve.org/CVERecord?id=CVE-2026-59861), CVE Terms of Use, modified 2026-08-17
- GitHub Advisory Database: [GHSA-xg2h-5xr2-29jw](https://github.com/advisories/GHSA-xg2h-5xr2-29jw), CC-BY-4.0, modified 2026-08-17
- NVD: [CVE-2026-59861](https://nvd.nist.gov/vuln/detail/CVE-2026-59861), Public domain, modified 2026-10-24

---

Page: https://cve.day/CVE-2026-59861 · Whole record: https://cve.day/CVE-2026-59861.json · Rebuilt by cve.day 2026-11-25T22:59:28.389Z
