Skip to content
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

[PF-2978] High severity security issue - Upgrade logback-core #127

Merged
merged 1 commit into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ dependencies {
implementation group: 'com.google.apis', name: 'google-api-services-logging', version: 'v2-rev20220714-1.32.1'
implementation group: 'ch.qos.logback.contrib', name: 'logback-json-classic', version: '0.1.5'
implementation group: 'ch.qos.logback.contrib', name: 'logback-jackson', version: '0.1.5'
implementation group: 'ch.qos.logback', name: 'logback-core', version: '1.4.14'
implementation group: 'ch.qos.logback', name: 'logback-classic', version: '1.4.14'

// Flagsmith
implementation group: 'com.flagsmith', name: 'flagsmith-java-client', version: '6.1.0'
Expand Down
4 changes: 2 additions & 2 deletions gradle.lockfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ bio.terra:stairway:0.0.76-SNAPSHOT=compileClasspath,productionRuntimeClasspath,r
ch.qos.logback.contrib:logback-jackson:0.1.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
ch.qos.logback.contrib:logback-json-classic:0.1.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
ch.qos.logback.contrib:logback-json-core:0.1.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
ch.qos.logback:logback-classic:1.4.8=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
ch.qos.logback:logback-core:1.4.8=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
ch.qos.logback:logback-classic:1.4.14=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
ch.qos.logback:logback-core:1.4.14=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
com.beust:jcommander:1.48=pmd
com.fasterxml.jackson.core:jackson-annotations:2.15.2=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
com.fasterxml.jackson.core:jackson-core:2.15.2=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/bio/terra/common/logging/LoggingUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import org.slf4j.LoggerFactory;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.util.ResourceUtils;

/**
* Logging utility methods intended for use by service / app developers. These are generally aimed
Expand Down Expand Up @@ -119,8 +118,7 @@ protected static void initializeLogging(ConfigurableApplicationContext applicati
// seems to work. But if we encounter future issues in human-readable logging control, this
// is a reasonable place to look more closely.
logbackLogger.detachAndStopAllAppenders();
new ContextInitializer(logbackLogger.getLoggerContext())
.configureByResource(ResourceUtils.getURL("classpath:logback.xml"));
new ContextInitializer(logbackLogger.getLoggerContext()).autoConfig();
Copy link
Contributor Author

@rtitle rtitle Dec 4, 2023

Choose a reason for hiding this comment

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

I think this is the same thing. The old method was deprecrated and now removed, and said:

    /**
     * This method is deprecated with no replacement
     * @param url
     * @throws JoranException
     */
    @Deprecated
    public void configureByResource(URL url) throws JoranException {

https://github.com/qos-ch/logback/blob/v_1.4.8/logback-classic/src/main/java/ch/qos/logback/classic/util/ContextInitializer.java#L55-L61

} catch (Exception e) {
throw new RuntimeException("Error loading human-readable logging", e);
}
Expand Down