Conversation
vlsi
force-pushed
the
jdbc_cve
branch
5 times, most recently
from
January 19, 2022 18:49
8754302 to
790735f
Compare
vlsi
commented
Jan 19, 2022
vlsi
commented
Jan 19, 2022
vlsi
force-pushed
the
jdbc_cve
branch
7 times, most recently
from
January 20, 2022 10:38
e845f28 to
362d349
Compare
This reverts commit 527f537. Signed-off-by: Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
By default the appender would treat '....%..' as string literals, and it would use PreparedStatement.setString(..) for that. Old behavior can be restored via org.apache.log4j.jdbc.JDBCAppender.securejdbc_replacement=false. Signed-off-by: Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
vlsi
commented
Jan 21, 2022
| import java.util.regex.Pattern; | ||
|
|
||
| class JdbcPatternParser { | ||
| private final static Pattern STRING_LITERAL_PATTERN = Pattern.compile("'((?>[^']|'')+)'"); |
Contributor
Author
There was a problem hiding this comment.
The atomic group is needed here to prevent StackOverflowError like in https://bugs.java.com/bugdatabase/view_bug.do?bug_id=6337993
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
By default, the appender would treat '....%..' as string literals,
and it would use PreparedStatement.setString(..) for that.
Old behavior can be restored via
org.apache.log4j.jdbc.JDBCAppender.secure_jdbc_replacement=false.UPD: as
JDBCAppenderhas been removed, the diff was looking as if I added the class from scratch. So I've split the PR in two commits: "revert JDBCAppender removal" and then "fix CVE". I believe it makes it easier to see what has changed to fix the CVE.