You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Directory accepts mailbox payloads it can't return: gateway truncates responses over ~8 KiB #1982
post_mailbox accepts bodies up to V1_MAX_BUFFER_SIZE (65536 bytes), but handle_ohttp_gateway pads/cuts every bhttp response to BHTTP_REQ_BYTES (8144) with bhttp_bytes.resize(BHTTP_REQ_BYTES, 0) (payjoin-mailroom/src/directory.rs).
When a stored payload doesn't fit, the directory answers 200 with an OHTTP response that decrypts fine but holds a truncated bhttp message, so the client fails to parse it (a field was truncated) instead of getting a clean error.
This also affects V1 fallback: the V1 request ({psbt}\n{query}) reaches the receiver through the same GET, so a V1 original PSBT over ~8 KB in base64 can never be read by the receiver.
Expected behavior
The directory shouldn't store what it can't hand back: reject mailbox payloads (and V1 requests) whose response wouldn't fit, and never truncate a response.
Steps to reproduce
Through the OHTTP gateway, POST /{mailbox_id} with a 65536-byte body. The directory answers 200.
Through the gateway, GET /{mailbox_id}.
Decapsulate the response and parse it as bhttp: it fails because the content was cut at 8144 bytes.
Activity