CVE-2021-23351
JSON

4.4medium

Denial of Service (DoS)

Severity
4.4medium CVSS:3.1 by snyk
Exploit likelihood
1.89% (higher than 80% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
snyk
Also known as
GHSA-fqh4-rh59-xhvfSNYK-GOLANG-GITHUBCOMPIRESGOPROXYPROTO-1081577

Description

The package github.com/pires/go-proxyproto before 0.5.0 are vulnerable to Denial of Service (DoS) via the parseVersion1() function. The reader in this package is a default bufio.Reader wrapping a net.Conn. It will read from the connection until it finds a newline. Since no limits are implemented in the code, a deliberately malformed V1 header could be used to exhaust memory in a server process using this code - and create a DoS. This can be exploited by sending a stream starting with PROXY and continuing to send data (which does not contain a newline) until the target stops acknowledging. The risk here is small, because only trusted sources should be allowed to send proxy protocol headers.

Affected

Product or packageVersionsReported by
github.com/pires/go-proxyprotofrom unspecified before 0.5.0CVE List
github.com/pires/go-proxyproto (Go)before 0.5.0GitHub Advisory Database
go-proxyproto_project go-proxyprotobefore 0.5.0NVD
fedoraproject fedora33, 34NVD

All scores

snyk4.4medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:N/I:N/A:H
GitHub4.9medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:N/A:H
NVD4.9medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:N/A:H
NVD4.0medium CVSS:2.0AV:N/AC:L/Au:S/C:N/I:N/A:P

Classification

What each source says

CVE List

The package github.com/pires/go-proxyproto before 0.5.0 are vulnerable to Denial of Service (DoS) via the parseVersion1() function. The reader in this package is a default bufio.Reader wrapping a net.Conn. It will read from the connection until it finds a newline. Since no limits are implemented in the code, a deliberately malformed V1 header could be used to exhaust memory in a server process using this code - and create a DoS. This can be exploited by sending a stream starting with PROXY and continuing to send data (which does not contain a newline) until the target stops acknowledging. The risk here is small, because only trusted sources should be allowed to send proxy protocol headers.

GitHub Advisory Database

The package github.com/pires/go-proxyproto before 0.5.0 are vulnerable to Denial of Service (DoS) via the parseVersion1() function. The reader in this package is a default bufio.Reader wrapping a net.Conn. It will read from the connection until it finds a newline. Since no limits are implemented in the code, a deliberately malformed V1 header could be used to exhaust memory in a server process using this code - and create a DoS. This can be exploited by sending a stream starting with PROXY and continuing to send data (which does not contain a newline) until the target stops acknowledging. The risk here is small, because only trusted sources should be allowed to send proxy protocol headers.

NVD (es)

El paquete github.com/pires/go-proxyproto versiones anteriores a 0.5.0, son vulnerables a una Denegación de Servicio (DoS) por medio de la función parseVersion1(). El lector de este paquete es un bufio.Reader predeterminado que contiene un net.Conn. Leerá desde la conexión hasta que encuentre una nueva línea. Dado que no se implementan límites en el código, un encabezado V1 deliberadamente malformado podría ser usado para agotar la memoria en un proceso de servidor usando este código y crear una DoS. Esto puede ser explotado mediante el envió de una secuencia que comience con PROXY y continúe enviando datos (que no contienen una nueva línea) hasta que el objetivo deje de reconocer. El riesgo aquí es pequeño, porque solo las fuentes confiables deben poder enviar encabezados de protocolo proxy

References

https://snyk.io/vuln/SNYK-GOLANG-GITHUBCOMPIRESGOPROXYPROTO-1081577third-party-advisory, web
https://github.com/pires/go-proxyproto/pull/71patch, third-party-advisory, web
https://github.com/pires/go-proxyproto/issues/69third-party-advisory, web
https://github.com/pires/go-proxyproto/commit/7f48261db810703d173f27f3309a808cc2b49b8bpatch, third-party-advisory, web
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/4BNVGJMVI3ZTZ675EFPUHPGXCKCGSX46/vendor-advisory
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/C36IBVOZXRTWM7MGTRUTOM56P5RR74VU/vendor-advisory
https://nvd.nist.gov/vuln/detail/CVE-2021-23351advisory
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/4BNVGJMVI3ZTZ675EFPUHPGXCKCGSX46web
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/C36IBVOZXRTWM7MGTRUTOM56P5RR74VUweb

Sources

SourceRecordLicence
CVE ListCVE-2021-23351 changed 2024-09-17CVE Terms of Use
GitHub Advisory DatabaseGHSA-fqh4-rh59-xhvf changed 2026-07-08CC-BY-4.0
NVDCVE-2021-23351 changed 2026-06-17Public domain