
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2026-41134 is a code-generation literal injection vulnerability in Microsoft Kiota, an OpenAPI-based HTTP client code generator. All versions prior to 1.31.1 are affected across multiple writer sinks, including serialization/deserialization keys, path/query parameter mappings, URL template metadata, enum/property metadata, and default value emission. When malicious values from an OpenAPI description are emitted into generated source code without context-appropriate escaping, an attacker can break out of string literals and inject arbitrary code into generated clients. The vulnerability was published on April 22, 2026, with a patch released in version 1.31.1. It carries a CVSS v3.1 base score of 7.8 (High) and a CVSS v4.0 base score of 7.3 (High) (GitHub Advisory, Red Hat).
The root cause is classified as CWE-94 (Improper Control of Generation of Code / Code Injection). Kiota fails to apply context-appropriate escaping when emitting values from an OpenAPI description into generated source code, allowing string literal boundaries to be broken. An attacker who controls or can tamper with an OpenAPI description used for code generation can embed payloads such as "\";\ throw new System.Exception(\"injected\"); //" as a default value, which Kiota then writes verbatim into generated C# (or other language) client code. The attack vector is local (the malicious OpenAPI file must be consumed by the generator), requires low attack complexity, and exploitation requires no privileges but does require the victim to use the attacker-controlled or tampered OpenAPI description as input to Kiota (GitHub Advisory).
Successful exploitation results in arbitrary code injection into generated client applications, which executes when those clients are compiled and run, leading to high confidentiality, integrity, and availability impacts on the systems running the generated code. An attacker could achieve remote code execution within the context of the application using the generated client, potentially enabling data exfiltration, privilege escalation, or further lateral movement within the affected environment. The scope of impact is limited to systems that compile and execute the generated client code, but any downstream consumer of a compromised generated client is at risk (GitHub Advisory, Red Hat).
A conceptual proof-of-concept exploit example is included in the official GitHub Security Advisory, demonstrating how a malicious OpenAPI default value can inject code into generated C# output; however, this is illustrative only and not a working exploit (GitHub Advisory). There is no evidence of active in-the-wild exploitation at this time, and no threat actor attribution has been reported. The EPSS score is approximately 0.051% (very low probability of exploitation in the near term). The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. Exploitation is practically constrained to scenarios where an attacker can supply or tamper with the OpenAPI description used for code generation.
components:
schemas:
User:
type: object
properties:
displayName:
type: string
default: "\";\ throw new System.Exception(\"injected\"); //".cs, .ts, .java) containing unexpected code constructs such as throw new Exception(...), eval(...), or other executable statements outside of normal Kiota-generated patterns; unusual or unexpected statements in constructors or property initializers of generated model classes..yaml/.json) that include unusual string values with escape sequences in default values, enum names, or parameter names.Upgrade Kiota to version 1.31.1 or later, which applies context-appropriate escaping across all affected writer sinks. After upgrading, regenerate and refresh all existing generated clients using kiota update to replace any previously generated vulnerable code with hardened output. As an interim risk reduction measure, only generate clients from trusted, integrity-protected OpenAPI descriptions, and implement controls (e.g., checksum verification, access controls on API description sources) to prevent tampering. Avoid consuming OpenAPI descriptions from untrusted or unverified external sources (GitHub Advisory).
The vulnerability was discovered and responsibly disclosed by researcher Thanatos Tian (PolyU), who is acknowledged in the official GitHub Security Advisory. Red Hat has also tracked this CVE in their security advisory database. No significant broader media coverage or notable social media discussion has been identified beyond standard vulnerability tracking and aggregation sites (GitHub Advisory, Red Hat).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."