Skip to content

fix(security): apply toolchain security floors to every module - #103

Merged
xernobyl merged 2 commits into
mainfrom
fix/dependabot-bouncycastle-floors
Nov 24, 2026
Merged

xernobyl merged 2 commits into
mainfrom
fix/dependabot-bouncycastle-floors

Conversation

@xernobyl

Copy link
Copy Markdown
Contributor

What

Moves the toolchain security floors out of android/build.gradle.kts into a subprojects block in the root build script, so every module gets them instead of only :android.

No version changes: org.bouncycastle is already floored at 1.85 on main, which satisfies all three Bouncy Castle advisories.

Why

The floors were correct but scoped to one module. :playground also applies AGP, so it resolves its own copy of AGP's lint toolchain (via com.android.tools:lint-gradle → sdk-common), and none of the floors applied there.

GitHub's dependency graph is the union of every module's resolution, so the vulnerable copies stayed in it and Dependabot kept the alerts open even though the floors were "already there" on main. From the graph the submission action posted today (2026-11-24):

org.bouncycastle:bcpkix-jdk18on  1.80.2  1.85
org.bouncycastle:bcprov-jdk18on  1.80.2  1.85
org.bouncycastle:bcutil-jdk18on  1.80.2  1.85
org.apache.commons:commons-lang3  3.16.0  3.21.0
org.apache.httpcomponents:httpclient  4.5.6  4.5.14

Every floored version is present alongside its unfloored twin. This PR closes that gap for the five alerts below in one change:

Alert Package Severity Floor
#52 org.bouncycastle:bcprov-jdk18on critical 1.85
#53 org.bouncycastle:bcprov-jdk18on high 1.85
#19 org.bouncycastle:bcpkix-jdk18on medium 1.85
#54 org.apache.commons:commons-lang3 medium 3.21.0
#60 org.apache.httpcomponents:httpclient medium 4.5.14

Risk

None of these artifacts reaches the published AAR — releaseRuntimeClasspath carries none of them; they are AGP, Dokka, ktlint and Kotlin-plugin tooling on the build machine only. The floors only ever raise a version, so an AGP bump that ships something newer still wins.

The root buildscript constraints stay where they are: they cover AGP's own plugin classpath, which a project-level resolutionStrategy cannot reach.

Verification

  • CI on this PR runs the same tasks that resolve these configurations: :android:lint, :playground:lint, :android:detekt, :playground:detekt, :android:ktlintCheck, :playground:ktlintCheck and both assemble tasks.
  • After CI, I triggered Dependency Submission on this branch and checked the submitted graph: no bcprov/bcpkix/bcutil 1.80.2, no commons-lang3 3.16.0, no httpclient 4.5.6 remain.

Not covered here: com.google.guava:guava 33.4.0-jre (alert #61, high) and ch.qos.logback:logback-core 1.3.16 (alerts #62–#64, low) have no floor at all. Separate advisories, separate change — adding them here would mix a logback 1.3 → 1.5 jump against ktlint into a critical-SLA fix.

The floors for AGP's toolchain dependencies were scoped to :android, so
:playground kept resolving its own unfloored copy of the Android lint
toolchain. The dependency graph Dependabot reads is the union of every
module's resolution, so the vulnerable versions stayed in it and the
alerts stayed open: bcprov/bcpkix/bcutil 1.80.2 (#52 critical, #53, #19),
commons-lang3 3.16.0 (#54) and httpclient 4.5.6 (#60) - all with floors
already declared and applied in :android.

Move the block into the root build script as a `subprojects` block so
every module gets it, and a module added later cannot reintroduce the
gap by omission. The root buildscript constraints stay where they are:
they cover AGP's own plugin classpath, which a project-level
resolutionStrategy cannot reach.

Refs formbricks/android dependabot alerts #52, #53, #19, #54, #60
@xernobyl
xernobyl marked this pull request as ready for review November 24, 2026 13:46
@xernobyl
xernobyl requested a review from mattinannt November 24, 2026 13:46
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: ec812ecd-5d12-4f9d-876a-3a496b162441
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

The block moved, so "below" and "above" no longer resolve to anything.
Name the root `subprojects` block instead of the location.

The claim in the javadoc-jar note still holds: AGP resolves that engine on
a detached configuration, which `configurations.configureEach` never
covers.
@xernobyl
xernobyl enabled auto-merge November 24, 2026 13:51
@xernobyl
xernobyl added this pull request to the merge queue Nov 24, 2026
Merged via the queue into main with commit cc49c20 Nov 24, 2026
15 checks passed
@sonarqubecloud

Copy link
Copy Markdown

@xernobyl
xernobyl deleted the fix/dependabot-bouncycastle-floors branch November 24, 2026 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants