SNYK-GOLANG-GITHUBCOMGINGONICGIN-3324285
## Overview [github.com/gin-gonic/gin](https://github.com/gin-gonic/gin) is a package that implements a HTTP web framework called gin. Affected versions of this package are vulnerable to Improper Input Validation by allowing an attacker to use a specially crafted request via the `X-Forwarded-Prefix` header, potentially leading to cache poisoning. **Note:** Although this issue does not pose a significant threat on its own it can serve as an input vector for other more impactful vulnerabilities. However, successful exploitation may depend on the server configuration and whether the header is used in the application logic. ## PoC ``` package main import ( "net/http" "github.com/gin-gonic/gin" ) func main() { r := gin.Default() r.GET("/bug", func(c *gin.Context) { c.JSON(http.StatusBadRequest, gin.H{"msg": "bug"}) }) r.Run() } ``` ## Remediation Upgrade `github.com/gin-gonic/gin` to version 1.9.0 or higher. ## References - [GitHub Commit](https://github.com/t0rchwo0d/gin/commit/fd9f98e70fb4107ee68c783482d231d35e60507b) - [GitHub PR](https://github.com/gin-gonic/gin/pull/3500) - [GitHub PR](https://github.com/gin-gonic/gin/pull/3503) - [GitHub Release](https://github.com/gin-gonic/gin/releases/tag/v1.9.0)
Risk Scores
Affected Products
| Vendor | Product | Versions |
|---|---|---|
| 0 |
Timeline
- Feb 17, 2023 CVE Updated
- May 3, 2023 CVE Published
References
- https://security.snyk.io/vuln/SNYK-GOLANG-GITHUBCOMGINGONICGIN-3324285 advisory
- https://learn.snyk.io/lesson/improper-input-validation/ technical
- https://github.com/gin-gonic/gin technical
- https://github.com/t0rchwo0d/gin/commit/fd9f98e70fb4107ee68c783482d231d35e60507b patch
- https://github.com/gin-gonic/gin/pull/3500 patch
- https://github.com/gin-gonic/gin/pull/3503 patch
- https://github.com/gin-gonic/gin/releases/tag/v1.9.0 vendor