CVE-2023-41041: Graylog2 server Graylog User Session Is Still Vulnerability

LOW
Advisory Identifier: GHSA-3fqm-frhg-7c85
CVSS 2.6
CWE-613
Published
Advisory Summary

CVE-2023-41041 is a LOW (CVSS 2.6) graylog user session is still vulnerability (CWE-613: Insufficient Session Expiration) affecting Graylog2 server libraries in the Maven ecosystem. The issue involves graylog user session is still usable after logout. Remediation is available by upgrading affected packages to version 5.0.9, 5.1.3.

CVE-2023-41041 at a Glance

CVE Identifier CVE-2023-41041
GHSA Identifier GHSA-3fqm-frhg-7c85
Severity LOW
CVSS v3.1 Base Score 2.6
CWE Classification CWE-613: Insufficient Session Expiration
Affected Product Graylog2 server
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 2.6

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

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

How to Fix CVE-2023-41041

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.0.9
<dependency>
    <groupId>org.graylog2</groupId>
    <artifactId>graylog2-server</artifactId>
    <version>5.0.9</version>
</dependency>
org.graylog2:graylog2-server fixed: 5.1.3
<dependency>
    <groupId>org.graylog2</groupId>
    <artifactId>graylog2-server</artifactId>
    <version>5.1.3</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-41041, 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.0.9), 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-613: Insufficient Session Expiration, where according to wasc, "insufficient session expiration is when a web site permits an attacker to reuse old session credentials or session ids for authorization.". 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 In a multi-node Graylog cluster, after a user has explicitly logged out, a user session may still be used for API requests until it has reached its original expiry time. ### Details Each node maintains an in-memory cache of user sessions. Upon a cache-miss, the session is loaded from the database. After that, the node operates solely on the cached session. Modifications to sessions will update the cached version as well as the session persisted in the database. However, each node maintains their isolated version of the session. When the user logs out, the session is removed from the node-local cache and deleted from the database. The other nodes will however still use the cached session. These nodes will only fail to accept the session id if they intent to update the session in the database. They will then notice that the session is gone. This is true for most API requests originating from user interaction with the Graylog UI because these will lead to an update of the session's "last access" timestamp. If the session update is however prevented by setting the `X-Graylog-No-Session-Extension:true` header in the request, the node will consider the (cached) session valid until the session is expired according to its timeout setting. ### PoC In a 2-node setup, with both nodes behind a load balancer: 1. Log in 1. Extract the session ID from the cookie 1. Log out and close the browser 1. Perform the following API request repeatedly with curl (with `<session-id>` replaced with the session id from step 2 and `<lb-host>` replaced with the hostname of your load balancer): ``` curl -I -H X-Graylog-No-Session-Extension:true https://<session-id>:session@<lb-host>/api/system/cluster/nodes ``` 1. Notice that the request is sometimes rejected, but sometimes succeeds ### Impact No session identifiers are leaked. After a user has logged out, the UI shows the login screen again, which gives the user the impression that their session is not valid anymore. However, if the session becomes compromised later, it can still be used to perform API requests against the Graylog cluster. The time frame for this is limited to the configured session lifetime, starting from the time when the user logged out.

CVE-2023-41041 Affected Graylog2 server Versions

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

References

Frequently Asked Questions

What is CVE-2023-41041?
CVE-2023-41041 is a security vulnerability in Graylog2 server involving Graylog user session is still usable after logout under CWE-613: Insufficient Session Expiration.
Which Graylog2 server versions are affected?
Affected versions include releases prior to 5.0.9, 5.1.3 across affected packages: org.graylog2:graylog2-server.
What version fixes CVE-2023-41041?
Upgrading to 5.0.9, 5.1.3 (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.0.9, 5.1.3. Upgrade your dependency to 5.0.9, 5.1.3 or later.
What is the CVSS score of CVE-2023-41041?
CVE-2023-41041 has a CVSS v3.1 base score of 2.6 (LOW) with vector string CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:L/I:N/A:N.
What CWE is associated with CVE-2023-41041?
CVE-2023-41041 is classified under CWE-613: Insufficient Session Expiration (According to WASC, "Insufficient Session Expiration is when a web site permits an attacker to reuse old session credentials or session IDs for authorization.").
How can I check Maven dependencies for CVE-2023-41041?
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-3fqm-frhg-7c85",
  "modified" : "2023-08-31T18:30:20Z",
  "published" : "2023-07-06T20:47:54Z",
  "aliases" : [ "CVE-2023-41041" ],
  "summary" : "Graylog user session is still usable after logout",
  "details" : "### Summary\n\nIn a multi-node Graylog cluster, after a user has explicitly logged out, a user session may still be used for API requests until it has reached its original expiry time.\n\n### Details\n\nEach node maintains an in-memory cache of user sessions. Upon a cache-miss, the session is loaded from the database. After that, the node operates solely on the cached session. Modifications to sessions will update the cached version as well as the session persisted in the database. However, each node maintains their isolated version of the session.\n\nWhen the user logs out, the session is removed from the node-local cache and deleted from the database. The other nodes will however still use the cached session.\n\nThese nodes will only fail to accept the session id if they intent to update the session in the database. They will then notice that the session is gone. This is true for most API requests originating from user interaction with the Graylog UI because these will lead to an update of the session's \"last access\" timestamp.\n\nIf the session update is however prevented by setting the `X-Graylog-No-Session-Extension:true` header in the request, the node will consider the (cached) session valid until the session is expired according to its timeout setting.\n\n### PoC\nIn a 2-node setup, with both nodes behind a load balancer:\n\n1. Log in\n1. Extract the session ID from the cookie\n1. Log out and close the browser\n1. Perform the following API request repeatedly with curl (with `<session-id>` replaced with the session id from step 2 and `<lb-host>` replaced with the hostname of your load balancer):\n    ```\n    curl -I -H X-Graylog-No-Session-Extension:true https://<session-id>:session@<lb-host>/api/system/cluster/nodes\n    ```\n1. Notice that the request is sometimes rejected, but sometimes succeeds\n\n\n### Impact\n\nNo session identifiers are leaked.\n\nAfter a user has logged out, the UI shows the login screen again, which gives the user the impression that their session is not valid anymore. However, if the session becomes compromised later, it can still be used to perform API requests against the Graylog cluster. The time frame for this is limited to the configured session lifetime, starting from the time when the user logged out.\n\n\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.graylog2:graylog2-server"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.0"
      }, {
        "fixed" : "5.0.9"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.graylog2:graylog2-server"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.1.0"
      }, {
        "fixed" : "5.1.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/Graylog2/graylog2-server/security/advisories/GHSA-3fqm-frhg-7c85"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-41041"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Graylog2/graylog2-server/commit/bb88f3d0b2b0351669ab32c60b595ab7242a3fe3"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Graylog2/graylog2-server/commit/ff90f3e2aa4ae2e0bb613d3236e52c40aa154b20"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Graylog2/graylog2-server"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-613" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-07-06T20:47:54Z",
    "nvd_published_at" : "2023-08-30T22:15:10Z"
  }
}