bug: Continuwuity in OAuth2 exclusive mode causes POST /_matrix/client/v3/register to return the wrong error code #2586

Closed
opened 2026-11-23 14:01:11 +00:00 by nex · 2 comments
Owner

What is the bug?

When user-interactive authentication is disabled, continuwuity returns 404 / M_UNRECOGNIZED when POST /_matrix/client/v3/register is called. This is not a legal error code for that endpoint, and consequently OAuth-only homeservers will confuse Meowlnir (unexpected error), causing it to kick users on those servers when failsafe mode is enabled.

This resulted in someone getting kicked out of continuwuity's rooms because we currently have failsafe mode enabled. The correct response here would be 403 / M_FORBIDDEN.

Steps to reproduce

  1. Create a continuwuity homeserver with exclusive oauth mode (or enable OIDC or whatever)
  2. Query POST /_matrix/client/v3/register

Server name and version

cybernetica.cc 26.9.4 (dda4bdc)

Additional context

2026-11-23T12:56:04.902Z DBG Request completed duration=334.573246 method=POST req_body={} req_id=1102 response_length=100 response_mime=application/json status_code=404 url=https://matrix.cybernetica.cc/_matrix/client/v3/register
2026-11-23T12:56:04.902Z ERR failed to query registration flows for insecure registration check error="M_UNRECOGNIZED (HTTP 404): User-interactive authentication is unavailable on this server" homeserver=cybernetica.cc
2026-11-23T12:56:04.902Z ERR Error executing protection error="M_UNRECOGNIZED (HTTP 404): User-interactive authentication is unavailable on this server"
2026-11-23T12:56:05.399Z DBG Request completed duration=496.578776 method=POST req_body={"reason":"insecure registration (no email or captcha) on your home server","user_id":"@zixha:cybernetica.cc"} req_id=1103 response_length=2 response_mime=application/json status_code=200 url=http://caddy:8008/_matrix/client/v3/rooms/%21c10y-jrqTOLA-GfF5T00rpGRvbzIyNUPduR9y7TeJzQ/kick?device_id=CWYO9WHAJQ&org.matrix.msc3202.device_id=CWYO9WHAJQ&user_id=%40meowlnir_2f988590-d8a3-4f3f-8e65-83e0cd365ec9%3Aasgard.chat
### What is the bug? When user-interactive authentication is disabled, continuwuity returns `404 / M_UNRECOGNIZED` when `POST /_matrix/client/v3/register` is called. This is [not a legal error code for that endpoint](https://spec.matrix.org/v1.19/client-server-api/#post_matrixclientv3register:~:text=cheeky%5Fmonkey%22%20%7D-,Responses), and consequently OAuth-only homeservers will confuse Meowlnir (unexpected error), [causing it to kick users on those servers when failsafe mode is enabled](https://github.com/maunium/meowlnir/blob/98bc8aba1da627c68915625d4b7f073ca892f8ef/policyeval/protections/insecure_registration.go#L119-L125). This resulted in someone getting kicked out of continuwuity's rooms because we currently have failsafe mode enabled. The correct response here [would be `403 / M_FORBIDDEN`](https://spec.matrix.org/v1.19/client-server-api/#post_matrixclientv3register:~:text=or%20that%20registration%20is%20generally%20not%20supported%20by%20the%20homeserver). ### Steps to reproduce 1. Create a continuwuity homeserver with `exclusive` oauth mode (or enable OIDC or whatever) 2. Query `POST /_matrix/client/v3/register` ### Server name and version cybernetica.cc 26.9.4 (dda4bdc) ### Additional context ``` 2026-11-23T12:56:04.902Z DBG Request completed duration=334.573246 method=POST req_body={} req_id=1102 response_length=100 response_mime=application/json status_code=404 url=https://matrix.cybernetica.cc/_matrix/client/v3/register 2026-11-23T12:56:04.902Z ERR failed to query registration flows for insecure registration check error="M_UNRECOGNIZED (HTTP 404): User-interactive authentication is unavailable on this server" homeserver=cybernetica.cc 2026-11-23T12:56:04.902Z ERR Error executing protection error="M_UNRECOGNIZED (HTTP 404): User-interactive authentication is unavailable on this server" 2026-11-23T12:56:05.399Z DBG Request completed duration=496.578776 method=POST req_body={"reason":"insecure registration (no email or captcha) on your home server","user_id":"@zixha:cybernetica.cc"} req_id=1103 response_length=2 response_mime=application/json status_code=200 url=http://caddy:8008/_matrix/client/v3/rooms/%21c10y-jrqTOLA-GfF5T00rpGRvbzIyNUPduR9y7TeJzQ/kick?device_id=CWYO9WHAJQ&org.matrix.msc3202.device_id=CWYO9WHAJQ&user_id=%40meowlnir_2f988590-d8a3-4f3f-8e65-83e0cd365ec9%3Aasgard.chat ```
ginger self-assigned this 2026-11-23 14:02:30 +00:00
Owner

frankly I think this is a spec oversight 🕴 but whatever

frankly I think this is a spec oversight 🕴 but whatever
Author
Owner

Fixed by #2589

Fixed by #2589
nex closed this issue 2026-11-23 15:31:14 +00:00
Sign in to join this conversation.
No milestone
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
continuwuation/continuwuity#2586
No description provided.