# CVE-2020-36567: Arbitrary log line injection in github.com/gin-gonic/gin

> Remote attackers can inject arbitrary log lines via unsanitized input in the default logger of the Gin web framework.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 27 Dec 2022
- **Updated:** 11 Apr 2025
- **Also known as:** DEBIAN-CVE-2020-36567, GHSA-6vm3-jj99-7229, GO-2020-0001, UBUNTU-CVE-2020-36567

## What is CVE-2020-36567?

CVE-2020-36567 is a high-severity vulnerability in github.com/gin-gonic/gin, published on 27 Dec 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Unsanitized input in the default logger in github.com/gin-gonic/gin before v1.6.0 allows remote attackers to inject arbitrary log lines.

Weakness: CWE-116 (Improper Encoding or Escaping of Output)

## Which versions are affected by CVE-2020-36567?

3 open source packages ship an affected version, including github.com/gin-gonic/gin. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/gin-gonic/gin` | Go | All versions | 1.6.0 |
| `github.com/gin-gonic/gin` | Go | All versions | 1.6.0 |
| `github.com/gin-gonic/gin` | Go | All versions | 1.6.0 |

Products: Gin-Gonic Gin.

## How do I fix CVE-2020-36567?

Upgrade github.com/gin-gonic/gin to 1.6.0 or later.

## Is CVE-2020-36567 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2020-36567 exists.

## Other vulnerabilities in github.com/gin-gonic/gin

- [CVE-2020-28483](https://insights.sbomify.com/CVE-2020-28483/): HTTP Response Splitting (high 7.1)
- [CVE-2023-26125](https://insights.sbomify.com/CVE-2023-26125/): Improper input validation in github.com/gin-gonic/gin (medium 5.6)
- [CVE-2023-29401](https://insights.sbomify.com/CVE-2023-29401/): Improper handling of filenames in Content-Disposition HTTP header in github.com/gin-gonic/gin (medium 4.3)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2020-36567 and fix it if it is affected.

What it is: CVE-2020-36567 is a high-severity vulnerability in github.com/gin-gonic/gin, published on 27 Dec 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2020-36567 exists.

Affected packages and fixed versions:
- github.com/gin-gonic/gin (Go): affected all versions; fixed in 1.6.0
- github.com/gin-gonic/gin (Go): affected all versions; fixed in 1.6.0
- github.com/gin-gonic/gin (Go): affected all versions; fixed in 1.6.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2020-36567/ (Markdown: https://insights.sbomify.com/CVE-2020-36567/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2020-36567
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2020-36567
- OSV: https://osv.dev/vulnerability/CVE-2020-36567

---
From sbomify Insights: https://insights.sbomify.com/CVE-2020-36567/
Summaries are generated and may contain mistakes; the official description above is the record.
