Skip to content
Heist/ feed
Back to feed
Medium

Apache Log4j Core: Missing TLS hostname verification in Socket appender

Type: advisorySources: OSV

The Socket Appender in Apache Log4j Core versions 2.0-beta9 through 2.25.2 does not perform TLS hostname verification of the peer certificate, even when the verifyHostName https://logging.apache.org/log4j/2.x/manual/appenders/network.html#SslConfiguration-attr-verifyHostName configuration attribute or the log4j2.sslVerifyHostName https://logging.apache.org/log4j/2.x/manual/systemproperties.html#log4j2.sslVerifyHostName system property is set to true. This issue may allow a man-in-the-middle attacker to intercept or redirect log traffic under the following conditions: * The attacker is able to intercept or redirect network traffic between the client and the log receiver. * The attacker can present a server certificate issued by a certification authority trusted by the Socket Appender’s configured trust store (or by the default Java trust store if no custom trust store is configured). Users are advised to upgrade to Apache Log4j Core version 2.25.3, which addresses this issue. As an alternative mitigation, the Socket Appender may be configured to use a private or restricted trust root to limit the set of trusted certificates.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2025-68161
Confirmed fixed CVEs
Not specified
Updated in this feed
5 Nov 2026, 05:41 UTC · Revision 1

Source evidence

Apache Log4j Core: Missing TLS hostname verification in Socket appender

core-osv · Original source

Published 18 Dec 2025, 20:47 UTC

The Socket Appender in Apache Log4j Core versions 2.0-beta9 through 2.25.2 does not perform TLS hostname verification of the peer certificate, even when the verifyHostName https://logging.apache.org/log4j/2.x/manual/appenders/network.html#SslConfiguration-attr-verifyHostName configuration attribute or the log4j2.sslVerifyHostName https://logging.apache.org/log4j/2.x/manual/systemproperties.html#log4j2.sslVerifyHostName system property is set to true. This issue may allow a man-in-the-middle attacker to intercept or redirect log traffic under the following conditions: * The attacker is able to intercept or redirect network traffic between the client and the log receiver. * The attacker can present a server certificate issued by a certification authority trusted by the Socket Appender’s configured trust store (or by the default Java trust store if no custom trust store is configured). Users are advised to upgrade to Apache Log4j Core version 2.25.3, which addresses this issue. As an alternative mitigation, the Socket Appender may be configured to use a private or restricted trust root to limit the set of trusted certificates.

osv:CVE-2025-68161
Complete source record
{
  "id": "1cabdd39b9d342cd4d787733eabe39bf5c1045f7cc6c3e3d92a6be7d0ae6becc",
  "url": "https://osv.dev/vulnerability/CVE-2025-68161",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Apache Log4j Core: Missing TLS hostname verification in Socket appender",
    "summary": "The Socket Appender in Apache Log4j Core versions 2.0-beta9 through 2.25.2 does not perform TLS hostname verification of the peer certificate, even when the verifyHostName https://logging.apache.org/log4j/2.x/manual/appenders/network.html#SslConfiguration-attr-verifyHostName configuration attribute or the log4j2.sslVerifyHostName https://logging.apache.org/log4j/2.x/manual/systemproperties.html#log4j2.sslVerifyHostName system property is set to true. This issue may allow a man-in-the-middle attacker to intercept or redirect log traffic under the following conditions: * The attacker is able to intercept or redirect network traffic between the client and the log receiver. * The attacker can present a server certificate issued by a certification authority trusted by the Socket Appender’s configured trust store (or by the default Java trust store if no custom trust store is configured). Users are advised to upgrade to Apache Log4j Core version 2.25.3, which addresses this issue. As an alternative mitigation, the Socket Appender may be configured to use a private or restricted trust root to limit the set of trusted certificates.",
    "evidence": "osv:CVE-2025-68161",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2025-68161",
      "aliases": [
        "CVE-2025-68161",
        "GHSA-vc5p-v9hr-52mj"
      ],
      "metrics": [
        {
          "type": "CVSS_V4",
          "score": "CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:L/SA:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/apache/logging-log4j2",
              "type": "GIT",
              "events": [
                {
                  "introduced": "6b788facd3479dfe9052b3a5e13f6603dce8c16f"
                },
                {
                  "fixed": "028e9fad03ae7bcbf2e49ab8d32d8cfb900f3587"
                },
                {
                  "introduced": "8d9204a4b4c6016fa6b36513a46502689d6a45c1"
                },
                {
                  "last_affected": "8d9204a4b4c6016fa6b36513a46502689d6a45c1"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:apache:log4j:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "2.0.1"
                      },
                      {
                        "fixed": "2.25.3"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "cpe": "cpe:2.3:a:apache:log4j:2.0:-:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "2.0-NA"
                      },
                      {
                        "last_affected": "2.0-NA"
                      }
                    ],
                    "source": "CPE_STRING"
                  }
                ]
              }
            }
          ],
          "versions": [
            "2.0-NA",
            "rel/2.0",
            "log4j-2.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-68161.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:43.022294994Z",
      "provider": "osv",
      "references": [
        "https://lists.debian.org/debian-lts-announce/2026/01/msg00015.html",
        "https://logging.apache.org/log4j/2.x/manual/appenders/network.html#SslConfiguration-attr-verifyHostName",
        "https://logging.apache.org/log4j/2.x/manual/systemproperties.html#log4j2.sslVerifyHostName",
        "https://repo.maven.apache.org/maven2",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/68xxx/CVE-2025-68161.json",
        "https://lists.apache.org/thread/xr33kyxq3sl67lwb61ggvm1fzc8k7dvx",
        "https://logging.apache.org/cyclonedx/vdr.xml",
        "https://logging.apache.org/security.html#CVE-2025-68161",
        "https://nvd.nist.gov/vuln/detail/CVE-2025-68161",
        "https://github.com/apache/logging-log4j2/pull/4002"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-297"
        ],
        "cna_assigner": "apache",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/68xxx/CVE-2025-68161.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2025-68161",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 510784,
  "published_at": "2025-12-18T20:47:49.123+00:00"
}