Skip to content

security: pre-release red/green/purple hardening (1 CRIT + 8 HIGH closed)#27

Merged
blackaxgit merged 9 commits into
mainfrom
chore/pre-release-rgp-hardening
May 19, 2026
Merged

security: pre-release red/green/purple hardening (1 CRIT + 8 HIGH closed)#27
blackaxgit merged 9 commits into
mainfrom
chore/pre-release-rgp-hardening

Conversation

@blackaxgit
Copy link
Copy Markdown
Owner

Pre-release Red / Green / Purple security hardening

Authorized defensive pre-release assessment of CLX's own codebase, run
RED → GREEN → PURPLE with orchestrator gates. Full procedure +
artifacts in specs/2026-05-19-rgp-*.md.

RED — confirmed, release-blocking

ID Sev Issue
B4-1 CRIT Hostile cloned-repo .clx/config.yaml could neuter the validator with zero interaction (3-prefix denylist gap)
B6-1/B6-2 HIGH Azure raw error body → tracing/CLI unredacted; no tenant-host redaction (prior-leak class)
B1-4/B3-2 HIGH */Bash(*) learned or MCP-added allow rule → L0 whitelist of every command
B5-4 HIGH CLX_VALIDATOR_* parent-env disable applied silently
B3-1 HIGH MCP clx_credentials mask leaked 6 plaintext chars + exact length
B5-1/B5-2 HIGH Release pipeline had no dep-audit / SBOM / provenance

GREEN — fixes (each with closing regression tests, all green)

  • B4-1: project-config filter drops the entire validator.* /
    user_learning.* subtrees for untrusted configs; hash-trusted path
    unchanged; benign auto_recall.* still merges.
  • B6-1/B6-2: build_error_summary redacts-then-bounds Azure bodies;
    redact_secrets scrubs *.openai.azure.com / .azure-api.net /
    .cognitiveservices.azure.com; redaction at the warn + CLI sinks.
  • B1-4/B3-2: is_overbroad_allow_pattern rejects wildcard-only
    allow patterns at both the learned-load and MCP-add boundaries.
  • B5-4/B3-1: loud WARN + security_env_overrides_active() accessor;
    credential mask now [REDACTED:<bracket>] (no plaintext, coarse len).
  • B5-1/B5-2: cargo audit + cargo deny (committed deny.toml,
    documented ignores) gate CI + release; CycloneDX SBOM + keyless
    build-provenance attestation.

PURPLE — independent verdict

SHIP — with 2 tracked pre-1.0 conditions (zero findings OPEN, no
blocking list). Each release-blocking finding re-derived against the
fixed source and confirmed neutralized; no GREEN-introduced regression
or mitigation weakening; full sign-off in
specs/2026-05-19-rgp-purple-signoff.md.

Tracked non-blocking follow-ons (file as 1.0-milestone):

  • B5-4: wire security_env_overrides_active() to a clx-hook audit-DB
    event (forensic defense-in-depth).
  • B5-1: add a manual-approval environment: gate to update-homebrew.
  • serde_yml RUSTSEC-2025-0068 (unsound/unmaintained, not an exploitable
    CVE) — tracked migration; deny.toml enumerates it and fails closed
    on any new advisory.

Gates

cargo nextest run --workspace 1718 passed / 9 keychain-skipped / 0
failed · clippy -D warnings · fmt · cargo deny · cargo audit ·
workflow YAML — all clean. No #[ignore] un-gated.

…from untrusted project config

- inert filter was a 3-prefix denylist; a hostile cloned repo
  .clx/config.yaml could still set layer1_enabled/default_decision/
  auto_allow_reads/prompt_sensitivity/trust_mode/layer1_timeout_ms/
  user_learning.* to neuter the validator with zero user interaction
- now drops the whole validator.* and user_learning.* subtrees for
  untrusted configs; hash-trusted path unchanged; closes B4-1/B4-2/R1-NEW-2
…t hosts

- azure.rs no longer embeds the raw HTTP response body in LlmError;
  build_error_summary redacts then bounds it (status + x-request-id)
- redact_secrets now scrubs *.openai.azure.com / .azure-api.net /
  .cognitiveservices.azure.com tenant+endpoint hosts (no over-redaction)
- redact at the tracing warn sink and the health CLI prints; closes
  the prior-leak tenant-URL class
- is_overbroad_allow_pattern: an allow pattern that reduces to only
  wildcards (*, **, Bash(*), ...) matches arbitrary commands
- load_learned_rules skips+WARNs such rows (defense-in-depth at the L0
  load boundary); clx_rules MCP add rejects them before persisting
- deny rules unrestricted; scoped allows (Bash(git status)) unaffected
…en MCP cred mask

- apply_env_overrides emits a loud WARN when CLX_VALIDATOR_* weakens the
  validator; new Config::security_env_overrides_active() exposes the list
  for hook audit logging (no cross-crate coupling)
- MCP clx_credentials mask is now [REDACTED:<bracket>] with no head/tail
  plaintext and only a coarse length bucket (was 6 plaintext chars + exact len)
…ovenance)

- CI + release: cargo audit (RustSec) + cargo deny (advisories/licenses/
  sources/bans) as blocking gates; committed deny.toml with documented
  ignores for the 5 unmaintained transitive advisories (serde_yml unsound
  tracked) and the permissive NCSA/CDLA licenses
- release: CycloneDX SBOM + actions/attest-build-provenance (keyless
  Sigstore); binary code-signing/notarization remains a documented gap
@blackaxgit blackaxgit merged commit c8cabd8 into main May 19, 2026
8 checks passed
@blackaxgit blackaxgit deleted the chore/pre-release-rgp-hardening branch May 19, 2026 19:25
blackaxgit added a commit that referenced this pull request May 19, 2026
0.8.0 -> 0.8.1. Ships the red/green/purple CRIT+HIGH fixes (PR #27). Auto-Tag -> v0.8.1 -> release.yml (arm64 + cargo-audit/deny + SBOM + provenance + Homebrew).
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.

1 participant