Skip to content

[fix][sec] Upgrade log4j to 2.25.4 to address CVE-2026-34477, CVE-2026-34478, CVE-2026-34480, CVE-2026-34481 - #25521

Merged
merlimat merged 2 commits into
apache:masterfrom
merlimat:mmerli/upgrade-log4j-2.25.4
Apr 15, 2026
Merged

[fix][sec] Upgrade log4j to 2.25.4 to address CVE-2026-34477, CVE-2026-34478, CVE-2026-34480, CVE-2026-34481#25521
merlimat merged 2 commits into
apache:masterfrom
merlimat:mmerli/upgrade-log4j-2.25.4

Conversation

@merlimat

Copy link
Copy Markdown
Contributor

Motivation

log4j 2.25.3 is affected by four CVEs fixed in 2.25.4:

  • CVE-2026-34477verifyHostName attribute in <Ssl> configuration was silently ignored in all versions since 2.12.0. TLS connections from SMTP, Socket, and Syslog appenders configured via the nested <Ssl> element were not verifying hostnames, enabling MITM attacks. The fix for CVE-2025-68161 was incomplete and only addressed the log4j2.sslVerifyHostName system property path.
  • CVE-2026-34478Rfc5424Layout silently renamed newLineEscape and useTlsMessageFormat attributes in 2.21.0, causing CRLF injection for TCP framing users and a silent TLS-to-plain-TCP downgrade for RFC 5425 users.
  • CVE-2026-34480XmlLayout did not sanitize characters forbidden by XML 1.0, producing invalid XML when log messages or MDC values contained them. Depending on the StAX implementation, this either emits malformed XML or throws during the logging call and drops the event.
  • CVE-2026-34481JsonTemplateLayout produced invalid JSON (NaN / Infinity / -Infinity) for MapMessage entries containing non-finite floats, which downstream log processors reject per RFC 8259.

None of these affect Pulsar users with the default log4j2.yaml configuration, but shipping library versions with known vulnerabilities trips code scanning and downstream security audits.

Modifications

  • Bump log4j2 version in gradle/libs.versions.toml from 2.25.3 to 2.25.4
  • Update server and shell distribution LICENSE.bin.txt to reflect the new jar versions

…6-34478, CVE-2026-34480, CVE-2026-34481

Upgrades org.apache.logging.log4j:* from 2.25.3 to 2.25.4 to fix:
- CVE-2026-34477: verifyHostName attribute silently ignored in TLS configuration
- CVE-2026-34478: log injection in Rfc5424Layout due to silent configuration incompatibility
- CVE-2026-34480: XmlLayout fails to sanitize characters forbidden by XML 1.0
- CVE-2026-34481: JsonTemplateLayout produces invalid JSON for non-finite floats

@utafrali utafrali left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean, minimal security patch that bumps log4j2 from 2.25.3 to 2.25.4 and keeps the LICENSE.bin.txt files in sync. The changes are correct, well-motivated, and follow the project's standard dependency management pattern.

@merlimat
merlimat merged commit dfb06f1 into apache:master Apr 15, 2026
79 of 81 checks passed
@merlimat
merlimat deleted the mmerli/upgrade-log4j-2.25.4 branch April 15, 2026 16:11
lhotari pushed a commit that referenced this pull request Apr 21, 2026
…6-34478, CVE-2026-34480, CVE-2026-34481 (#25521)

Upgrades org.apache.logging.log4j:* from 2.25.3 to 2.25.4 to fix:
- CVE-2026-34477: verifyHostName attribute silently ignored in TLS configuration
- CVE-2026-34478: log injection in Rfc5424Layout due to silent configuration incompatibility
- CVE-2026-34480: XmlLayout fails to sanitize characters forbidden by XML 1.0
- CVE-2026-34481: JsonTemplateLayout produces invalid JSON for non-finite floats

(cherry picked from commit dfb06f1)
lhotari pushed a commit that referenced this pull request Apr 21, 2026
…6-34478, CVE-2026-34480, CVE-2026-34481 (#25521)

Upgrades org.apache.logging.log4j:* from 2.25.3 to 2.25.4 to fix:
- CVE-2026-34477: verifyHostName attribute silently ignored in TLS configuration
- CVE-2026-34478: log injection in Rfc5424Layout due to silent configuration incompatibility
- CVE-2026-34480: XmlLayout fails to sanitize characters forbidden by XML 1.0
- CVE-2026-34481: JsonTemplateLayout produces invalid JSON for non-finite floats

(cherry picked from commit dfb06f1)
priyanshu-ctds pushed a commit to datastax/pulsar that referenced this pull request Apr 22, 2026
…6-34478, CVE-2026-34480, CVE-2026-34481 (apache#25521)

Upgrades org.apache.logging.log4j:* from 2.25.3 to 2.25.4 to fix:
- CVE-2026-34477: verifyHostName attribute silently ignored in TLS configuration
- CVE-2026-34478: log injection in Rfc5424Layout due to silent configuration incompatibility
- CVE-2026-34480: XmlLayout fails to sanitize characters forbidden by XML 1.0
- CVE-2026-34481: JsonTemplateLayout produces invalid JSON for non-finite floats

(cherry picked from commit dfb06f1)
(cherry picked from commit 8778389)
nodece pushed a commit to ascentstream/pulsar that referenced this pull request May 12, 2026
…6-34478, CVE-2026-34480, CVE-2026-34481 (apache#25521)

Upgrades org.apache.logging.log4j:* from 2.25.3 to 2.25.4 to fix:
- CVE-2026-34477: verifyHostName attribute silently ignored in TLS configuration
- CVE-2026-34478: log injection in Rfc5424Layout due to silent configuration incompatibility
- CVE-2026-34480: XmlLayout fails to sanitize characters forbidden by XML 1.0
- CVE-2026-34481: JsonTemplateLayout produces invalid JSON for non-finite floats

(cherry picked from commit dfb06f1)
@lhotari lhotari added this to the 5.0.0-M1 milestone Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants