Skip to content

Commit c215cb6

Browse files
committed
Check security bugs reported in other modules
1 parent 6686e72 commit c215cb6

File tree

6 files changed

+33
-3
lines changed

6 files changed

+33
-3
lines changed

log4j-flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumePersistentManager.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
import com.sleepycat.je.OperationStatus;
4848
import com.sleepycat.je.StatsConfig;
4949
import com.sleepycat.je.Transaction;
50+
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
5051
import org.apache.flume.Event;
5152
import org.apache.flume.event.SimpleEvent;
5253
import org.apache.logging.log4j.LoggingException;
@@ -172,6 +173,10 @@ public static FlumePersistentManager getManager(final String name, final Agent[]
172173
}
173174

174175
@Override
176+
@SuppressFBWarnings(
177+
value = {"CIPHER_INTEGRITY", "ECB_MODE"},
178+
justification = "Work-in-progress: https://github.com/apache/logging-log4j2/issues/1947"
179+
)
175180
public void send(final Event event) {
176181
if (worker.isShutdown()) {
177182
throw new LoggingException("Unable to record event");
@@ -381,6 +386,10 @@ private static class BDBManagerFactory implements ManagerFactory<FlumePersistent
381386
* @return The FlumeKratiManager.
382387
*/
383388
@Override
389+
@SuppressFBWarnings(
390+
value = "PATH_TRAVERSAL_IN",
391+
justification = "The name of the directory is provided in a configuration file."
392+
)
384393
public FlumePersistentManager createManager(final String name, final FactoryData data) {
385394
SecretKey secretKey = null;
386395
Database database = null;
@@ -786,6 +795,10 @@ private boolean sendBatch(DatabaseEntry key, final DatabaseEntry data) throws Ex
786795
return errors;
787796
}
788797

798+
@SuppressFBWarnings(
799+
value = {"CIPHER_INTEGRITY", "ECB_MODE"},
800+
justification = "Work-in-progress: https://github.com/apache/logging-log4j2/issues/1947"
801+
)
789802
private SimpleEvent createEvent(final DatabaseEntry data) {
790803
final SimpleEvent event = new SimpleEvent();
791804
try {

log4j-flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/package-info.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
@Export
2121
@Open("org.apache.logging.log4j.core")
22-
@Version("2.20.1")
22+
@Version("2.20.2")
2323
package org.apache.logging.log4j.flume.appender;
2424

2525
import aQute.bnd.annotation.jpms.Open;

log4j-jul/src/main/java/org/apache/logging/log4j/jul/Log4jBridgeHandler.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import java.util.Set;
2626
import java.util.logging.LogRecord;
2727

28+
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
2829
import org.apache.logging.log4j.core.LoggerContext;
2930
import org.apache.logging.log4j.core.config.Configuration;
3031
import org.apache.logging.log4j.core.config.LoggerConfig;
@@ -134,7 +135,11 @@ public Log4jBridgeHandler(boolean debugOutput, String suffixToAppend, boolean pr
134135

135136

136137
/** Perform init. of this handler with given configuration (typical use is for constructor). */
137-
protected void init(boolean debugOutput, String suffixToAppend, boolean propagateLevels) {
138+
@SuppressFBWarnings(
139+
value = "INFORMATION_EXPOSURE_THROUGH_AN_ERROR_MESSAGE",
140+
justification = "The data is available only in debug mode."
141+
)
142+
protected void init(boolean debugOutput, String suffixToAppend, boolean propagateLevels) {
138143
this.doDebugOutput = debugOutput;
139144
if (debugOutput) {
140145
new Exception("DIAGNOSTIC ONLY (sysout): Log4jBridgeHandler instance created (" + this + ")")

log4j-jul/src/main/java/org/apache/logging/log4j/jul/package-info.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* limitations under the license.
1616
*/
1717
@Export
18-
@Version("2.20.1")
18+
@Version("2.20.2")
1919
package org.apache.logging.log4j.jul;
2020

2121
import org.osgi.annotation.bundle.Export;

log4j-layout-template-json/src/main/java/org/apache/logging/log4j/layout/template/json/util/Uris.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import java.util.List;
3131
import java.util.Objects;
3232

33+
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
3334
import org.apache.logging.log4j.Logger;
3435
import org.apache.logging.log4j.status.StatusLogger;
3536
import org.apache.logging.log4j.util.LoaderUtil;
@@ -93,6 +94,10 @@ private static String unsafeReadUri(
9394
}
9495
}
9596

97+
@SuppressFBWarnings(
98+
value = "PATH_TRAVERSAL_IN",
99+
justification = "The uri parameter comes from aconfiguration file."
100+
)
96101
private static String readFileUri(
97102
final URI uri,
98103
final Charset charset)
@@ -103,6 +108,10 @@ private static String readFileUri(
103108
}
104109
}
105110

111+
@SuppressFBWarnings(
112+
value = "URLCONNECTION_SSRF_FD",
113+
justification = "The uri parameter comes fro a configuration file."
114+
)
106115
private static String readClassPathUri(
107116
final URI uri,
108117
final Charset charset)

log4j-perf-test/pom.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
<description>The Apache Log4j development-time performance tests</description>
3131

3232
<properties>
33+
<!-- Ignore less important (high rank) bugs for test artifacts -->
34+
<spotbugs.maxRank>9</spotbugs.maxRank>
35+
3336
<uberjar.name>benchmarks</uberjar.name>
3437
<bnd.baseline.skip>true</bnd.baseline.skip>
3538
<maven.test.skip>true</maven.test.skip>

0 commit comments

Comments
 (0)