CVE-2023-41045: Graylog2 server Remote Code Execution Vulnerability

LOW
Advisory Identifier: GHSA-g96c-x7rh-99r3
CVSS 3.7
CWE-345
Published
Advisory Summary

CVE-2023-41045 is a LOW (CVSS 3.7) remote code execution vulnerability (CWE-345: Insufficient Verification of Data Authenticity) affecting Graylog2 server libraries in the Maven ecosystem. The issue involves graylog vulnerable to insecure source port usage for dns queries. Remediation is available by upgrading affected packages to version 5.1.3, 5.0.9.

CVE-2023-41045 at a Glance

CVE Identifier CVE-2023-41045
GHSA Identifier GHSA-g96c-x7rh-99r3
Severity LOW
CVSS v3.1 Base Score 3.7
CWE Classification CWE-345: Insufficient Verification of Data Authenticity
Affected Product Graylog2 server
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 3.7

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2023-41045

To remediate this vulnerability, upgrade all affected Graylog2 server dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

org.graylog2:graylog2-server fixed: 5.1.3
<dependency>
    <groupId>org.graylog2</groupId>
    <artifactId>graylog2-server</artifactId>
    <version>5.1.3</version>
</dependency>
org.graylog2:graylog2-server fixed: 5.0.9
<dependency>
    <groupId>org.graylog2</groupId>
    <artifactId>graylog2-server</artifactId>
    <version>5.0.9</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=org.graylog2

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2023-41045, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=org.graylog2

Analyze the terminal output to locate any version of Graylog2 server in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.1.3), your application is affected.

Note: The mvn dependency:tree -Dincludes=org.graylog2 command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-345: Insufficient Verification of Data Authenticity, where the product does not sufficiently verify the origin or authenticity of data, in a way that causes it to accept invalid data. In Graylog2 server, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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](https://user-images.githubusercontent.com/67056857/242301750-6a5a8d0d-fcd2-40d1-bbd4-73baa8279ed3.png) ### 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)

CVE-2023-41045 Affected Graylog2 server Versions

2 component(s)
Fixed Versions:
5.1.35.0.9
Product / Package Ecosystem Affected Versions Fixed Version
org.graylog2:graylog2-server
Maven
≥ 5.1.0
< 5.1.3
5.1.3
org.graylog2:graylog2-server
Maven
< 5.0.9
5.0.9

References

Frequently Asked Questions

What is CVE-2023-41045?
CVE-2023-41045 is a security vulnerability in Graylog2 server involving Graylog vulnerable to insecure source port usage for DNS queries under CWE-345: Insufficient Verification of Data Authenticity.
Which Graylog2 server versions are affected?
Affected versions include releases prior to 5.1.3, 5.0.9 across affected packages: org.graylog2:graylog2-server.
What version fixes CVE-2023-41045?
Upgrading to 5.1.3, 5.0.9 (or the latest patched release for your respective branch) resolves the vulnerability.
Is graylog2-server affected?
Yes, org.graylog2:graylog2-server is affected in releases prior to 5.1.3, 5.0.9. Upgrade your dependency to 5.1.3, 5.0.9 or later.
What is the CVSS score of CVE-2023-41045?
CVE-2023-41045 has a CVSS v3.1 base score of 3.7 (LOW) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N.
What CWE is associated with CVE-2023-41045?
CVE-2023-41045 is classified under CWE-345: Insufficient Verification of Data Authenticity (The product does not sufficiently verify the origin or authenticity of data, in a way that causes it to accept invalid data.).
How can I check Maven dependencies for CVE-2023-41045?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.graylog2'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-g96c-x7rh-99r3",
  "modified" : "2023-09-07T21:19:13Z",
  "published" : "2023-07-06T20:51:48Z",
  "aliases" : [ "CVE-2023-41045" ],
  "summary" : "Graylog vulnerable to insecure source port usage for DNS queries",
  "details" : "### Summary\nGraylog utilises only one single source port for DNS queries.\n\n### Details\nGraylog 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.\n\n\n### PoC \n\nThe 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.\n\n![image](https://user-images.githubusercontent.com/67056857/242301750-6a5a8d0d-fcd2-40d1-bbd4-73baa8279ed3.png)\n\n### Impact\nAlthough 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.\n\n\n\n(Credit to Iratxe Niño from Fundación Sarenet and Borja Marcos from Sarenet)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.graylog2:graylog2-server"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.1.0"
      }, {
        "fixed" : "5.1.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.graylog2:graylog2-server"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "5.0.9"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/Graylog2/graylog2-server/security/advisories/GHSA-g96c-x7rh-99r3"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-41045"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Graylog2/graylog2-server/commit/466af814523cffae9fbc7e77bab7472988f03c3e"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Graylog2/graylog2-server/commit/a101f4f12180fd3dfa7d3345188a099877a3c327"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Graylog2/graylog2-server"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-345" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-07-06T20:51:48Z",
    "nvd_published_at" : "2023-08-31T18:15:09Z"
  }
}