Repository navigation
Description
Summary
packages/cgm_cbio/lib/src/cbio_crypto.dart stores the vendor GS1 link
credential, the per-frame RC4 stream key, and the sensor authentication prompt
as plaintext Dart List<int> constants. This repository is public, the file is
present on origin/feature/cbio-gs1-glucose-live (the head of #136) and on
origin/release/v0.4.0 (#139, the 0.4.0 release aggregate), and the Secret Scan
job is failing on the same lane.
No byte is reproduced in this issue, and none may be added to it.
Where
| Branch | cbio_crypto.dart with the constants |
Provenance doc |
|---|---|---|
origin/main |
absent | absent |
origin/feature/cbio-gs1-live (#127) |
absent | absent |
origin/feature/cbio-gs1-frame-decode (#132) |
absent | absent |
origin/feature/cbio-gs1-glucose-live (#136) |
present | absent |
origin/feature/cbio-gs1-app-live (#142) |
present | absent |
origin/release/v0.4.0 (#139) |
present | present via #138 |
origin/docs/cbio-gs1-auth-material (#138) |
absent | present |
Introduced by 36a0b2a ("authenticate the GS1 link and stream live glucose and
history"), which is an ancestor of every branch marked present.
What the scan caught, and what it did not
gh api .../check-runs for the head of #136 reports Secret Scan failure, and
the job (gitleaks-action v3, gitleaks 8.24.3, --redact --no-merges, full
history checkout, no .gitleaks.toml) reports exactly one rule finding:
RuleID: generic-api-key- location: a masked-authentication test fixture literal in
packages/cgm_cbio/test/cbio_crypto_test.dart
The three plaintext constants are not what the scan found. A List<int>
byte literal has no shape any generic API-key rule matches, so the scan
under-reports the more serious of the two: it flags a derived fixture and passes
the credential. That gap is the reason for the new custom rule below.
docs/testing/cbio-gs1-auth-material.md (#138) additionally publishes the
authentication frame's plaintext hex, which contains the 16-byte credential
verbatim, plus masked vectors derived from the real stream key. The same
document states that the record "deliberately does not restate the bytes", so
the file contradicts its own stated policy.
Why this is release-blocking
- The repository is public, so every clone, fork, archive, and mirror carries
the material. - Prepare OpenGlucose 0.4.0: GS1 and Anytime 5P integration #139 is the release aggregate. A release cut from it distributes vendor key
material under our name. - The Secret Scan gate cannot pass on this lane, and gitleaks scans the PR's
commit range, so removing the constants from the tip is not sufficient by
itself: the introducing commit is inside the range for cbio: authenticate the GS1 link and stream live glucose and history #136/Prepare OpenGlucose 0.4.0: GS1 and Anytime 5P integration #139.
Honest scope note: these are third-party protocol constants, not secrets of
ours. The same 16-byte RC4 key and a per-package credential appear in the vendor
APKs and in at least two independent open-source readers (Juggluco, a Home
Assistant direct-BLE integration). Confidentiality is therefore already limited
and rotation is not available to us. That does not make it acceptable for
this repository to be a distributor of them, and it does not excuse a red
security gate.
Remediation
- Code - PR "fix(cbio): require injected vendor material" (linked below)
removes the constants, addsCbioCredentialSource/CbioCredentialswith
fail-closedCbioCredentialUnavailable, and makescbioRc4Keystream,
maskCbioFrame,unmaskCbioFrame, and every builder in
cbio_vendor_frames.darttake the key and material as required
arguments. - Fixtures - the real-key-derived masked vectors are replaced with
synthetic material and structural assertions. Tests that need the real
material read it from the injected environment and skip when it is absent. - Docs (docs(cbio): GS1 auth key source and runtime call sequence #138) - the credential-bearing plaintext frame and the
real-key-derived vectors must be dropped, leaving digests and procedure. - Release (Prepare OpenGlucose 0.4.0: GS1 and Anytime 5P integration #139) - must not cut while any branch in the aggregate contains
the material, and needs the introducing commit squashed out of the PR range
for the Secret Scan job to go green. - Detection - a
.gitleaks.tomladds a rule for this exact class
(cbioVendor*/_authMaskedassigned a byte-list or hex literal) plus a
narrow allowlist for synthetic fixtures only. Verified against the current
tree: the rule matches the removed code and nothing that remains.
Verification
packages/cgm_cbio:flutter test62 passed, 2 skipped (the injected-material
tests skip without material);flutter analyzeclean.openhealth:flutter test474 passed;flutter analyzeclean.- The device harness now refuses to open a link without injected material and
reportsabort=vendor-material-missingnaming the missing variables.
Activity
shroominic commentedon Sep 18, 2026
Release-lead cross-reference: the same exposure is tracked as #158 from the CBIO GS1 release/CI audit. #166 is the owning PR. Both issues describe one blocker; no second fix is needed.
fix(cbio): require injected vendor material instead of compiled const…
fix(cbio): require injected vendor material instead of compiled const…
fix(cbio): require injected vendor material instead of compiled const…