Oapi Codegen
Monthly
Code injection in the oapi-codegen Go generator (versions 2.0.0 through 2.8.0) lets an attacker who controls or tampers with the OpenAPI document being generated insert arbitrary Go source through non-literal enum entries in integer, number, or boolean schemas, typically closing the emitted const block and appending a func init(). The injected code runs when the victim builds and imports the generated package, so the CVSS 4.0 vector scores PR:N but UI:P: the victim must generate, build, and import the output without reviewing the diff, and the schema must be reachable from a path or SkipPrune must be enabled. There is no CISA KEV listing; the vendor shipped a fix in 2.8.1 via PR #2626, the reporter's advisory includes working reproduction payloads, and exploitation is practical only for teams that generate from third-party or untrusted specs.
The oapi-codegen Go code generator (versions 2.5.0 up to but not including 2.8.1) emits the untrusted OpenAPI field servers[].x-go-name unescaped into generated Go source, letting whoever controls the consumed spec splice arbitrary code - for example a top-level func init() - into the generated package, which executes when a downstream project imports or builds it. Exploitation is conditional: it requires the non-default generate: server-urls: true option and a victim pipeline that generates, builds, and imports the output without catching the injected lines in review (CVSS:4.0 7.7 from the CVE record; independently assessed CVSS:3.1 7.8, AV:N/AC:H/PR:N/UI:R, High confidentiality, integrity and availability impact within the generated package). The priority signal is this_week rather than act_now, and the picture is a real but conditional supply-chain/build-time risk rather than an urgent remote-service RCE; no CISA KEV entry or confirmed working public exploit code is identified, though the upstream advisory does document reproduction payloads demonstrating the injection.
Code injection in the oapi-codegen Go generator (versions 2.0.0 through 2.8.0) lets an attacker who controls or tampers with the OpenAPI document being generated insert arbitrary Go source through non-literal enum entries in integer, number, or boolean schemas, typically closing the emitted const block and appending a func init(). The injected code runs when the victim builds and imports the generated package, so the CVSS 4.0 vector scores PR:N but UI:P: the victim must generate, build, and import the output without reviewing the diff, and the schema must be reachable from a path or SkipPrune must be enabled. There is no CISA KEV listing; the vendor shipped a fix in 2.8.1 via PR #2626, the reporter's advisory includes working reproduction payloads, and exploitation is practical only for teams that generate from third-party or untrusted specs.
The oapi-codegen Go code generator (versions 2.5.0 up to but not including 2.8.1) emits the untrusted OpenAPI field servers[].x-go-name unescaped into generated Go source, letting whoever controls the consumed spec splice arbitrary code - for example a top-level func init() - into the generated package, which executes when a downstream project imports or builds it. Exploitation is conditional: it requires the non-default generate: server-urls: true option and a victim pipeline that generates, builds, and imports the output without catching the injected lines in review (CVSS:4.0 7.7 from the CVE record; independently assessed CVSS:3.1 7.8, AV:N/AC:H/PR:N/UI:R, High confidentiality, integrity and availability impact within the generated package). The priority signal is this_week rather than act_now, and the picture is a real but conditional supply-chain/build-time risk rather than an urgent remote-service RCE; no CISA KEV entry or confirmed working public exploit code is identified, though the upstream advisory does document reproduction payloads demonstrating the injection.