fix(workflow): send CSRF tokens from React mutations - #3549
Conversation
Production enables double-submit CSRF protection by default, while the public workflow React hooks previously sent mutation requests without reflecting the issued cookie into the request header. Centralize that browser-only header behavior and use it for every workflow mutation. Constraint: Preserve fail-closed server behavior and avoid changing GET requests or non-browser execution. Rejected: Disable CSRF for generated workflow routes | weakens the production security default. Confidence: high Scope-risk: narrow Reversibility: clean Directive: New workflow mutation hooks must use workflowMutationHeaders. Tested: Focused React hook regression, fmt, lint, typecheck, npm package build, generated Node agentic-workflow scaffold/install/build/serve/browser/API journey. Not-tested: Full template/runtime matrix pending after this commit.
|
Warning Review limit reached
Next review available in: 10 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0cd9faf23d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The production mutation fix shifted public workflow React declarations, so the generated reference must track their current source locations. Constraint: Generate with the CI-pinned Deno 2.7.7 to avoid version-dependent source-location churn. Confidence: high Scope-risk: narrow Reversibility: clean Tested: npx -y deno@2.7.7 task docs:api-reference:check Not-tested: No behavior changes in this documentation-only commit.
|
@codex review |
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
Root cause
Production enables double-submit CSRF protection by default and issues a readable
__Host-vf_csrfcookie. The public workflow React hooks sent POST requests without the matchingx-csrf-tokenheader, so the generated agentic-workflow template rendered correctly but every real Start action returned 403.Verification
Related: veryfront/veryfront-issue-inbox#456