Mitigate the Log4Shell vulnerability with Microsoft Defender Vulnerability Management
In brief
The article title and date were updated, Log4j file-detection details were clarified, JNDI mitigation terminology was expanded, and descriptions for advanced hunting queries were added or refined.
What Defender admins need to know
Administrators get clearer guidance for enabling Log4j detection, reviewing mitigation status, and identifying affected software and files. No required action is stated.
Summaries are generated from the documentation change itself.
Documentation change
The comparison below shows only the changed extract. Use the full-page view for complete context.
Defender Vulnerability Management provides you with the following capabilities to help you identify, monitor, and mitigate your organizational exposure to the Log4Shell vulnerability:
- Discovery: Detection of exposed devices, both Microsoft Defender for Endpoint onboarded devices and devices that have been discovered but aren't yet onboarded, is based on vulnerable software and vulnerable files detected on disk.
- Threat awareness: A consolidated view to assess your organizational exposure. This view shows your exposure at the device level and software level. It also provides access to details on vulnerable files. For example, you can see when a file was last seen, last executed, and last executed with open ports. Use this information to prioritize your remediation actions.
ItExposed device data can take up to 24 hoursfor exposed device datato appear on the dashboard. - Mitigation options: Apply mitigation options to help lower your exposure risk.
- Advanced hunting: Use advanced hunting to return details for vulnerable log4j files identified on disk.
Onboarded devices are assessed using built-in capabilities that discover vulnerable software and files.
For devices that are discovered but not yet onboarded, you must enable Log4j detection. This featureLog4j detection sends probes the same way device discovery probes your network. The probes run from onboarded endpoints (Windows 10+ and Windows Server 2019+ devices). They only probe within subnets to find devices that are vulnerable and remotely exposed to CVE-2021-44228.
To enable Log4 detection:
:::image type="content" source="media/enable-log4j.png" alt-text="Screenshot of setting to enable log4j2 detection." lightbox="media/enable-log4j.png":::
Running these probes triggers the standard Log4j flow without causing any harmful impact on either the device being probed or the probing device. The probing itself is done by sending multiple HTTP requests to discovered devices, targeting common web application ports (for example - 80,8000,8080,443,8443) and URLs. The request contains HTTP headers with a JNDI payload. This payload that triggers a DNS request from the probed machine.
For example, User-Agent: ${jndi:dns://192.168.1.3:5353/MDEDiscoveryUser-Agent} where 192.168.1.3 is the IP of the probing machine.
Vulnerable files: Both files in memory and files in the file system are assessed. These files can be Log4j-core jar files with a known vulnerable version. They can also be an Uber-JAR that contains a vulnerable JNDI lookup class or a vulnerable log4j-core file. The file detection process performs these checks:
- Examines JAR files and searches for the file:
\META-INF\maven\org.apache.logging.log4j\log4j-core\pom.properties. If
this filepom.properties exists, the Log4j version is read and extracted. - Looks for the JndiLookup.class file inside the JAR file. It searches for paths that contain the string "/log4j/core/lookup/JndiLookup.class". If
thisJndiLookup.classfileexists, the tool checks whether the JAR contains a Log4j version defined in pom.properties. - Searches for vulnerable Log4j-core JAR files inside a nested JAR. It looks for paths that contain any of these strings:
- lib/log4j-core-
- WEB-INF/lib/log4j-core-
- Examines JAR files and searches for the file:
\META-INF\maven\org.apache.logging.log4j\log4j-core\pom.properties. If
Log4Shell vulnerability mitigation
Java Naming and Directory Interface (JNDI) lookups are a Log4j feature that attackers can abuse to execute remote code. The log4ShellLog4Shell vulnerability can be mitigated by preventing JNDI lookups on Log4j versions 2.10 - 2.14.1 with default configurations. To create a mitigation action that disables JNDI lookups, from the Threat awareness dashboard:
- Select View vulnerability details.
Mitigation status
The mitigation status indicates whether the workaround mitigation to disable JDNIJNDI lookups (described in the previous section) was applied to the device. You can view the mitigation status for each affected device in the Exposed devices tabs. ThisReviewing the mitigation status can help prioritize mitigation and/orand patching of devices based on their mitigation status.devices.
:::image type="content" source="media/mitigation-status.png" alt-text="Screenshot of Possible mitigation statuses." lightbox="media/mitigation-status.png":::
Use advanced hunting
Advanced hunting queries for Log4Shell
Advanced hunting lets you query for Log4j issues across your devices. Use the examples below to get started.
ThisThe following query findsidentifies devices with vulnerable software:software affected by the Log4j CVEs (CVE-2021-44228 and CVE-2021-45046):
DeviceTvmSoftwareVulnerabilities
| where CveId in ("CVE-2021-44228", "CVE-2021-45046")
ThisThe following query shows file-level results from disk:searches software evidence and disk paths to find Log4j-related files on each device:
DeviceTvmSoftwareEvidenceBeta
@@ -1,5 +1,5 @@ ----title: Learn how to mitigate the Log4Shell vulnerability in Microsoft Defender for Endpoint - Defender Vulnerability Management+title: Mitigate the Log4Shell vulnerability with Microsoft Defender Vulnerability Management description: Use Microsoft Defender Vulnerability Management to discover, monitor, and mitigate Log4Shell (CVE-2021-44228) exposure across your devices with security recommendations and advanced hunting. ms.service: defender-vuln-mgmt ms.author: lwainstein@@ -13,7 +13,7 @@ ms.custom: - admindeeplinkDEFENDER - sfi-image-nochange ms.topic: how-to-ms.date: 06/12/2026+ms.date: 07/02/2026 ai-usage: ai-assisted --- @@ -33,7 +33,7 @@ The Log4Shell vulnerability is a remote code execution (RCE) vulnerability found Defender Vulnerability Management provides you with the following capabilities to help you identify, monitor, and mitigate your organizational exposure to the Log4Shell vulnerability: - **Discovery**: Detection of exposed devices, both Microsoft Defender for Endpoint onboarded devices and devices that have been discovered but aren't yet onboarded, is based on vulnerable software and vulnerable files detected on disk.-- **Threat awareness:** A consolidated view to assess your organizational exposure. This view shows your exposure at the device level and software level. It also provides access to details on vulnerable files. For example, you can see when a file was last seen, last executed, and last executed with open ports. Use this information to prioritize your remediation actions. It can take up to 24 hours for exposed device data to appear on the dashboard.+- **Threat awareness:** A consolidated view to assess your organizational exposure. This view shows your exposure at the device level and software level. It also provides access to details on vulnerable files. For example, you can see when a file was last seen, last executed, and last executed with open ports. Use this information to prioritize your remediation actions. Exposed device data can take up to 24 hours to appear on the dashboard. - **Mitigation options:** Apply mitigation options to help lower your exposure risk. - **Advanced hunting:** Use advanced hunting to return details for vulnerable log4j files identified on disk. @@ -52,7 +52,7 @@ Defender Vulnerability Management capabilities in the Microsoft Defender portal Onboarded devices are assessed using built-in capabilities that discover vulnerable software and files. -For devices that are discovered but not yet onboarded, you must enable Log4j detection. This feature sends probes the same way device discovery probes your network. The probes run from onboarded endpoints (Windows 10+ and Windows Server 2019+ devices). They only probe within subnets to find devices that are vulnerable and remotely exposed to CVE-2021-44228.+For devices that are discovered but not yet onboarded, you must enable Log4j detection. Log4j detection sends probes the same way device discovery probes your network. The probes run from onboarded endpoints (Windows 10+ and Windows Server 2019+ devices). They only probe within subnets to find devices that are vulnerable and remotely exposed to CVE-2021-44228. To enable Log4 detection: @@ -64,7 +64,7 @@ To enable Log4 detection: :::image type="content" source="media/enable-log4j.png" alt-text="Screenshot of setting to enable log4j2 detection." lightbox="media/enable-log4j.png"::: -Running these probes triggers the standard Log4j flow without causing any harmful impact on either the device being probed or the probing device. The probing itself is done by sending multiple HTTP requests to discovered devices, targeting common web application ports (for example - 80,8000,8080,443,8443) and URLs. The request contains HTTP headers with a JNDI payload. This payload triggers a DNS request from the probed machine.+Running these probes triggers the standard Log4j flow without causing any harmful impact on either the device being probed or the probing device. The probing itself is done by sending multiple HTTP requests to discovered devices, targeting common web application ports (for example - 80,8000,8080,443,8443) and URLs. The request contains HTTP headers with a JNDI payload that triggers a DNS request from the probed machine. For example, User-Agent: ${jndi:dns://192.168.1.3:5353/MDEDiscoveryUser-Agent} where 192.168.1.3 is the IP of the probing machine. @@ -79,8 +79,8 @@ Defender Vulnerability Management provides layers of detection to help you disco - **Vulnerable files:** Both files in memory and files in the file system are assessed. These files can be Log4j-core jar files with a known vulnerable version. They can also be an Uber-JAR that contains a vulnerable JNDI lookup class or a vulnerable log4j-core file. The file detection process performs these checks: - Examines JAR files and searches for the file:- \\META-INF\\maven\\org.apache.logging.log4j\\log4j-core\\pom.properties. If this file exists, the Log4j version is read and extracted.- - Looks for the JndiLookup.class file inside the JAR file. It searches for paths that contain the string "/log4j/core/lookup/JndiLookup.class". If this class file exists, the tool checks whether the JAR contains a Log4j version defined in pom.properties.+ \\META-INF\\maven\\org.apache.logging.log4j\\log4j-core\\pom.properties. If pom.properties exists, the Log4j version is read and extracted.+ - Looks for the JndiLookup.class file inside the JAR file. It searches for paths that contain the string "/log4j/core/lookup/JndiLookup.class". If JndiLookup.class exists, the tool checks whether the JAR contains a Log4j version defined in pom.properties. - Searches for vulnerable Log4j-core JAR files inside a nested JAR. It looks for paths that contain any of these strings: - lib/log4j-core- - WEB-INF/lib/log4j-core-@@ -113,7 +113,7 @@ To review your organization's Log4Shell exposure and available mitigation option ### Log4Shell vulnerability mitigation -The log4Shell vulnerability can be mitigated by preventing JNDI lookups on Log4j versions 2.10 - 2.14.1 with default configurations. To create a mitigation action that disables JNDI lookups, from the **Threat awareness dashboard**:+Java Naming and Directory Interface (JNDI) lookups are a Log4j feature that attackers can abuse to execute remote code. The Log4Shell vulnerability can be mitigated by preventing JNDI lookups on Log4j versions 2.10 - 2.14.1 with default configurations. To create a mitigation action that disables JNDI lookups, from the **Threat awareness dashboard**: 1. Select **View vulnerability details**. @@ -125,7 +125,7 @@ You can choose to apply the mitigation to all exposed devices or select specific ### Mitigation status -The mitigation status indicates whether the workaround mitigation to disable JDNI lookups was applied to the device. You can view the mitigation status for each affected device in the Exposed devices tabs. This can help prioritize mitigation and/or patching of devices based on their mitigation status.+The mitigation status indicates whether the workaround mitigation to disable JNDI lookups (described in the previous section) was applied to the device. You can view the mitigation status for each affected device in the Exposed devices tabs. Reviewing the mitigation status can help prioritize mitigation and patching of devices. :::image type="content" source="media/mitigation-status.png" alt-text="Screenshot of Possible mitigation statuses." lightbox="media/mitigation-status.png"::: @@ -209,16 +209,18 @@ In the **Vulnerabilities** or **Weaknesses** page, search for **CVE-2021-44228** ## Use advanced hunting +### Advanced hunting queries for Log4Shell+ Advanced hunting lets you query for Log4j issues across your devices. Use the examples below to get started. -This query finds devices with vulnerable software:+The following query identifies devices with software affected by the Log4j CVEs (CVE-2021-44228 and CVE-2021-45046): ```kusto DeviceTvmSoftwareVulnerabilities | where CveId in ("CVE-2021-44228", "CVE-2021-45046") ``` -This query shows file-level results from disk:+The following query searches software evidence and disk paths to find Log4j-related files on each device: ```text DeviceTvmSoftwareEvidenceBeta 