Skip to content

fix: reject invalid idempotency TTLs and secure generated apps - #1449

Merged
kang-heewon merged 2 commits into
trunkfrom
fix/1403-idempotency-ttl-validation
Jul 24, 2026
Merged

fix: reject invalid idempotency TTLs and secure generated apps#1449
kang-heewon merged 2 commits into
trunkfrom
fix/1403-idempotency-ttl-validation

Conversation

@kang-heewon

@kang-heewon kang-heewon commented Jul 22, 2026

Copy link
Copy Markdown
Member

Summary

  • Reject non-positive, fractional, non-finite, unsafe, and Date-overflowing idempotency TTLs with a stable InvalidIdempotencyTtlProblem before pruning or state mutation.
  • Preserve omitted TTLs as non-expiring records and cover coordinator propagation, hostile numeric inputs, and mutation-order regressions.
  • Keep generated Next.js applications on patched framework releases and force PostCSS 8.5.12 in root, generated workspaces, and the dependency-audit fixture. This adjacent security update is included because the publish-profile audit blocked this PR on GHSA-6g55-p6wh-862q.

Verification

  • Full workspace tests: 226/226 tasks
  • Full workspace typecheck: 225/225 tasks
  • API docs drift check: 112/112 builds; tracked output matches
  • Problem registry: 447/447
  • Public API snapshots: 111
  • Dependency audit policy: passed
  • Independent adversarial review: approved with no findings

Fixes #1403

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@kang-heewon, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 50 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 491f1219-6148-4b9b-9f51-b279018c0b78

📥 Commits

Reviewing files that changed from the base of the PR and between 72fbcd0 and f9ce99b.

⛔ Files ignored due to path filters (2)
  • packages/problems-core/src/generated/problem-code-registry.ts is excluded by !**/generated/**
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (21)
  • .changeset/secure-next-template-server-actions.md
  • .changeset/valid-idempotency-ttl.md
  • docs/problem-code-registry.json
  • packages/create-croco-app/src/tests/NextTemplateSecurity.spec.ts
  • packages/create-croco-app/templates/blank/pnpm-workspace.yaml
  • packages/create-croco-app/templates/spa-be-split/pnpm-workspace.yaml
  • packages/docs/src/content/docs/api/idempotency-core/src/classes/InvalidIdempotencyTtlProblem.md
  • packages/docs/src/content/docs/api/idempotency-core/src/type-aliases/IdempotencyTtlConstraint.md
  • packages/docs/src/content/docs/api/idempotency-core/src/type-aliases/InvalidIdempotencyTtlProblemOptions.md
  • packages/docs/src/content/docs/api/idempotency-core/src/variables/IDEMPOTENCY_DIAGNOSTIC_CODES.md
  • packages/docs/src/content/docs/api/problems-core/src/variables/CROCO_PROBLEM_CODE_REGISTRY.md
  • packages/docs/src/content/docs/en/reference/problem-recovery-cookbook.md
  • packages/idempotency-core/src/index.ts
  • packages/idempotency-core/src/libs/InMemoryIdempotencyStore.ts
  • packages/idempotency-core/src/libs/problems/IdempotencyProblems.ts
  • packages/idempotency-core/src/tests/IdempotencyCoordinator.spec.ts
  • packages/idempotency-core/src/tests/InMemoryIdempotencyStore.spec.ts
  • pnpm-workspace.yaml
  • public-api-surface.snapshot.json
  • scripts/dependency-audit-policy.mts
  • tsconfig/contract-strict.baseline.json
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/1403-idempotency-ttl-validation

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown

📊 Benchmark Results

✅ All benchmarks passed

Benchmark p75 Threshold Baseline vs Baseline Status Notes
CrocoApp constructor 8.3μs 30.0ms 8.2μs +1.4% -
CrocoApp lambdaHandler (10 controllers) 270.4μs 50.0ms 258.4μs +4.6% -
Lambda cold-start simulation 445.4μs 80.0ms 418.1μs +6.5% -
Lambda cold-start with headers 395.7μs 80.0ms 369.7μs +7.1% -
Lambda cold-start with binary body 368.3μs 80.0ms 339.1μs +8.6% -
Lambda cold-start with query params 315.4μs 80.0ms 301.3μs +4.7% -
Lambda cold-start with authorizer context 314.4μs 80.0ms 299.8μs +4.9% -
Lambda cold-start realistic scenario 313.9μs 80.0ms 299.2μs +4.9% -
EventBusConfig.start (10 handlers) 1.5μs 10.0ms 1.4μs +4.2% -
EventPublisher.publishNow single event 1.7μs 2.0ms 1.7μs +2.4% -
DefaultHandlerResolver.resolve × 10 0.1μs 5.0ms 0.1μs +0.0% -
Container.get singleton (cold) 75.7μs 5.0ms 70.3μs +7.7% -
Container.register × 50 components 3.4ms 10.0ms 3.2ms +3.9% -
Container.validate (50 components) 3.8ms 20.0ms 3.4ms +12.7% -
Container.get singleton (warm) 1.6μs 500.0μs 1.6μs +0.6% -
TelemetryRuntime.init (lambda preset) 2.3μs 200.0ms 1.1ms -99.8% -
lambdaPreset config creation 1.5μs 2.0ms 1.4μs +7.8% -

Updated: 2026-07-24T05:28:52.031Z · Commit: a97bfc7

@kang-heewon
kang-heewon force-pushed the fix/1403-idempotency-ttl-validation branch 2 times, most recently from c63a8b1 to 7f886b6 Compare July 22, 2026 23:07
@kang-heewon

Copy link
Copy Markdown
Member Author

CI blocker (unrelated to #1403): the publish verification profile now fails dependency-audit-policy because the generated Next.js templates pin 15.5.18, which is affected by newly published GHSA-89xv-2m56-2m9x, GHSA-m99w-x7hq-7vfj, and GHSA-p9j2-gv94-2wf4. The policy reports 18 blocking generated-app paths. GitHub lists 15.5.21 as the patched 15.x release.

The failure reproduces locally with pnpm security:audit-policy. All #1403 implementation checks and the other PR checks pass. I am not mixing the unrelated template-wide security upgrade into this idempotency PR or bypassing the required check.

@kang-heewon
kang-heewon force-pushed the fix/1403-idempotency-ttl-validation branch from 7f886b6 to f9ce99b Compare July 24, 2026 05:20
@kang-heewon kang-heewon changed the title fix: reject invalid idempotency TTLs fix: reject invalid idempotency TTLs and secure generated apps Jul 24, 2026
@kang-heewon
kang-heewon merged commit 62885fe into trunk Jul 24, 2026
10 checks passed
@kang-heewon
kang-heewon deleted the fix/1403-idempotency-ttl-validation branch July 24, 2026 06:23
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.

[idempotency-core] Reject invalid idempotency TTL configuration

1 participant