Skip to content

Port log4j-api changes from 2.x #2208

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 26, 2024
Merged

Port log4j-api changes from 2.x #2208

merged 3 commits into from
Jan 26, 2024

Conversation

ppkarwasz
Copy link
Contributor

@ppkarwasz ppkarwasz commented Jan 17, 2024

This PR is based on #2203 and should be merged after it.

It ports to main the changes in:

@ppkarwasz ppkarwasz self-assigned this Jan 23, 2024
vy and others added 3 commits January 26, 2024 10:09
We change the order in which `FormattedMessage` checks the format of the
provided pattern: we first check for the presence of `{}` placeholders
and only then for `java.util.Format` specifiers.

This eliminates the need for a potentially exponential regular
expression evalutation, which was reported by Spotbugs (apache#1849).

The Javadoc and documentation were improved to clarify the heuristic
used by `FormattedMessage`.

Closes apache#1223.

Remark: since `FormattedMessage` used the **same** regular expression as
`java.util.Format`, if a message uses `java.util.Format` specifiers, it
is still vulnerable to a ReDOS.
Ports minor changes in `log4j-api` from `2.x`.
@ppkarwasz ppkarwasz merged commit 67be357 into apache:main Jan 26, 2024
@ppkarwasz ppkarwasz deleted the sync2-api branch February 15, 2024 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants