Skip to content

feat: add OIDC issuer validation for keyless signing (UCA-12)#53

Open
avrabe wants to merge 3 commits intomainfrom
feat/oidc-issuer-validation
Open

feat: add OIDC issuer validation for keyless signing (UCA-12)#53
avrabe wants to merge 3 commits intomainfrom
feat/oidc-issuer-validation

Conversation

@avrabe
Copy link
Contributor

@avrabe avrabe commented Mar 16, 2026

Summary

  • Adds defense-in-depth validation of the OIDC token issuer on the signing side
  • Previously, sigil accepted any OIDC token without checking the iss claim, allowing CI misconfiguration to sign under the wrong identity provider
  • Non-breaking: defaults to None (current behavior preserved)

What changed

File Change
signer.rs Added expected_issuer: Option<String> to KeylessConfig; validates after token acquisition
main.rs Added --expected-issuer CLI flag for sign --keyless
keyless_integration.rs Updated test configs with new field

Usage

# Via CLI flag
sigil sign -i module.wasm -o signed.wasm --keyless \
  --expected-issuer https://token.actions.githubusercontent.com

# Via environment variable
export WSC_EXPECTED_OIDC_ISSUER=https://token.actions.githubusercontent.com

Context

Discovered via STPA-Sec analysis (UCA-12, AS-12). The verification side already has --cert-oidc-issuer for checking after the fact, but the signing side had no pre-Fulcio validation. Fulcio itself validates token authenticity but accepts tokens from any issuer in its trust list — it doesn't enforce that a particular client should only use a particular issuer.

Test plan

  • cargo test — 591 tests pass (553 lib + 5 integration + 18 signer + 6 doc + 4 attestation)
  • New tests: test_keyless_config_expected_issuer, test_keyless_config_expected_issuer_default_is_none
  • CI: all checks should pass

🤖 Generated with Claude Code

avrabe and others added 3 commits March 16, 2026 06:26
Add defense-in-depth validation of the OIDC token issuer on the signing
side. Previously, sigil accepted any OIDC token from the auto-detected
provider without checking the issuer claim, allowing CI pipeline
misconfiguration to sign modules under an unintended identity provider.

Changes:
- Add `expected_issuer` field to `KeylessConfig`
- Validate OIDC token issuer against expected value before sending to Fulcio
- Support `WSC_EXPECTED_OIDC_ISSUER` environment variable
- Add `--expected-issuer` CLI flag for `sign --keyless`
- Non-breaking: defaults to None (current behavior preserved)

Usage:
  sigil sign -i module.wasm -o signed.wasm --keyless \
    --expected-issuer https://token.actions.githubusercontent.com

Or via environment variable:
  export WSC_EXPECTED_OIDC_ISSUER=https://token.actions.githubusercontent.com

Fixes: UCA-12
Refs: AS-12, H-5, SC-5

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ual risks

Add 49 new artifacts from second-round STPA-Sec analysis covering:

Part A — Residual risks from fixes:
- H-12: Rekor unavailability blocks all keyless verification (DD-2 consequence)
- AS-13: Environment variable injection bypasses OIDC issuer check

Part B — Binary signing expansion (FEAT-2):
- L-6, L-7: Firmware integrity and attestation chain continuity losses
- H-13–H-16: ELF parser, MCUboot TLV, transcoding, format confusion hazards
- UCA-13–UCA-17: ELF/MCUboot/format-specific unsecure control actions
- AS-14–AS-17: Section injection, header manipulation, chain substitution, polyglot attacks
- SC-12–SC-15: System constraints for binary signing safety
- CTRL-8, CTRL-9, CP-5, CP-6: New controllers and processes
- DF-11–DF-13: Binary signing and attestation chain data flows

Part C — Container signing:
- L-8, L-9: Container image integrity and signature persistence losses
- H-17–H-20: Tag mutation, registry deletion, cosign compromise, format mismatch hazards
- UCA-18–UCA-21: Container-specific unsecure control actions
- AS-18–AS-21: Tag mutation, registry GC, cosign compromise, cross-image reuse attacks
- SC-16–SC-19: System constraints for container signing safety
- CTRL-10, CP-7: Container signing controller and process
- DF-14, DF-15: Container signing and verification data flows

Total: 289 artifacts across 22 types, 94.8% traceability coverage.

Refs: FEAT-2, REQ-8, AS-6, UCA-12

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Four-phase plan covering 14 work items derived from 289 STPA-Sec artifacts:

Phase 1 (Immediate): Typed RekorEntry enum, OIDC issuer opt-out,
  skip_rekor warning, OCI verification stub
Phase 2 (Binary signing): ELF parser with security constraints,
  MCUboot TLV signing, explicit format flag, attestation chain continuity
Phase 3 (Container signing): Cosign delegation with integrity check,
  tag-to-digest resolution, OCI 1.1 referrers, Sigstore bundle interop
Phase 4 (Infrastructure): Rekor proof caching, Nix flake, build env
  attestation

Refs: FEAT-2, FEAT-3, FEAT-4, REQ-6, REQ-8, REQ-10

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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