Skip to content

🔴 Critical Vulnerability: [flexible-restorer] - Patch transitive Bouncy Castle dependency #165

Description

@groakland

Summary

A Critical-severity advisory has been flagged against guardian/flexible-restorer for Bouncy Castle (org.bouncycastle:bcprov-*). The GOST 28147-2015 CTR mode implementation (G3413CTRBlockCipher) only increments the final byte of the counter, so the counter wraps after 255 blocks and the keystream is reused. Keystream reuse in CTR mode lets an attacker who observes two ciphertexts encrypted under the same key/IV recover the XOR of the plaintexts, breaking confidentiality.

  • Affected versions: >= 1.59, <= 1.80.1, = 1.81.0, >= 1.82, <= 1.83
  • Patched versions: 1.84 (with backports in 1.80.2 and 1.81.1 for some artifacts)
  • Source: Dependabot alert / GitHub Advisory Database

Real-world risk for this repo: LOW

  • Bouncy Castle is a transitive-only dependency — it is not declared directly in build.sbt or project/Dependencies.scala.
  • The vulnerable code path is GOST 28147 CTR mode, a Russian national cipher standard that this application has no reason to invoke.
  • No exploitable path has been identified. AES-CTR / GCM / TLS / JGit signing are unaffected.

This ticket is primarily alert hygiene and supply-chain diligence, not an active exploit risk.

Likely source of the dependency

Most probable transitive parent is org.eclipse.jgit (uses BC for SSH/crypto). Secondary candidates: pan-domain-auth, simple-configuration-ssm, or the AWS SDK.

Note: This repo targets Java 11, so the relevant artifact is likely bcprov-jdk18on. Confirm the exact artifact (-jdk18on vs -jdk15to18 vs -jdk14, and -debug/-ext variants) before pinning, since patched versions differ.

Acceptance criteria

  • Exact vulnerable bcprov artifact + version confirmed via sbt dependencyTree.
  • Bouncy Castle resolves to a patched version (>= 1.84, or the 1.80.2 / 1.81.1 backport as appropriate).
  • Build passes and app deploys successfully.
  • Dependabot alert is cleared (or dismissed with documented rationale if upgrade is deferred).

Suggested approach

  1. Identify the artifact: Run sbt dependencyTree (or whatDependsOn org.bouncycastle <artifact> <version>) to confirm coordinate, version, and the parent dependency pulling it in.
  2. Preferred fix — bump the parent: Upgrade the transitive parent (e.g. org.eclipse.jgit) to a version that resolves a patched bcprov.
  3. Fallback fix — pin/override: Add a dependencyOverrides entry in project/Dependencies.scala, e.g.:
    dependencyOverrides += "org.bouncycastle" % "bcprov-jdk18on" % "1.84"
  4. Alternative — Dependabot PR: Allow the Dependabot security update PR to apply the patched version automatically.
  5. If deferring: Dismiss the alert as "vulnerable code (GOST CTR) not in execution path" — but upgrading is cheap and preferred.

Effort / Priority

  • Effort: Small (dependency pin + build verification)
  • Priority: Low–Medium (Critical CVSS, but no realistic exploit path in this app)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    maintenanceDepartmental tracking: maintenance work, not a fix or a feature

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions