Skip to content

Fix CSRF header after the cookie v2 bump - #4066

Merged
T4rk1n merged 2 commits into
devfrom
fix/cookie-v2-parse
Oct 15, 2026
Merged

T4rk1n merged 2 commits into
devfrom
fix/cookie-v2-parse

Conversation

@T4rk1n

@T4rk1n T4rk1n commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

#4058 bumped cookie to 2.0.1 in the renderer. Version 2 dropped parse (it is parseCookie now), so getCSRFHeader threw on every request. The error was caught and logged as TypeError: w.parse is not a function, and the X-CSRFToken header was never sent.

Changes

  • dash/dash-renderer/src/actions/index.js: import parseCookie. It is the only cookie use in the repo.

The bump is unreleased (it is in 4.5.0rc1, which is not out yet), so no CHANGELOG entry.

Tests

  • tests/integration/security/test_csrf.py: the app sets a _csrf_token cookie and a callback echoes back the X-CSRFToken header it gets. It fails before the change (the header is missing) and passes after.

cookie 2.0 dropped parse, so getCSRFHeader threw (caught, warned) and the
X-CSRFToken header was never sent.
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Dash performance benchmarks

✅ all within thresholds

scenario metric p90 (ms) median growth baseline p90 note
✅ callback_chain chain_ms 347.7 340.4 0.92x 499.1
✅ callback_chain graph_ms 1.4 1.4 1.0x 2.4
✅ callback_fanout fanout_ms 67.6 62.0 0.93x 92.5
✅ deep_nesting render_ms 45.2 43.0 1.14x 56.8
✅ full_children_replace replace_ms 4479.5 1651.0 18.53x 4697.1
✅ initial_render_large render_ms 523.6 445.1 1.05x 694.4
✅ initial_render_small render_ms 75.3 71.0 1.02x 104.0
✅ patch_append_nested append_ms 116.0 78.6 2.47x 192.3
✅ patch_append_toplevel append_ms 103.3 77.2 2.03x 140.2
✅ patch_scalar_update_large update_ms 137.8 122.6 1.03x 202.9
✅ wildcard_all_resolve wildcard_ms 238.1 220.8 0.97x 313.6
✅ wildcard_all_resolve graph_ms 0.8 0.8 1.0x 1.3

growth = late-third / early-third per-op time; ~1 is flat, a large value means the per-op cost scales with accumulated state.

machine scale vs baseline: 0.74x - divided out of the baseline ratios so they compare like for like (the absolute warn/fail ceilings are left un-scaled); calibrated on initial_render_small.

@sonarqubecloud

Copy link
Copy Markdown

@KoolADE85 KoolADE85 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and confirmed that this resolves the issue 💃

@T4rk1n
T4rk1n merged commit 86472aa into dev Oct 15, 2026
58 of 59 checks passed
@T4rk1n
T4rk1n deleted the fix/cookie-v2-parse branch October 15, 2026 16:19
@T4rk1n T4rk1n mentioned this pull request Oct 15, 2026
2 tasks
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.

2 participants