microsoft/codegen-literal-security-scan
Detect and remediate code-generation literal injection risks in Kiota writer code (wire names, serialization names, URL templates, base URLs, defaults, and path parameter keys).
npx skills add https://github.com/microsoft/kiota --skill codegen-literal-security-scan
Use this skill when auditing or modifying any code generator writer logic.
Prevent generated-source injection (including potential RCE chains) by ensuring every untrusted schema-derived value is escaped for the destination literal context before being emitted.
Prioritize all literal-emission paths under src/Kiota.Builder/Writers/**/*.cs, especially:
WireName, SerializationName, IndexParameter.SerializationNameUrlTemplateOverride, URI template constants, base URL defaultsDefaultValue (constructor assignments, getter fallback values, parameter signatures)WriteLine, WriteLines, StartBlock, doc attributes/tags).SanitizeDoubleQuote()SanitizeSingleQuote()SanitizeQuotedStringLiteral()SanitizeDartSingleQuoteLiteral/SanitizeDartDoubleQuoteLiteral (to also escape $)AddParametersAssignment and equivalents) are also sanitized, not only writer methods.src/Kiota.Builder/Writers/StringExtensions.cs.WireName, discriminator keys, query mapper keys).UrlTemplateOverride, URI template constants, base URL defaults).urlTplParams[...], .Add(...), .put(...), map assignments).QueryParameter, EnumMember, enum objects, navigation/request metadata constants).After changes:
tests/Kiota.Builder.Tests/Writers/**.", ', \n, \r, \t, \\, and $ where relevant).Take microsoft/codegen-literal-security-scan from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.