Hi Dinko!

On Wed, Nov 18, 2026 at 06:05:03PM +0100, Dinko Korunic wrote:
> Hi,
> 
> this series fixes two bugs in the payload and payload_lv sample fetches
> (src/payload.c), against master (114010a7f, 3.5-dev13).
> 
>   1) BUG/MEDIUM: out-of-range offsets or lengths (negative, or above
>      4G) are truncated to unsigned ints and wrap the 32-bit bounds check,
>      so the fetch reads outside the buffer and the process crashes on the
>      first connection reaching the rule, e.g. req.payload(-1,1) or
>      req.payload_lv(1,-1). This needs such an expression in the
>      configuration, so it is not a vulnerability per the threat model,
>      only a crash that nothing warns about. All offsets and lengths are
>      now bounded to [0, INT_MAX] at parsing time.
> 
>   2) BUG/MINOR: an absolute payload_lv offset2 has been read as half of
>      its value since 1.6-dev3 (bf65cd4d77), because only relative values
>      were encoded with the LSB flag. It is now always encoded.
> 
> Tested on master before and after each patch:
>   - patch 1: the out-of-range forms above crash before, and fail to load
>     with an explicit error after; in-range values, including the largest
>     accepted ones, still load and return the same bytes as before.
>   - patch 2: with a payload "01 41 42 43 44 45", payload_lv(0,1,4) and
>     (0,1,5) return 0x42 and 0x43 before, 0x44 and 0x45 after; relative
>     and implicit offsets are unchanged.
> 
> Full "default,bug,devel" suite on the tip: 258 passed, 2 failed
> (log/ring_unix_log_forward.vtc and http-messaging/websocket.vtc), and
> both fail the same way on unpatched master here, so they are
> environmental. Builds with ERR=1.
> 
> Both should be backported to all supported versions; patch 2 needs
> patch 1 for its context. Backport notes are in each commit message.
> 
> Found during an LLM-assisted audit, verified manually.

Both look good and were merged now. Thank you very much!
Willy


Reply via email to