# Sudden HTTP 403 errors with Discourse Docker ("BAD CSRF")

**URL:** https://meta.discourse.org/t/sudden-http-403-errors-with-discourse-docker-bad-csrf/343948
**Category:** Bug
**Created:** [December 22, 2024, 9:07pm UTC](https://meta.discourse.org/t/sudden-http-403-errors-with-discourse-docker-bad-csrf/343948 "2024-12-22T21:07:27Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![claas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/claas/32/71725_2.png) [@claas](https://meta.discourse.org/u/claas)
#### Post date: [December 22, 2024, 9:07pm UTC](https://meta.discourse.org/t/sudden-http-403-errors-with-discourse-docker-bad-csrf/343948/1 "2024-12-22T21:07:28Z")

</div>

We’re using Discourse Docker and getting HTTP 403 since yesterday (2024-12-21) when trying to login or (for those already logged in) to post a message. The error response is `["BAD CSRF"]`, which makes me think this security fix may have caused this regression:  
[https://github.com/discourse/discourse/commit/438abaa50418261f60799f118d90580b36448cdd](https://github.com/discourse/discourse/commit/438abaa50418261f60799f118d90580b36448cdd)

Is anybody else experiencing these?

PS: The Discourse instance exists since 2020, and is updated automatically every night.

---

<div class="post-metadata">

### Author: ![claas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/claas/32/71725_2.png) [@claas](https://meta.discourse.org/u/claas)
#### Post date: [December 22, 2024, 9:08pm UTC](https://meta.discourse.org/t/sudden-http-403-errors-with-discourse-docker-bad-csrf/343948/2 "2024-12-22T21:08:37Z")

</div>

Maybe this will fix it in 3.3.4?

[https://github.com/discourse/discourse/pull/30410](https://github.com/discourse/discourse/pull/30410)

See also:

> [@SSO broken after rebuild with stable v3.3.3](https://meta.discourse.org/t/sso-broken-after-rebuild-with-stable-v3-3-3/343847/10):
>
> I suspect the issue here is not the [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true) security fix but rather the nginx change. On tests-passed we had to make a followup on Thursday because it was causing problems on some environments and [another user](https://github.com/discourse/discourse/pull/30383#issuecomment-2557996967) on Github noted CSRF issues. I have a backport ready for that: [FIX: Simplify nginx config change (#30383) by pmusaraj · Pull Request #30410 · discourse/discourse · GitHub](https://github.com/discourse/discourse/pull/30410), it should be merged shortly (once someone in the team approves it, though it’s Sunday for most people). You’…

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [December 22, 2024, 11:23pm UTC](https://meta.discourse.org/t/sudden-http-403-errors-with-discourse-docker-bad-csrf/343948/3 "2024-12-22T23:23:25Z")

</div>

> [@claas](#):
>
> Maybe this will fix it in 3.3.4?

Can you try it out?

---

<div class="post-metadata">

### Author: ![claas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/claas/32/71725_2.png) [@claas](https://meta.discourse.org/u/claas)
#### Post date: [December 24, 2024, 9:54am UTC](https://meta.discourse.org/t/sudden-http-403-errors-with-discourse-docker-bad-csrf/343948/4 "2024-12-24T09:54:43Z")

</div>

@sam Thank you, I just verified and I can log in again in 3.3.3 + 1, so the PR mentioned above resolved the issue.

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [December 25, 2024, 8:05pm UTC](https://meta.discourse.org/t/sudden-http-403-errors-with-discourse-docker-bad-csrf/343948/5 "2024-12-25T20:05:24Z")

</div>

Thanks for checking!

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [December 25, 2024, 8:05pm UTC](https://meta.discourse.org/t/sudden-http-403-errors-with-discourse-docker-bad-csrf/343948/6 "2024-12-25T20:05:28Z")

</div>


