CVE-2018-1285: Log4net XML External Entity Attack Vulnerability

CRITICAL
Advisory Identifier: GHSA-2cwj-8chv-9pp9
CVSS 9.8
CWE-611
Published
Advisory Summary

CVE-2018-1285 is a CRITICAL (CVSS 9.8) xml external entity attack vulnerability (CWE-611: Improper Restriction of XML External Entity Reference) affecting Log4net libraries in the NuGet ecosystem. The issue involves xml external entity attack in log4net. Remediation is available by upgrading affected packages to version 2.0.10.

CVE-2018-1285 at a Glance

CVE Identifier CVE-2018-1285
GHSA Identifier GHSA-2cwj-8chv-9pp9
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-611: Improper Restriction of XML External Entity Reference
Affected Product Log4net
Package Ecosystem NuGet
Published Date
Last Updated

Security Impact

CVSS: 9.8

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

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

How to Fix CVE-2018-1285

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

log4net fixed: 2.0.10
Upgrade log4net to 2.0.10
Verify Direct and Transitive Dependencies

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

inspect dependencies for log4net

How to Check if You Are Affected

To determine whether your application is affected by CVE-2018-1285, inspect your project dependencies for Log4net:

inspect dependencies for log4net

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

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-611: Improper Restriction of XML External Entity Reference, where the product processes an xml document that can contain xml entities with uris that resolve to documents outside of the intended sphere of control, causing the product to embed incorrect documents into its output. In Log4net, 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

Apache log4net before 2.0.10 does not disable XML external entities when parsing log4net configuration files. This could allow for XXE-based attacks in applications that accept arbitrary configuration files from users.

CVE-2018-1285 Affected Log4net Versions

1 component(s)
Fixed Versions:
2.0.10
Product / Package Ecosystem Affected Versions Fixed Version
log4net
NuGet
< 2.0.10
2.0.10

References

NVD — CVE-2018-1285 NVD
https://nvd.nist.gov/vuln/detail/CVE-2018-1285
www.whitesourcesoftware.com/vulnerability-datab... WEB
https://www.whitesourcesoftware.com/vulnerability-database/CVE-2018-1285
Log4net Security Information SECURITY
https://www.oracle.com/security-alerts/cpujan2021.html
Log4net Security Information SECURITY
https://www.oracle.com/security-alerts/cpuapr2022.html
Log4net Security Information SECURITY
https://www.oracle.com/security-alerts/cpuApr2021.html
www.nuget.org/packages/log4net WEB
https://www.nuget.org/packages/log4net
snyk.io/vuln/snyk-dotnet-lo... WEB
https://snyk.io/vuln/SNYK-DOTNET-LOG4NET-568897
Log4net Security Information SECURITY
https://security.netapp.com/advisory/ntap-20220909-0001
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/VT2DNNSW7C7FNK3MA3SLEUHGW5USYZKE
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/VKL2LPINAI6BCMXOH4V4HVHGLUXIWOFO
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/M2U233HVAQDSZ2PRG4XSGDASLY3J6ALH
lists.apache.org/thread.html/reab1c2... WEB
https://lists.apache.org/thread.html/reab1c277c95310bad1038255e0757857b2fbe291411b4fa84552028a%40%3Cdev.logging.apache.org%3E
lists.apache.org/thread.html/rdbac24... WEB
https://lists.apache.org/thread.html/rdbac24c945ca5c69cd5348b5ac023bc625768f653335de146e09ae2d@%3Cdev.logging.apache.org%3E
lists.apache.org/thread.html/rd2d72a... WEB
https://lists.apache.org/thread.html/rd2d72a017e238d1f345f9d14e075c81be16fc68a41c9e9ad9e29a732@%3Cdev.logging.apache.org%3E
lists.apache.org/thread.html/r9de86a... WEB
https://lists.apache.org/thread.html/r9de86a185575e6c5f92e2a70a1d2e2e9514dc4341251577aac8e3866@%3Cdev.logging.apache.org%3E
lists.apache.org/thread.html/r7ab6b6... WEB
https://lists.apache.org/thread.html/r7ab6b6e702f11a6f77b0db2af2d5e5532f56ae4b99b5fe73c5200b6a@%3Cdev.logging.apache.org%3E
lists.apache.org/thread.html/r6543ac... WEB
https://lists.apache.org/thread.html/r6543acafca3e2d24ff4b0c364a91540cb9378977ffa8d37a03ab4b0f@%3Cdev.logging.apache.org%3E
lists.apache.org/thread.html/r525cbb... WEB
https://lists.apache.org/thread.html/r525cbbd7db0aef4a114cf60de8439aa285decc34904d42a7f14f39c3@%3Cdev.logging.apache.org%3E
lists.apache.org/thread.html/r33564d... WEB
https://lists.apache.org/thread.html/r33564de316d4e4ba0fea1d4d079e62cde1ffe64369c1157243d840d9@%3Cdev.logging.apache.org%3E
lists.apache.org/thread.html/r00b16a... WEB
https://lists.apache.org/thread.html/r00b16ac5e0bbf7009a0d167ed58f3f94d0033b0f4b3e3d5025cc4872@%3Cdev.logging.apache.org%3E
issues.apache.org/jira/browse/log4net... WEB
https://issues.apache.org/jira/browse/LOG4NET-575
Log4net Source Repository REPOSITORY
https://github.com/apache/logging-log4net

Frequently Asked Questions

What is CVE-2018-1285?
CVE-2018-1285 is a security vulnerability in Log4net involving XML External Entity attack in log4net under CWE-611: Improper Restriction of XML External Entity Reference.
Which Log4net versions are affected?
Affected versions include releases prior to 2.0.10 across affected packages: log4net.
What version fixes CVE-2018-1285?
Upgrading to 2.0.10 (or the latest patched release for your respective branch) resolves the vulnerability.
Is log4net affected?
Yes, log4net is affected in releases prior to 2.0.10. Upgrade your dependency to 2.0.10 or later.
What is the CVSS score of CVE-2018-1285?
CVE-2018-1285 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2018-1285?
CVE-2018-1285 is classified under CWE-611: Improper Restriction of XML External Entity Reference (The product processes an XML document that can contain XML entities with URIs that resolve to documents outside of the intended sphere of control, causing the product to embed incorrect documents into its output.).
How can I check NuGet dependencies for CVE-2018-1285?
Run the dependency tree command: 'inspect dependencies for log4net'. 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-2cwj-8chv-9pp9",
  "modified" : "2021-08-25T20:55:11Z",
  "published" : "2021-01-29T19:47:23Z",
  "aliases" : [ "CVE-2018-1285" ],
  "summary" : "XML External Entity attack in log4net",
  "details" : "Apache log4net before 2.0.10 does not disable XML external entities when parsing log4net configuration files. This could allow for XXE-based attacks in applications that accept arbitrary configuration files from users.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "log4net"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.0.10"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2018-1285"
  }, {
    "type" : "WEB",
    "url" : "https://www.whitesourcesoftware.com/vulnerability-database/CVE-2018-1285"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/security-alerts/cpujan2021.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/security-alerts/cpuapr2022.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/security-alerts/cpuApr2021.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.nuget.org/packages/log4net"
  }, {
    "type" : "WEB",
    "url" : "https://snyk.io/vuln/SNYK-DOTNET-LOG4NET-568897"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20220909-0001"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/VT2DNNSW7C7FNK3MA3SLEUHGW5USYZKE"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/VKL2LPINAI6BCMXOH4V4HVHGLUXIWOFO"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/M2U233HVAQDSZ2PRG4XSGDASLY3J6ALH"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/reab1c277c95310bad1038255e0757857b2fbe291411b4fa84552028a%40%3Cdev.logging.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/rdbac24c945ca5c69cd5348b5ac023bc625768f653335de146e09ae2d@%3Cdev.logging.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/rd2d72a017e238d1f345f9d14e075c81be16fc68a41c9e9ad9e29a732@%3Cdev.logging.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r9de86a185575e6c5f92e2a70a1d2e2e9514dc4341251577aac8e3866@%3Cdev.logging.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r7ab6b6e702f11a6f77b0db2af2d5e5532f56ae4b99b5fe73c5200b6a@%3Cdev.logging.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r6543acafca3e2d24ff4b0c364a91540cb9378977ffa8d37a03ab4b0f@%3Cdev.logging.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r525cbbd7db0aef4a114cf60de8439aa285decc34904d42a7f14f39c3@%3Cdev.logging.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r33564de316d4e4ba0fea1d4d079e62cde1ffe64369c1157243d840d9@%3Cdev.logging.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r00b16ac5e0bbf7009a0d167ed58f3f94d0033b0f4b3e3d5025cc4872@%3Cdev.logging.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://issues.apache.org/jira/browse/LOG4NET-575"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/apache/logging-log4net"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-611" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-01-29T19:47:10Z",
    "nvd_published_at" : "2020-05-11T17:15:00Z"
  }
}