Skip to content

chore: bump kotlin to 2.4.20 - #6256

Merged
Artur- merged 1 commit into
mainfrom
chore/bump-kotlin-2.4.20
Sep 11, 2026
Merged

Artur- merged 1 commit into
mainfrom
chore/bump-kotlin-2.4.20

Conversation

@totally-not-ai

Copy link
Copy Markdown
Contributor

Summary

  • kotlin.version 2.4.0 → 2.4.20 in the root POM: kotlin-reflect, kotlin-stdlib and kotlin-stdlib-jdk8 in dependencyManagement, plus the kotlin-maven-plugin that compiles the Kotlin test sources of hilla-typescript-generator
  • kotlinVersion 2.4.0 → 2.4.20 in packages/java/gradle-plugin/gradle.properties and packages/java/tests/gradle/kotlin-gradle-test/gradle.properties, which is the org.jetbrains.kotlin.jvm (Kotlin Gradle plugin) version

Context

The Vaadin platform SBOM check reports CVE-2026-53914 (CRITICAL, unsafe deserialization in the Kotlin build cache) against org.jetbrains.kotlin:kotlin-reflect:2.4.0, which reaches the platform through hilla-typescript-generator. The advisory only affects org.jetbrains.kotlin:kotlin-gradle-plugin (< 2.4.20); the NVD entry carries cpe:2.3:a:jetbrains:kotlin with an upper bound of 2.4.20, and that CPE matches every Kotlin artifact, which is why kotlin-reflect gets flagged.

So the kotlin-reflect side is a false positive, but the Kotlin Gradle plugin we build the Hilla Gradle plugin with is the artifact the advisory really covers, and it sat on the same 2.4.0. Both move to 2.4.20 here, which also drops the entry from the platform SBOM report instead of keeping it on the acknowledged list.

Validation

  • mvn -B -pl packages/java/typescript-generator test → 607 tests, 0 failures, 0 errors, 2 skipped, with the Kotlin test sources compiled by kotlin-maven-plugin 2.4.20 (the TypeScript snapshot tests need npm ci && npm run build first, otherwise the generator CLI is missing)
  • The Gradle legs I could not run locally: Gradle 8.14.3 rejects the only JDK in this environment (Temurin 25, Unsupported class file major version 69). The Gradle tests job covers both the functional tests and the kotlin-gradle-test ITs.

CVE-2026-53914 is an unsafe deserialization in the Kotlin build cache and
affects org.jetbrains.kotlin:kotlin-gradle-plugin below 2.4.20. The NVD entry
carries the CPE cpe:2.3:a:jetbrains:kotlin with an upper bound of 2.4.20, which
matches every Kotlin artifact, so the platform SBOM check flags the
kotlin-reflect 2.4.0 that hilla-typescript-generator brings even though only the
Gradle plugin is affected.

The Gradle plugin we build the Hilla Gradle plugin with is the artifact the
advisory really covers, so both places move together:

- kotlin.version 2.4.0 to 2.4.20 in the root POM, which drives kotlin-reflect,
  kotlin-stdlib and kotlin-stdlib-jdk8 in dependencyManagement and the
  kotlin-maven-plugin that compiles the Kotlin test sources
- kotlinVersion 2.4.0 to 2.4.20 in the gradle-plugin and kotlin-gradle-test
  gradle.properties, which is the org.jetbrains.kotlin.jvm plugin version
@sonarqubecloud

Copy link
Copy Markdown

@codecov

codecov Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.31%. Comparing base (2da61ba) to head (92cfa9c).

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #6256   +/-   ##
=========================================
  Coverage     81.31%   81.31%           
  Complexity     2018     2018           
=========================================
  Files           343      343           
  Lines         14816    14816           
  Branches       2107     2107           
=========================================
  Hits          12048    12048           
  Misses         2477     2477           
  Partials        291      291           
Flag Coverage Δ
unittests 81.31% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Artur-
Artur- merged commit 3bfb1ab into main Sep 11, 2026
25 of 27 checks passed
@Artur-
Artur- deleted the chore/bump-kotlin-2.4.20 branch September 11, 2026 07:00
Artur- pushed a commit that referenced this pull request Sep 11, 2026
## Summary

The security integration tests continued right after clicking logout,
while the logout request was still running. This made them fail at
random on CI. The test helper now waits until the page reload that
logout triggers has really happened.

## What changed

`SecurityIT.clickLogout()` used to click the logout button and then only
check that the root page was shown. That check was not enough:

- Hilla's logout ends in a `window.location.replace()`, but right after
the click the old document still reports `readyState` `complete`.
- If the browser is already on the root page, the old page also shows
the expected URL and header.

So the assertion passed on the page that was still on screen, and the
helper returned while the logout request was still in flight. Whatever
the test did next raced that request: an `openResource()` was still
served with the old session (no redirect to the login view), and a
cookie read saw the Spring CSRF cookie cleared but not yet replaced.
This is the failure seen in the `ITs (ubuntu-latest, security)` job of
#6256, where the same commit passed on a re-run.

`clickLogout()` now:

1. waits for the main view element to go stale — this happens exactly
when the reloaded document commits, and
2. waits for the new document to finish loading.

This is the same anchoring already used in `AbstractLoginTest`. The fix
applies to every subclass of `SecurityIT` (context path, URL mapping,
JWT, react-signals).

No dedicated test was added for the wait itself. To make it fail
reliably, `window.fetch` had to be patched to hold the logout request
back for about a second, because on an idle machine the reload wins the
race and the assertion passes with or without the wait. That is more
machinery than the assertion is worth, and the wait is exercised by the
existing logout tests on every run.

## Test summary

| # | Status | What the test verifies | Why it matters |
|---|--------|------------------------|----------------|
| 1 | ✅ | After `logout()`, opening a protected resource redirects to
the login view | This is the exact assertion that flaked; it proves the
server session is really gone before the test continues |
| 2 | ✅ | After `logout()`, the Spring CSRF cookie is present again | A
cookie read that lands mid-logout sees the cookie cleared but not yet
re-issued |
| 3 | ✅ | After `logout()`, the JWT cookie is gone | Logout must drop
the stateless credentials, not just the session |
| 4 | ✅ | After `logout()`, the app behaves as anonymous again | Covers
the stateless (JWT) setup end to end |
| 5 | ❗ **gap** | `clickLogout()` returns only after the reloaded
document commits, even when the logout request is slow | Deliberate:
reproducing it needs `window.fetch` patched to delay the logout request,
which is more machinery than the assertion is worth |

Test methods that cover these rows (all pre-existing, none changed on
this branch; they exercise the changed helper through `logout()`):

- `SecurityIT.access_restricted_to_logged_in_users` — 1
- `SecurityIT.access_restricted_to_admin` — 1
- `com.vaadin.flow.spring.fusionsecurityjwt.SecurityIT.csrf_cookie` — 2
-
`com.vaadin.flow.spring.fusionsecurityjwt.SecurityIT.jwt_cookie_reset_on_logout`
— 3
-
`com.vaadin.flow.spring.fusionsecurityjwt.SecurityIT.stateless_for_anonymous_after_logout`
— 4

Left untested on purpose: the wait itself (row 5), for the reason given
above.

---------

Co-authored-by: totally-not-ai[bot] <290682512+totally-not-ai[bot]@users.noreply.github.com>
Artur- pushed a commit that referenced this pull request Sep 11, 2026
Co-authored-by: totally-not-ai[bot] <290682512+totally-not-ai[bot]@users.noreply.github.com>
Artur- pushed a commit that referenced this pull request Sep 11, 2026
Co-authored-by: totally-not-ai[bot] <290682512+totally-not-ai[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants