# GO-2026-6016 - oapi-codegen: OpenAPI Server Description Escapes Generated Go Comment and Injects Executable Code in…

Source: https://junglewise.ai/threats/go-2026-6016-oapi-codegen-openapi-server-description-escapes-generated-9f19f791  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-07-22  
License: CC BY 4.0 with a link back

Severity: info · Published 2026-07-22

oapi-codegen: OpenAPI Server Description Escapes Generated Go Comment and Injects Executable Code in github.com/oapi-codegen/oapi-codegen

Vendors: [Go](https://junglewise.ai/threats/vendors/go).

## Quick answers

**Is This vulnerability exploited in the wild?** No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.

**How severe is This vulnerability?** Informational severity, published 22 July 2026.

**Which products and versions are affected?** github.com/oapi-codegen/oapi-codegen (Go) SEMVER:introduced=0; github.com/oapi-codegen/oapi-codegen/v2 (Go) SEMVER:introduced=0,fixed=2.7.1.

**Is there a fix for This vulnerability?** Yes. github.com/oapi-codegen/oapi-codegen/v2 (Go): upgrade to 2.7.1 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**Am I affected?** Check whether you run github.com/oapi-codegen/oapi-codegen (Go) or github.com/oapi-codegen/oapi-codegen/v2 (Go) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- github.com/oapi-codegen/oapi-codegen/v2 (Go): upgrade to 2.7.1 or later

  ```sh
  go get github.com/oapi-codegen/oapi-codegen/v2@v2.7.1
  ```


## Affected products

- github.com/oapi-codegen/oapi-codegen (Go) SEMVER:introduced=0
- github.com/oapi-codegen/oapi-codegen/v2 (Go) SEMVER:introduced=0,fixed=2.7.1

## Related threats

- [oapi-codegen code injection via OpenAPI server description](https://junglewise.ai/threats/oapi-codegen-code-injection-via-openapi-server-description-302b468f)
