Commit graph

6,934 commits

Author SHA1 Message Date
Acts1631
a5bd495733 otr: cap reassembled multi-fragment message size (remote DoS)
enqueue_otr_fragment() reassembles ?OTR: multi-fragment OTR messages
into a per-peer heap buffer (opc->full_msg), grown by realloc on every
fragment that does not end with the OTR end tag '.'. The buffer has no
total size limit.

A remote IRC user can open a reassembly by sending a query PRIVMSG whose
body begins with ?OTR: and lacks the trailing '.', then keep sending
further PRIVMSGs: each is appended to opc->full_msg (roughly one
IRC-line-length worth of bytes per fragment) with no bound, growing it
until the victim irssi is OOM-killed. No OTR session is required -- the
peer context is created lazily by otr_find_context(..., create=1) on
first contact in otr_receive(), and sig_message_private
(signal_add_first on "message private") feeds every query PRIVMSG
straight to otr_receive()/enqueue_otr_fragment().

Add an OTR_REASM_MAX_SIZE (256 KiB) cap on the total reassembled size.
When appending a fragment would exceed it, free and reset the
reassembly state and return OTR_MSG_ERROR, on both the
subsequent-fragment and initial-fragment paths. 256 KiB is far above
any legitimate OTR message, so there is no functional regression.
2026-07-06 10:41:55 -04:00
Acts1631
27f857e37b otr: fix off-by-one in reassembly buffer growth check (heap overflow)
In enqueue_otr_fragment(), once a ?OTR: reassembly is open, each
continuation fragment is appended to opc->full_msg and the buffer is
grown only if there isn't enough room:

    if (msg_len > (opc->msg_size - opc->msg_len)) { realloc(...); }
    memcpy(opc->full_msg + opc->msg_len, msg, msg_len);
    opc->msg_len += msg_len;
    opc->full_msg[opc->msg_len] = '\0';

The comparison uses '>' instead of '>='. When a fragment's length is
exactly equal to the remaining space (opc->msg_size - opc->msg_len),
the condition is false, so no realloc happens; the memcpy itself still
fits, but the following NUL-terminator write at
opc->full_msg[opc->msg_len] lands exactly one byte past the end of the
allocation, corrupting the adjacent heap chunk.

This is remotely reachable the same way as the other reassembly bugs
in this file: any user who can send the victim a private message can
drive the running remaining-space counter to land on an exact match
(remaining space grows by a small, attacker-observable amount on every
realloc, and fragment lengths are fully attacker controlled), then send
one more fragment of that exact length to trigger the overflow.

Fix the comparison to '>=' so the buffer is grown whenever there isn't
room for both the fragment bytes and the terminator.
2026-07-06 10:41:17 -04:00
Acts1631
0b7fae5652 otr: guard empty fragment against size_t underflow in reassembly
In enqueue_otr_fragment(), after a ?OTR: reassembly has been opened
(opc->full_msg != NULL), the end-tag check evaluates
msg[msg_len - 1] where msg_len is size_t. If a PRIVMSG whose body
decodes to an empty string reaches this path, msg_len is 0 and
msg_len - 1 wraps to SIZE_MAX, indexing far off the page and crashing
irssi (SIGSEGV). The initial-fragment path is safe because it is gated
by 'pos &&' (strstr of an empty string returns NULL), but the
open-reassembly path has no such guard.

recode_in() returns a non-NULL empty string for an empty PRIVMSG body,
and sig_message_private (signal_add_first on "message private") feeds
it straight to otr_receive()/enqueue_otr_fragment(). Relays/bouncers
such as bitlbee/znc and some ircds pass PRIVMSGs with an empty trailing
parameter through to the client.

Drop an empty fragment early: if a reassembly is open, keep waiting for
more (OTR_MSG_WAIT_MORE); otherwise treat it as an original message
(OTR_MSG_ORIGINAL), matching the existing behaviour of the else branch.
2026-07-06 10:41:01 -04:00
ailin-nemui
43f1727ef9
Merge pull request #1611 from horgh/horgh/muon-meson-fmt-workflow
Add muon-meson fmt GitHub Actions workflow
2026-01-27 08:02:34 +00:00
William Storey
54bb34e14f Add muon fmt GitHub Actions workflow 2026-01-26 21:02:10 -08:00
William Storey
7ca9fd5aee Format root meson.build 2026-01-26 21:02:10 -08:00
Ailin Nemui
221d520c37 run meson formatter 2026-01-25 22:07:44 +01:00
ailin-nemui
80b8875fea
Merge pull request #1607 from ailin-nemui/gio-resolver-fixes
GResolver fixes
2026-01-25 18:22:20 +00:00
Ailin Nemui
88afc78aac GResolver fixes
fix issues brought up by @horgh in #1580
2026-01-25 00:25:44 +01:00
ailin-nemui
00466fe5be
Merge pull request #1605 from ailin-nemui/gio-resolver-old
add compatibility code for older GResolver
2026-01-24 20:04:17 +00:00
ailin-nemui
64db7abcec
Merge pull request #1606 from ailin-nemui/comment-warning
fix space in end comment
2026-01-24 20:03:33 +00:00
Ailin Nemui
0157a4424b fix clang-format-xs boot code 2026-01-24 20:53:29 +01:00
Ailin Nemui
00146211d0 fix space in end comment 2026-01-24 18:06:21 +01:00
Ailin Nemui
e9281b2f11 add compatibility code for older GResolver 2026-01-24 18:05:05 +01:00
ailin-nemui
3629a122c6
Merge pull request #1604 from ailin-nemui/perl-irc-dcc
make Irssi::Irc usable without dcc
2026-01-24 15:28:52 +00:00
Ailin Nemui
45d3013f9e up abi 2026-01-24 14:27:18 +01:00
Ailin Nemui
a54677ce99 up perl api 2026-01-24 14:27:16 +01:00
Ailin Nemui
2012668bef make Irssi::Irc usable without dcc 2026-01-24 14:27:16 +01:00
Ailin Nemui
51322d6af1 restore ip4_any 2026-01-24 13:53:23 +01:00
ailin-nemui
3c65684643
Merge pull request #1568 from nikolas/patch-2
Add a few more compile dependencies to INSTALL document
2026-01-23 21:18:17 +00:00
nikolas
c6d15ee461 Add a few more compile dependencies to INSTALL document 2026-01-23 22:17:39 +01:00
ailin-nemui
62031f5bdc
Merge pull request #1580 from ailin-nemui/gio-resolver
use GIO resolver
2026-01-23 20:42:55 +00:00
Ailin Nemui
e64ed836a5 up glib wrap 2026-01-23 21:21:10 +01:00
Ailin Nemui
51f2a4f7fb use GIO resolver
change: rename resolve_prefer_ipv6 -> irssiproxy_prefer_ipv6
2026-01-23 21:21:10 +01:00
ailin-nemui
d5be7d7756
Merge pull request #1578 from ailin-nemui/cygwin
make compilation work on cygwin
2026-01-23 20:20:43 +00:00
ailin-nemui
81887a6224
Merge pull request #1599 from ailin-nemui/docs
run syncdocs.sh
2025-12-27 21:46:58 +00:00
ailin-nemui
97304bb7c0
Merge pull request #1600 from ailin-nemui/github
github actions: update package lists
2025-12-27 21:46:19 +00:00
Ailin Nemui
d30cdafcff github actions: update package lists 2025-12-27 22:41:02 +01:00
Ailin Nemui
82b253f63e run syncdocs.sh
added New-users and qna, removed faq and startup-HOWTO from sync
2025-12-27 22:35:23 +01:00
ailin-nemui
ebdf863925
Merge pull request #1597 from ailin-nemui/scripts
run syncscripts.sh
2025-12-27 19:42:18 +00:00
Ailin Nemui
d145f24c22 run syncscripts.sh
autoop 1.10 -> 1.11
mail 2.92 -> 2.93
scriptassist 2022053100 -> 2023111700
2025-12-27 20:41:26 +01:00
ailin-nemui
6c72dc14fa
Merge pull request #1594 from soulseller/fix/hide-text-style-colors
formats: fix hide_text_style and hide_colors to mitigate color bleed
2025-11-27 11:16:35 +00:00
soulseller
3811b1ffc9 formats: fix hide_text_style and hide_colors to mitigate color bleed 2025-11-27 00:59:18 +02:00
ailin-nemui
89dc74cbdd
Merge pull request #1591 from soulseller/fix/netsplit-nickname-truncation
fe-netsplit: fix nickname truncation to avoid trailing comma-space
2025-11-25 13:19:12 +00:00
ailin-nemui
bab97b4c0c
Merge pull request #1588 from arza-zara/patch-1
Increase default scrollback_lines
2025-11-25 12:23:40 +00:00
soulseller
5416843d2d fe-netsplit: fix nickname truncation to avoid trailing comma-space 2025-11-23 15:15:24 +02:00
ailin-nemui
f4a4bcb4b8
Merge pull request #1590 from jremes-foss/lusers-in-typo-fix
Typo fix in docs/help/in/lusers.in
2025-11-22 15:08:00 +00:00
Juha Remes
3316202c48 Typo fix in docs/help/in/lusers.in 2025-11-22 14:27:53 +00:00
arza
f293277765
Increase default scrollback_lines
It seems common that people miss important messages when being away and want to increase the scrollback.
2025-09-23 00:01:54 +03:00
ailin-nemui
e70993c4b6
Merge pull request #1577 from ailin-nemui/glib276
replace str->str & g_string_free with g_string_free_and_steal
2025-07-26 17:32:43 +00:00
Ailin Nemui
989ddd8429 replace shared_module with shared_library
according to mesonbuild irc chat
2025-07-25 19:49:53 +02:00
Ailin Nemui
df8aa42778 make compilation work on cygwin 2025-07-25 16:20:28 +01:00
ailin-nemui
cc24b2c54c
Merge pull request #1579 from ailin-nemui/ghvoid
fix xbps github action
2025-07-25 14:48:09 +00:00
Ailin Nemui
d21ff2e658 fix xbps 2025-07-25 16:24:11 +02:00
Ailin Nemui
8eee36d1ea replace str->str & g_string_free with g_string_free_and_steal
solving unused warning in GLib 2.76
2025-07-22 12:03:49 +02:00
ailin-nemui
995e77c30d
Merge pull request #1575 from irssi/hilight_syntax_update
Add -priority to hilight syntax line
2025-07-21 16:51:55 +00:00
ailin-nemui
216715bc81
Merge pull request #1576 from ailin-nemui/solaris
fix github solaris test
2025-07-21 16:51:40 +00:00
Ailin Nemui
9f0b2bc50d detect third argument type of puts 2025-07-21 18:35:09 +02:00
Ailin Nemui
6276fe1a68 debug logging solarisvm prepare 2025-07-20 23:03:52 +02:00
Jari Matilainen
7681cb7585
Add -priority to hilight syntax line 2025-07-20 22:40:59 +02:00