Refitter flaw enables code execution through crafted OpenAPI paths

  • Refitter
  • Refit
  • code execution
  • OpenAPI
  • ModuleInitializer

Flaw stems from unescaped OpenAPI paths in generated attributes

Update to version 2.1.2 to mitigate security risks

Affected versions include all releases prior to 2.1.2

Refitter versions earlier than 2.1.2 contain a vulnerability that can allow arbitrary code execution when an application loads a generated assembly. GitHub’s security advisory says the issue stems from Refitter placing OpenAPI paths into generated Refit attributes without escaping them.

A crafted path in an attacker-controlled or attacker-influenced OpenAPI description can cause injected code to run when an application loads the assembly containing the generated client. The advisory says it verified the vulnerability with Refitter 2.0.0 and .NET 8.

Refitter 2.1.2 fixes the vulnerability. The advisory identifies versions earlier than 2.1.2 as affected.