{"answers":{"affected":"2 open source packages ship an affected version, including log4net. It affects 1 product.","exploited":"There is no known exploitation of CVE-2026-40021 in the wild and no public exploit code.","fix":"Upgrade log4net to 3.3.0 or later.","what":"CVE-2026-40021 is a medium-severity vulnerability in Apache Log4net, published on 10 Apr 2026. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2026-40021 and fix it if it is affected.\n\nWhat it is: CVE-2026-40021 is a medium-severity vulnerability in Apache Log4net, published on 10 Apr 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2026-40021 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- log4net (NuGet): affected all versions; fixed in 3.3.0\n- log4net (NuGet): affected all versions; fixed in 3.3.0\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2026-40021/ (Markdown: https://insights.sbomify.com/CVE-2026-40021/index.md)","id":"CVE-2026-40021","markdown":"https://insights.sbomify.com/CVE-2026-40021/index.md","name":"CVE-2026-40021","record":{"aliases":["DEBIAN-CVE-2026-40021","ECHO-b32c-0992-129e","GHSA-4f7c-pmjv-c25w","UBUNTU-CVE-2026-40021"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["data_modify","security_bypass"],"network_reachable":"yes","non_default_config":false,"product_category":"Apache Log4net library","requires_auth":"none","summary":"Attackers can suppress log records by injecting forbidden XML characters, impairing audit trails and detection in applications using Apache Log4net.","user_interaction":"not_required","vuln_class":"other"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"apache","cpe":[{"product":"log4net","vendor":"apache"}],"cvss":{"score":6.3,"severity":"medium","source":"cna","vector":"CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:N/SI:L/SA:N","version":"4.0"},"cwes":[{"id":"CWE-116","name":"Improper Encoding or Escaping of Output"}],"description":"Apache Log4net's  XmlLayout https://logging.apache.org/log4net/manual/configuration/layouts.html#layout-list  and  XmlLayoutSchemaLog4J https://logging.apache.org/log4net/manual/configuration/layouts.html#layout-list , in versions before 3.3.0, fail to sanitize characters forbidden by the  XML 1.0 specification https://www.w3.org/TR/xml/#charsets  in MDC property keys and values, as well as the identity field that may carry attacker-influenced data. This causes an exception during serialization and the silent loss of the affected log event.\n\nAn attacker who can influence any of these fields can exploit this to suppress individual log records, impairing audit trails and detection of malicious activity.\n\nUsers are advised to upgrade to Apache Log4net 3.3.0, which fixes this issue.","ecosystems":["NuGet"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"Apache Log4net: Silent log event loss in XmlLayout and XmlLayoutSchemaLog4J due to unescaped XML 1.0 forbidden characters","id":"CVE-2026-40021","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"NuGet","product":null,"products":[],"type":"other","year":"2026"},"n_packages":2,"n_references":5,"next":{"headline":"Apache Camel Platform HTTP Main: Authentication Bypass on Non-Root Context Paths in camel main runtime","id":"CVE-2026-40022"},"packages":[{"ecosystem":"NuGet","fixed":["3.3.0"],"introduced":["0"],"last_affected":[],"package":"log4net","purl":null,"source":"GHSA-4f7c-pmjv-c25w"},{"ecosystem":"NuGet","fixed":["3.3.0"],"introduced":["0"],"last_affected":[],"package":"log4net","purl":"pkg:nuget/log4net","source":"GHSA-4f7c-pmjv-c25w"}],"prev":{"headline":"Attacker can use the IMAP SETACL command to inject the anyone permission to user's dovecot-acl file even if imap_acl_allow_anyone=no.","id":"CVE-2026-40020"},"products":["Apache Log4net"],"published":"2026-04-10","related":[{"cvss_score":9.8,"headline":"XML External Entity attack in log4net","id":"CVE-2018-1285","kev_date_added":null,"published":"2020-05-11"},{"cvss_score":5.3,"headline":"Apache log4net: NUL character truncates EventLogAppender records","id":"CVE-2026-105239","kev_date_added":null,"published":"2026-10-06"},{"cvss_score":5.3,"headline":"Apache log4net: NUL character truncates OutputDebugStringAppender records","id":"CVE-2026-105240","kev_date_added":null,"published":"2026-10-06"},{"cvss_score":5.3,"headline":"Apache log4net: Unencodable content discards a whole SmtpPickupDirAppender batch","id":"CVE-2026-105241","kev_date_added":null,"published":"2026-10-06"},{"cvss_score":5.3,"headline":"Apache log4net: Request validation failure drops the event in the aspnet-request converter","id":"CVE-2026-105242","kev_date_added":null,"published":"2026-10-06"},{"cvss_score":5.3,"headline":"Apache log4net: Oversize EventLogAppender record silently discarded","id":"CVE-2026-105243","kev_date_added":null,"published":"2026-10-06"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"none","technical_impact":"partial"},"state":"PUBLISHED","updated":"2026-04-10","vendors":["Apache Software Foundation"]},"summary":"Attackers can suppress log records by injecting forbidden XML characters, impairing audit trails and detection in applications using Apache Log4net.","url":"https://insights.sbomify.com/CVE-2026-40021/"}