Skip to content

Downgrade Kotlin/Ktor for Kotlin 2.1-compatible metadata - #112

Merged
Josh Pensky (joshpensky) merged 5 commits into
mainfrom
josh/exp-1108-downgrade-android-ktor-dep-to-kotlin-21-compatible-version
Jul 3, 2026
Merged

Downgrade Kotlin/Ktor for Kotlin 2.1-compatible metadata#112
Josh Pensky (joshpensky) merged 5 commits into
mainfrom
josh/exp-1108-downgrade-android-ktor-dep-to-kotlin-21-compatible-version

Conversation

@joshpensky

@joshpensky Josh Pensky (joshpensky) commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

In order to be compatible with React Native, we need to make this library compatible with Kotlin 2.1. This required downgrading the ktor dependency to 3.2.4 (which supports 2.1) and switching our build to output 2.1 metadata

This has been tested with React Native 0.79 & Expo 53 and works as expected

What Changed

  • evervault-core shipped kotlin.Metadata with mv=[2,3,0] because the Ktor bump in Fix: Update Vulnerabilities #93 (to fix CVE-2025-29904) went all the way to 3.4.0, which is built with Kotlin 2.3.0.
  • Pins ktor-client-core/ktor-client-okhttp to 3.2.4, which is built with Kotlin 2.1.0 metadata, while staying well past 3.1.1 (the version that fixed CVE-2025-29904).
  • On top of that, the project's own Kotlin Gradle plugin was still 2.2.21, so evervault-core's own classes carried mv=[2,2,0] regardless of the Ktor pin. Downgraded the Kotlin plugin (org.jetbrains.kotlin.android, plugin.serialization, plugin.compose) to 2.1.20 and matched the pinned kotlin-stdlib-common versions, so every shipped module (evervault-core, evervault-cages, evervault-enclaves, evervault-inputs) now carries mv=[2,1,0].
  • Regenerated all gradle.lockfiles to match.
  • No source changes were needed — the codebase doesn't use any Kotlin 2.2-only language features.

Test plan

  • testDebugUnitTest / testReleaseUnitTest — 75/75 pass for every module, against the live Evervault API
  • Full assembleDebug / assembleRelease across all modules
  • Verified via bytecode inspection that every shipped AAR's classes carry mv=[2,1,0] metadata (down from [2,3,0])
  • Published to mavenLocal under 2.4.0-local for cross-repo consumer testing
  • Confirmed no other module depends on Ktor directly (the ktorVersion var in examples/shared is unused)

🤖 Generated with Claude Code

The 3.4.0 bump (#93) fixed CVE-2025-29904 but pulled in Kotlin 2.3.0
class metadata, which can break consumers on older Kotlin compilers.
3.2.4 keeps the CVE fix (resolved in 3.1.1) while shipping Kotlin
2.1.0 metadata instead.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Jul 1, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: cffa149

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
evervault-android Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@socket-security

socket-security Bot commented Jul 1, 2026

Copy link
Copy Markdown

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
Obfuscated code: maven io.ktor:ktor-utils-jvm is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: evervault-cages/gradle.lockfilemaven/io.ktor/ktor-client-okhttp-jvm@3.2.4maven/io.ktor/ktor-utils-jvm@3.2.4

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore maven/io.ktor/ktor-utils-jvm@3.2.4. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
Obfuscated code: maven io.ktor:ktor-websockets-jvm is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: evervault-cages/gradle.lockfilemaven/io.ktor/ktor-client-okhttp-jvm@3.2.4maven/io.ktor/ktor-websockets-jvm@3.2.4

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore maven/io.ktor/ktor-websockets-jvm@3.2.4. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
Obfuscated code: maven org.jetbrains.kotlin:kotlin-daemon-client is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: evervault-cages/gradle.lockfilemaven/org.jetbrains.kotlin/kotlin-build-tools-impl@2.1.20maven/org.jetbrains.kotlin/kotlin-daemon-client@2.1.20

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore maven/org.jetbrains.kotlin/kotlin-daemon-client@2.1.20. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

Comment thread evervault-core/build.gradle.kts Outdated
Ktor 3.2.4 already ships Kotlin 2.1.0 metadata, but the project's own
Kotlin Gradle plugin was still 2.2.21, so evervault-core's own classes
carried mv=[2,2,0]. Dropping the plugin to 2.1.20 (and the pinned
kotlin-stdlib-common versions to match) brings all shipped modules
down to mv=[2,1,0], with lockfiles regenerated accordingly.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@joshpensky Josh Pensky (joshpensky) changed the title Downgrade Ktor to 3.2.4 for Kotlin 2.1-compatible metadata Downgrade Kotlin/Ktor for Kotlin 2.1-compatible metadata Jul 2, 2026
Josh Pensky (joshpensky) and others added 2 commits July 2, 2026 11:13
…pinned kotlin-stdlib to 2.3.0

The previous lockfile regeneration didn't touch the lint model's
androidTest compile classpath for this module, leaving a stale
kotlin-stdlib:2.3.0 lock entry that conflicted with the rest of the
graph and broke generateDebugAndroidTestLintModel (and thus `./gradlew
build`) in CI.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Comment thread evervault-core/build.gradle.kts
@joshpensky
Josh Pensky (joshpensky) merged commit 5cdad6a into main Jul 3, 2026
5 checks passed
@joshpensky
Josh Pensky (joshpensky) deleted the josh/exp-1108-downgrade-android-ktor-dep-to-kotlin-21-compatible-version branch July 3, 2026 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants