bug: 500 Internal Server Error ("invalid digit found in string") when passing a malformed string to the from parameter in /messages #2530

Open
opened 2026-11-14 19:14:32 +00:00 by se-prok · 1 comment

What is the bug?

When a client passes a malformed pagination token (a string containing non-numeric characters) to the from query parameter on the GET /_matrix/client/v3/rooms/{roomId}/messages endpoint, server returns a 500 Internal Server Error and logs "invalid digit found in string".

Server console:
2026-11-14T19:01:33.897820Z ERROR conduwuit_core::error::response: Server error, error: invalid digit found in string, error_debug: invalid digit found in string, kind: Unknown, status: 500 Internal Server Error
at src/core/error/response.rs:17 on conduwuit:worker ThreadId(9)

2026-11-14T19:01:33.897983Z ERROR conduwuit_router::request: 500 Internal Server Error, method: GET, uri: /_matrix/client/v3/rooms/!_HzbfxOuzuJHrkmfjXrEJ5xHEH7n7LZ0DFEM0cat0I0/messages?limit=1&dir=b&from=str37954
at src/router/request.rs:105 on conduwuit:worker ThreadId(9)
in conduwuit_router::layers::router with method=GET path=/_matrix/client/v3/rooms/{room_id}/messages ip="127.0.0.1"

2026-11-14T19:01:33.898054Z ERROR tower_http::trace::on_failure: response failed, classification: Status code: 500 Internal Server Error, latency: 1 ms
at /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tower-http-0.7.1/src/trace/on_failure.rs:93 on conduwuit:worker ThreadId(9)
in conduwuit_router::layers::router with method=GET path=/_matrix/client/v3/rooms/{room_id}/messages ip="127.0.0.1"

Steps to reproduce

The .pcapng file containing the request and the response is attached.

Server name and version

continuwuity 26.9.1 (0727d564a)

Additional context

No response

### What is the bug? When a client passes a malformed pagination token (a string containing non-numeric characters) to the `from` query parameter on the `GET /_matrix/client/v3/rooms/{roomId}/messages` endpoint, server returns a `500 Internal Server Error` and logs "invalid digit found in string". Server console: 2026-11-14T19:01:33.897820Z ERROR conduwuit_core::error::response: Server error, error: invalid digit found in string, error_debug: invalid digit found in string, kind: Unknown, status: 500 Internal Server Error at src/core/error/response.rs:17 on conduwuit:worker ThreadId(9) 2026-11-14T19:01:33.897983Z ERROR conduwuit_router::request: 500 Internal Server Error, method: GET, uri: /_matrix/client/v3/rooms/!_HzbfxOuzuJHrkmfjXrEJ5xHEH7n7LZ0DFEM0cat0I0/messages?limit=1&dir=b&from=str37954 at src/router/request.rs:105 on conduwuit:worker ThreadId(9) in conduwuit_router::layers::router with method=GET path=/_matrix/client/v3/rooms/{room_id}/messages ip="127.0.0.1" 2026-11-14T19:01:33.898054Z ERROR tower_http::trace::on_failure: response failed, classification: Status code: 500 Internal Server Error, latency: 1 ms at /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tower-http-0.7.1/src/trace/on_failure.rs:93 on conduwuit:worker ThreadId(9) in conduwuit_router::layers::router with method=GET path=/_matrix/client/v3/rooms/{room_id}/messages ip="127.0.0.1" ### Steps to reproduce The .pcapng file containing the request and the response is attached. ### Server name and version continuwuity 26.9.1 (0727d564a) ### Additional context _No response_
Owner

I think this is a duplicate of #2217, just with a different endpoint?

I think this is a duplicate of #2217, just with a different endpoint?
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#2530
No description provided.