Repository navigation
Upgrade mysql-connector-java 5.1.42 -> 8.0.28 (CVE-2022-21363) - #584
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Author
There was a problem hiding this comment.
🔍 Devin Review: 1 flag
Not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)
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.
Summary
Fixes code scan finding
sfind-9842fe06(SnykSNYK-JAVA-MYSQL-2386864, CVE-2022-21363, CWE-285, medium).UserFrontwas pullingmysql:mysql-connector-java@5.1.42through the Boot 1.5.4 BOM. This PR overrides the BOM property with the smallest version that fixes it:spring.datasource.url = jdbc:mysql://localhost:3306/onlinebanking +spring.datasource.driver-class-name = com.mysql.cj.jdbc.Drivermysql:mysql-connector-javacoordinates, so only the version property changes. Java stays at 1.8, the Boot parent is unchanged, and there is no Snyk ignore.protobuf-javaexclusion: Connector/J 8.0.28 pulls in protobuf-java 3.11.4, which only the X DevAPI uses. The app talks to MySQL over JDBC and Hibernate only. Excluding it avoids bringing in the protobuf CVEs that Snyk flags on 3.11.x.driver-class-name: Boot 1.5 infers the legacy classcom.mysql.jdbc.Driverfrom the URL. In 8.x that class is a deprecated shim that logs a warning on every startup. NoserverTimezoneis needed on 8.0.23 and later.Duplicate notice: this is the same change as open PR #294 (
sfind-e088ed1a). It is opened as a separate PR because a new finding was raised. Only one of them should be merged.Verification
The session's network is restricted to an allowlist, and Maven Central and
api.snyk.ioare not on it (access was requested but not granted). The Boot 1.5.4 artifacts and Connector/J 8.0.28 are not cached locally. As a result:mvn clean compile/mvn testbuild against Boot 1.5.4 + 8.0.28, and the Snyk re-scan.snyk testfails because the API is unreachable, so there are no before/after issue counts from Snyk. The expected result is thatSNYK-JAVA-MYSQL-2386864drops out, and so do the other 5.1.42 issues (CVE-2021-2471, CVE-2019-2692, CVE-2018-3258…).UserFrontwith this PR'spom.xml/application.properties. The parent was moved to the cached Boot 2.7.18, givingcom.mysql:mysql-connector-j:8.0.33, the same 8.xcom.mysql.cj.jdbc.Drivercode path. Run against amysql:5.7.44container (same dialect as theMySQL5Dialectconfig):UserFrontApplicationTests.contextLoads:OK (1 test). Hikari pool started, and Hibernate created all 9 tables.java -jarboot plus a curl run-through: signup302 -> /, loginPOST /index302 -> /userFront, deposit 250 to Primary302 -> /userFront. The DB showsada | 250.00and aDeposit to Primary Account | 250 | Finishedtransaction.mysql-connector-j-8.0.33.jarand noprotobuf-java.Devin-Org: engineering
Link to Devin session: https://devin-gtm.devinenterprise.com/sessions/63303a4858fa473d8783145caf175e8a
Open in Devin Desktop: https://devin-gtm.devinenterprise.com/desktop/session/63303a4858fa473d8783145caf175e8a?variant=devin
Devin Review