← Back to Pull requests

fix(create): wait for the clock to reach Rekor's integrated time after signing #359

Closed
unknown closed this pull request without merging on Nov 29, 2026 17:44 UTC
View on GitHub
unknown unknown commented on Nov 29, 2026 17:25 UTC
Author

A release could fail for no lasting reason when the machine signing it had a clock a fraction of a second behind Rekor's. Signing now waits for the local clock to catch up before it returns the bundle, so the check that runs right after it passes. Verification is just as strict as before.

The problem

Rekor records when it adds an entry to its log (the entry's integrated time). sigstore's verifier rejects an entry whose integrated time is later than the verifier's own current time, and it allows no clock skew. That strictness is deliberate: sigstore/sigstore-rust#164 removed the skew allowance after an audit finding.

The action's "Verify what was written" step runs packslip verify straight after packslip create signs the bundle. If the runner's clock is slightly behind Rekor's, the entry looks like it comes from the future, and the release fails:

wrote dist/packslip.sigstore.json (1 artifact(s), 1 resource(s), signed by https://github.com/sahidvelji/zeg/.github/workflows/release.yml@refs/heads/main)
verification failed: bundle does not verify: invalid integrated time: integrated time 2026-11-29T16:54:08Z is in the future (current time: 2026-11-29T16:54:07.78566Z)

Re-running the job succeeded. Only a check made right after signing can hit this race. Anyone installing the release verifies it long after the entry exists.

What changed

After signing, packslip create (and any other caller of the library's sigstore::sign) now reads the integrated time of each log entry in the new bundle. If that time is still ahead of the local clock, it sleeps until the clock reaches it. With a fraction of a second of skew, the wait is under a second. The wait is capped at five seconds, so a clock that is badly wrong still fails verification with the same error as before, which is the right outcome for real skew. Bundles with no log entry never wait. That covers key-signed bundles made without --log.

The verifier is unchanged.

Validation

  • A new unit test, signing_waits_for_the_clock_to_reach_the_integrated_time, uses a logged fixture bundle. It checks that a clock 200 ms behind waits exactly 200 ms, a clock at or after the integrated time doesn't wait, a clock 60 s behind waits only the five-second cap, and an unlogged bundle never waits.

  • cargo test --all-features passes. cargo clippy --all-targets passes with -D warnings, both with all features and with no default features. cargo fmt --check passes.

  • I couldn't reproduce the skew race end to end. That would need a runner whose clock trails Rekor's.
  • Fixes #358

    🤖 Generated with Claude Code

    <!-- CURSOR_SUMMARY -->
    ---

    [!NOTE]

    Low Risk

    Localized signing-path sleep with a fixed cap; no verifier or policy changes, only timing after Rekor upload.

    > Overview

    Fixes a race where immediate post-sign verification fails when the runner clock is slightly behind Rekor's integrated timestamp (strict “no future integrated time” checks).

    > After building a signed bundle with transparency-log entries, sign now calls wait_for_integrated_time, which sleeps until the local clock catches the latest entry integrated time, capped at five seconds. Unlogged bundles skip the wait; clocks already past integrated time sleep not at all. Verification logic is unchanged—bad skew still fails the same way once the cap is exceeded.

    > Adds unit tests for integration_wait (200 ms skew, at/past time, 60 s cap, empty tlog).

    > <sup>Reviewed by Cursor Bugbot for commit d97a64ed35ebb9948fe3e96b2579c61dd8442ec6. Bugbot is set up for automated code reviews on this repo. Configure here.</sup>

    <!-- /CURSOR_SUMMARY -->

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->
    <!-- coderabbit-ai-generated:v1 -->

    Summary by CodeRabbit

    Bug Fixes
    Signing now waits up to five seconds when the bundle’s latest transparency-log timestamp is ahead of the local clock. No wait occurs if there is no logged timestamp or the local clock has already reached it.
    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 529 lines (+396 / -133) across 6 files Reviewer: jdx Review duration: 19m
    All Vouch review confidence checks passed
    Residual risk 0.19 = Change Risk (0.48) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.48 · 529 lines diff across 6 files
    0.48
    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.375
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #359"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    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: 47.9% (MEDIUM) · Higher = larger blast radius
    47.9%
    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: 18.9% · Safe to merge
    18.9%
    Repository