← Back to Pull requests

fix: zeroize platform credentials held in configuration #107

Closed
unknown closed this pull request without merging on Oct 21, 2026 15:14 UTC
View on GitHub
unknown unknown commented on Oct 19, 2026 20:15 UTC
Author

Closes #46.

What

  • SecretString moves from platform-connectors/src/oauth.rs to platform-core (new secret.rs, plus the zeroize dependency). oauth.rs re-exports it, so connector code is unchanged.

  • It now derives Clone (each clone is its own Zeroizing<String>) and implements zeroize::ZeroizeOnDrop, with a compile-time assertion test following platform-api/src/query.rs.

  • AuthConfig::hs256_secret and BillingConfig::paddle_webhook_secret are Option<SecretString>. The hand-written redacting Debug impls are replaced by derived ones, since SecretString redacts itself. A new get_secret reader also wraps the raw value from the source in Zeroizing before trimming, so no untrimmed copy outlives the load.

  • Call sites read through expose(): platform-api/src/main.rs, platform-api/src/lib.rs (MoR webhook), platform-api/src/bin/devtoken.rs.

  • docs/THREAT_MODEL.md: the platform-credentials row says what is true, and "Residual risks" records that the original values stay in the process environment for the life of the process.
  • Why

    The threat model claimed zeroize-on-drop for platform credentials, but both config secrets were plain Strings. This lands before P62, P63 and P68 add more secrets, which should use the same type.

    Tests

  • The existing redaction tests in platform-config pass unchanged; the JWT one also checks the value through expose().

  • New: secrets_are_trimmed_and_blank_means_unset (config), and secret_string_zeroizes_on_drop / secret_string_is_redacted_in_debug (core).

  • scripts/check.sh passes.
  • Diff: 198 lines (+148 / -50) across 2 files Reviewer: abendrothj Review duration: 2578m
    All Vouch review confidence checks passed
    Residual risk 0.23 = Change Risk (0.59) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.59 · 198 lines diff across 2 files
    0.59
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.317
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.059
    Real PR Conversation Timeline
    1 comments
    "Review active on #107"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 59.3% (MEDIUM) · Higher = larger blast radius
    59.3%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 23.4% · Safe to merge
    23.4%