Repository navigation
bug(security): upgrade mysql-connector-java 5.1.42 -> 8.0.16 (CVE-2019-2692) - #573
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
… SNYK-JAVA-MYSQL-174574)
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
| <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
| <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> | ||
| <java.version>1.8</java.version> | ||
| <mysql.version>8.0.16</mysql.version> |
There was a problem hiding this comment.
🔴 Database startup fails in some time zones
When MySQL reports CEST, mysql.version 8.0.16 rejects the connection without an explicit time zone. The configured JDBC URL supplies none, so the application fails to start.
Learn more
Connector/J 8.0.16 cannot map some server-reported time-zone abbreviations to Java time zones. The application's JDBC URL has no serverTimezone parameter, so a MySQL server reporting an abbreviation such as CEST can prevent datasource initialization during startup. This affects deployments using those server settings; UTC servers do not trigger this failure.
Example: A deployment connects to MySQL reporting CEST. Connector/J rejects that abbreviation during connection setup, and the banking application never finishes starting. With a recognized time zone specified in the JDBC URL, the connection can initialize.
Recommended fix: Provide a recognized serverTimezone value through the JDBC URL in application properties, selecting the actual database time zone rather than hard-coding UTC for servers in another zone. Verify startup against a server configured to report CEST.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Agreed that this can happen: Connector/J 8.0.16–8.0.22 rejects time-zone abbreviations it can't map (e.g. CEST). The PR description already calls this out as a review note.
I left serverTimezone out of this PR on purpose:
- The right value depends on how the target MySQL server is configured, and the repo doesn't record that. The local MySQL 5.7 I tested against reports
SYSTEM/UTC, which works. - Hard-coding
serverTimezone=UTCwould convert timestamps wrongly on a server that actually runs in another zone. - The remediation guidance asks for the minimal bump.
If you know the deployed server's zone, I'll add ?serverTimezone=<zone> to spring.datasource.url. Moving up to 8.0.23+ would also avoid the hard failure, but that's no longer the smallest fixing version.
Summary
Fixes Snyk SNYK-JAVA-MYSQL-174574 / CVE-2019-2692 (Privilege Escalation, medium, CVSS 6.3) in
mysql:mysql-connector-java@5.1.42, a direct dependency inUserFront/pom.xml. Code-scan findingsfind-69305faa28ee4e96a2c8e5e35944a14f.[,8.0.16)). This is a major bump (5.1 → 8.0). Java stays at 1.8 and nothing else in the Boot 1.5.4 parent changes.protobuf-javais excluded: 8.0.16 pulls inprotobuf-java3.6.1, which only the X DevAPI (com.mysql.cj.xdevapi) uses. Excluding it keeps the bump from adding new protobuf findings. The app connects over plain JDBC.com.mysql.jdbc.Driverforjdbc:mysql:URLs. In 8.x that class is a deprecated alias ofcom.mysql.cj.jdbc.Driver, so startup logs a deprecation warning but the connection works.CEST). A UTC server is fine. If a deployed server uses such a zone, add?serverTimezone=...tospring.datasource.url.Verification
api.snyk.ioare blocked by this session's network policy (access was requested and not yet granted). So I couldn't runmvn compile, the real app, or a Snyk re-scan.UserFront/src/testhas no tests and the repo has no CI.spring-boot-starter-data-jpa, Hibernate 5.0.12, tomcat-jdbc, Connector/J 8.x (8.0.33 cached jar, same protobuf exclusion), the repo'sdomain/daopackages andapplication.properties, against MySQL 5.7.44.com.mysql.jdbc.Driver(deprecation warning only).ddl-auto=updatecreated all 9 tables, and saving and reading backRoleandUserthroughRoleDaoandUserDao.findByUsernameworked.Duplicates
devin/1790739541-mysql-connector-8.0.16has the same property bump, but no protobuf exclusion.Devin-Org: engineering
Link to Devin session: https://devin-gtm.devinenterprise.com/sessions/c8b153dd109341e4981af4e90113b002
Open in Devin Desktop: https://devin-gtm.devinenterprise.com/desktop/session/c8b153dd109341e4981af4e90113b002?variant=devin
Devin Review