Conversation
…-22262 (spring-web) Co-Authored-By: Daniella Grimberg <daniella@cognition.ai>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
| datasource: | ||
| url: ${TEST_DB_URL:jdbc:postgresql://localhost:5432/coghealth} | ||
| username: ${TEST_DB_USERNAME:coghealth} | ||
| password: ${TEST_DB_PASSWORD:coghealth_dev_2024} |
Contributor
Contributor
There was a problem hiding this comment.
Not a new exposure: coghealth_dev_2024 is the local docker-compose development password that is already committed in docker-compose.yml, start-infrastructure.sh and INFRASTRUCTURE.md. The default here just mirrors that local stack so the test profile boots without extra setup, and it is overridable via TEST_DB_PASSWORD; no shared or non-local database uses this credential. Leaving it as-is rather than diverging from the rest of the repo's local-dev config.
…3.3 upgrade Co-Authored-By: Daniella Grimberg <daniella@cognition.ai>
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
Closes CVE-2024-22262 (GHSA-2wrp-6fg6-hmc5,
UriComponentsBuilderURL parsing → open redirect / SSRF) by upgrading off end-of-life Spring Boot 2.7 rather than pinningspring-web. Parent POM goes2.7.18 → 3.3.13, which bringsspring-web 6.1.21(fix landed in 6.1.6) and, as a side effect,snakeyaml 2.2(closes CVE-2022-1471) andtomcat-embed 10.1.42.No business logic, DTO contracts, Flyway migrations or audit-layer (
@AuditAccess,PatientAccessLogger) changes.Before / after versions
spring-boot-starter-parentorg.springframework:spring-weborg.yaml:snakeyamltomcat-embed-corehibernate-coreorg.hibernate)org.hibernate.orm)spring-security-coreflyway-coreflyway-database-postgresql)springdoc-openapi-ui1.7.0springdoc-openapi-starter-webmvc-ui2.6.0java.version,maven.compiler.*, CIjava-version)Breaking changes fixed
javax.persistence→jakarta.persistence,javax.validation→jakarta.validation,javax.servlet→jakarta.servletacross entities, DTOs, controllers,JwtAuthenticationFilter,AuditAspectand the legacy JDBC/JPA services.javax.crypto.SecretKeyinJwtTokenProviderleft alone (JDK, not Jakarta EE)..and()-chained configurers are gone; theSecurityFilterChainbean now uses the lambda DSL, andauthorizeRequests/antMatchersbecomeauthorizeHttpRequests/requestMatchers:WebSecurityConfigurerAdapterwas in use.JwtAuthenticationFilteris a@Component extends OncePerRequestFilter, so it stays registered through Boot's servlet-filter auto-registration exactly as before — deliberately not also added viaaddFilterBefore, which would have double-registered it and changed behaviour. Startup log confirmsFilter 'jwtAuthenticationFilter' configured for use.springdoc-openapi-starter-webmvc-ui); the OpenAPI annotations in the controllers are unchanged.flyway-core; addedorg.flywaydb:flyway-database-postgresql(version managed by Boot) or migrations fail at startup with "Unsupported Database: PostgreSQL".spring.redis.*→spring.data.redis.*; dropped the now-redundant explicitspring.jpa.properties.hibernate.dialect(Hibernate 6 logsHHH90000025and auto-selectsPostgreSQLDialect).lombok-mapstruct-bindingannotation-processor path beforemapstruct-processorsoPatientMapperstill sees Lombok-generated accessors.actions/setup-javajava-version: '11'→'17'.testprofile — the repo had noapplication-test.yml; added one (local PostgreSQL from the repo'sdocker-compose.yml, Flyway on, Redis auto-config excluded) so the acceptance boot check is reproducible.dev(Neon) and default profiles are otherwise untouched.Authorization matrix — before / after
Identical; only the DSL changed.
.csrf().disable()).csrf(AbstractHttpConfigurer::disable))corsConfigurationSourcebean (originslocalhost:5173/5178/3000, methods GET/POST/PUT/DELETE/OPTIONS, all headers, credentials allowed).cors(Customizer.withDefaults())STATELESSSTATELESS/**(all endpoints, incl./api/auth/**,/v1/patients/**,/v1/encounters/**,/v1/providers/**,/v1/export/**,/actuator/**, Swagger UI)permitAll()viaantMatchers("/**")permitAll()viarequestMatchers("/**")@PreAuthorize/@Securednot used anywhere)JwtAuthenticationFilterauto-registered as a servlet filter (@Component)AuthenticationManager/PasswordEncoderAuthenticationConfigurationbean / BCryptNote: the app's endpoints were already fully
permitAll()onmain; this PR intentionally preserves that rather than tightening it.Verification
GET /api/actuator/healthUP)GET /api/v1/providersGET /api/v1/providers/departmentsGET /api/v1/providers/specialtiesGET /api/v1/patients/1GET /api/v1/patients/search?q=aGET /api/swagger-ui/index.htmlGET /api/v3/api-docsGET /api/v1/encounters/patient/{id},/api/v1/encounters/status/{status}mainThe encounter endpoints fail identically on
main(built with JDK 11, Boot 2.7.18, same PostgreSQL instance): Jackson cannot serialize the lazyEncounter.patientHibernate proxy —InvalidDefinitionException: No serializer found for ... ByteBuddyInterceptor. Not introduced by this upgrade and not worked around here; fixing it needs a DTO orjackson-datatype-hibernatemodule, which is out of scope for a CVE remediation.Devin-Org: engineering
Link to Devin session: https://app.devin.ai/sessions/f907dea2eac548449b51e82eb41043d8
Open in Devin Desktop: https://app.devin.ai/desktop/session/f907dea2eac548449b51e82eb41043d8?variant=devin
Requested by: @danigrim