]> git.ipfire.org Git - thirdparty/rspamd.git/commit
[Fix] Fix infinite loop and OOB read in archive processing master
authorVsevolod Stakhov <vsevolod@rspamd.com>
Wed, 8 Apr 2026 19:27:39 +0000 (20:27 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Wed, 8 Apr 2026 19:29:31 +0000 (20:29 +0100)
commit6bfc9cb7afe77fd5308ac3b61f8a29675f96212b
treeb324f6be5a67cbdd321dc7bde70636c2ffee83b1
parent8408f6403dbdb853d1cfd0864511510ec013419f
[Fix] Fix infinite loop and OOB read in archive processing

- RAR v5 extra area parsing: fix wrong loop boundary (used advanced `p`
  instead of `ex + extra_sz`), wrong advancement (`cur_sz` alone didn't
  account for the size vint bytes), and wrong remain calculation for the
  second vint read. Add bounds validation for `cur_sz`.
- 7zip codec ID: validate `p + sz <= end` before reading codec ID bytes
  to prevent out-of-bounds read with malformed archives.
src/libmime/archives.c