CVE-2023-41045
JSON

3.7low

Insecure source port usage for DNS queries in Graylog

Severity
3.7low CVSS:3.1 by GitHub_M
Exploit likelihood
0.36% (higher than 31% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-g96c-x7rh-99r3

Description

Graylog is a free and open log management platform. Graylog makes use of only one single source port for DNS queries. Graylog binds a single socket for outgoing DNS queries and while that socket is bound to a random port number it is never changed again. This goes against recommended practice since 2008, when Dan Kaminsky discovered how easy is to carry out DNS cache poisoning attacks. In order to prevent cache poisoning with spoofed DNS responses, it is necessary to maximise the uncertainty in the choice of a source port for a DNS query. Although unlikely in many setups, an external attacker could inject forged DNS responses into a Graylog's lookup table cache. In order to prevent this, it is at least recommendable to distribute the DNS queries through a pool of distinct sockets, each of them with a random source port and renew them periodically. This issue has been addressed in versions 5.0.9 and 5.1.3. Users are advised to upgrade. There are no known workarounds for this issue.

Affected

Product or packageVersionsReported by
Graylog2 graylog2-server< 5.0.9, >= 5.1.0, < 5.1.3CVE List
org.graylog2:graylog2-server (Maven)from 5.1.0 before 5.1.3, before 5.0.9GitHub Advisory Database
graylog graylogbefore 5.0.9, from 5.1.0 before 5.1.3NVD

All scores

GitHub_M3.7low CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N
GitHub3.7low CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N
NVD5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N

Classification

CWE-345

SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.

What each source says

CVE List

Graylog is a free and open log management platform. Graylog makes use of only one single source port for DNS queries. Graylog binds a single socket for outgoing DNS queries and while that socket is bound to a random port number it is never changed again. This goes against recommended practice since 2008, when Dan Kaminsky discovered how easy is to carry out DNS cache poisoning attacks. In order to prevent cache poisoning with spoofed DNS responses, it is necessary to maximise the uncertainty in the choice of a source port for a DNS query. Although unlikely in many setups, an external attacker could inject forged DNS responses into a Graylog's lookup table cache. In order to prevent this, it is at least recommendable to distribute the DNS queries through a pool of distinct sockets, each of them with a random source port and renew them periodically. This issue has been addressed in versions 5.0.9 and 5.1.3. Users are advised to upgrade. There are no known workarounds for this issue.

GitHub Advisory Database
Summary

Graylog utilises only one single source port for DNS queries.

Details

Graylog seems to bind a single socket for outgoing DNS queries. That socket is bound to a random port number which is not changed again. This goes against recommended practice since 2008, when Dan Kaminsky discovered how easy is to carry out DNS cache poisoning attacks. In order to prevent cache poisoning with spoofed DNS responses, it is necessary to maximise the uncertainty in the choice of a source port for a DNS query.

PoC

The attached figure shows the source ports distribution difference between Graylog configured to use a data adapter based on DNS queries and ISC Bind. The source port distribution of the DNS queries sent from Graylog to a recursive DNS name server running Bind (CLIENT_QUERY) are depicted in purple, while the queries sent from the recursive DNS server to the authoritatives (RESOLVER_QUERY) are plotted in green color. As it can be observed, in contrast to ISC Bind which presents a heterogeneous usage of source port, Graylog utilises a single source port.

image

Impact

Although unlikely in many setups, an external attacker could inject forged DNS responses into a Graylog's lookup table cache. In order to prevent this, it is at least recommendable to distribute the DNS queries through a pool of distinct sockets, each of them with a random source port and renew them periodically.

(Credit to Iratxe Niño from Fundación Sarenet and Borja Marcos from Sarenet)

NVD (es)

Graylog es una plataforma de gestión de logs gratuita y de código abierto. Graylog utiliza solo un único puerto de origen para las consultas DNS. Graylog enlaza un único socket para las consultas DNS salientes y, aunque ese socket está enlazado a un número de puerto aleatorio, nunca se vuelve a cambiar. Esto va en contra de la práctica recomendada desde 2008, cuando Dan Kaminsky descubrió lo fácil que es llevar a cabo ataques de envenenamiento de caché DNS. Para evitar el envenenamiento de caché con respuestas DNS falsificadas, es necesario maximizar la incertidumbre en la elección de un puerto de origen para una consulta DNS. Aunque improbable en muchas configuraciones, un atacante externo podría inyectar respuestas DNS falsificadas en la caché de la tabla de búsqueda de Graylog. Para evitar esto, es al menos recomendable distribuir las consultas DNS a través de un pool de sockets distintos, cada uno de ellos con un puerto de origen aleatorio y renovarlos periódicamente. Este problema ha sido abordado en las versiones 5.0.9 y 5.1.3. Se aconseja a los usuarios actualizar. No se conocen soluciones alternativas para este problema.

References

Sources

SourceRecordLicence
CVE ListCVE-2023-41045 changed 2024-10-01CVE Terms of Use
GitHub Advisory DatabaseGHSA-g96c-x7rh-99r3 changed 2024-02-16CC-BY-4.0
NVDCVE-2023-41045 changed 2026-06-17Public domain