1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-25 12:26:40 +02:00
Commit Graph

13372 Commits

Author SHA1 Message Date
Sébastien Helleu e5df225d9f irc: limit size of data received from the server to prevent memory exhaustion
A malicious or compromised IRC server could send data with no end-of-line
(or a flood of "005" messages), making WeeChat accumulate it in a buffer
that grew without limit, until all memory was exhausted.

The unterminated received message and the accumulated "005" (ISUPPORT)
data are now bounded by IRC_SERVER_RECV_MSG_MAX_LENGTH and
IRC_SERVER_ISUPPORT_MAX_LENGTH: extra data is ignored once the limit is
reached.
2026-06-06 14:17:41 +02:00
Sébastien Helleu f5fa814fa4 core: fix timing attack on TOTP validation (GHSA-vhv8-g2r9-cwcc)
weecrypto_totp_validate compared the generated and client-supplied OTPs
with strcmp and broke out of the time-window loop on the first match.
Both choices leaked information via response timing: strcmp leaked the
expected OTP digit-by-digit (shrinking the brute-force search from
~10^digits to a handful of guesses within the 30-second window), and
the early break leaked which window offset matched.

Compare in constant time with string_memcmp_constant_time and always
iterate the full window, OR-ing the result into otp_ok without an
early exit.

This affects both relay protocols (which call totp_validate via the
public info hook) and any other caller of the info hook.
2026-06-06 14:10:15 +02:00
Sébastien Helleu 34cbe56a6f relay/irc: fix timing attack on PASS command (GHSA-vhv8-g2r9-cwcc)
The IRC relay protocol's PASS handler compared the server password with
the client-supplied value using strcmp, leaking the password byte-by-byte
via response timing. This is the same class of bug fixed for the api and
weechat protocols, on a separate code path that did not go through
relay_auth_check_password_plain.

Extract the HMAC-then-constant-time-compare logic from
relay_auth_check_password_plain into relay_auth_password_equals, then
use it in both the plain-auth wrapper and the IRC PASS handler.
2026-06-06 14:08:23 +02:00
Sébastien Helleu a17a80f1d0 relay: fix timing attack on password authentication (GHSA-vhv8-g2r9-cwcc)
The relay authentication used non-constant-time comparisons (strcasecmp,
strcmp) to verify password hashes and plaintext passwords, allowing an
attacker to derive the expected hash byte-by-byte from response timing
and then authenticate without knowing the password.

- SHA/PBKDF2 hex hash comparisons: normalize the client-supplied hash to
  uppercase and compare in constant time over the fixed expected length.
- Plaintext password comparison: HMAC-SHA256 both passwords with a fresh
  per-call random key and compare the fixed-size MACs in constant time,
  hiding both per-byte timing and the password length.

Add string_memcmp_constant_time helper in core, exposed via the plugin
API. Bump WEECHAT_PLUGIN_API_VERSION accordingly.
2026-06-06 13:01:52 +02:00
Sébastien Helleu 405707d544 relay: limit size of decompressed websocket frame to prevent memory exhaustion (GHSA-v2v4-45wm-5cr3)
An authenticated relay client using the permessage-deflate websocket
extension could send a small compressed frame that decompresses to an
unbounded amount of data, exhausting all memory and crashing WeeChat.

The output buffer in relay_websocket_inflate is now capped to
WEBSOCKET_INFLATE_MAX_SIZE: frames decompressing beyond this limit are
rejected and the connection is closed.
2026-06-06 12:58:20 +02:00
Sébastien Helleu 2a272a7543 core: set max curl version for symbols
Set max curl version for these symbols:

- CURLPROTO_RTMP: 8.20.0
- CURLPROTO_RTMPT: 8.20.0
- CURLPROTO_RTMPE: 8.20.0
- CURLPROTO_RTMPTE: 8.20.0
- CURLPROTO_RTMPS: 8.20.0
- CURLPROTO_RTMPTS: 8.20.0
- CURLAUTH_DIGEST_IE: 8.21.0
- CURLOPT_KRBLEVEL: 8.17.0
2026-06-06 12:47:07 +02:00
Sébastien Helleu d4b15ea432 ci: force version 3.39.16 of schemathesis
Version 4.0.0 of schemathesis brings major breaking changes, the API tests with
this version will be changed on main branch only.
2025-06-22 09:36:06 +02:00
Sébastien Helleu 3a954405d7 core: set max version for Curl symbol CURLOPT_SSL_FALSESTART 2025-06-21 20:34:13 +02:00
Sébastien Helleu 42ae480f0a tests: add test with a float number using a lot of decimals in calculation of expression
This test validates the fix made in commit
5b4820ab06 and will prevent regression with such
numbers.
2025-06-07 17:01:11 +02:00
Sébastien Helleu f4fe63c312 core: update ChangeLog (issue #2251) 2025-05-25 10:00:24 +02:00
Sébastien Helleu 68b017935a core: fix build on FreeBSD (issue #2251)
Check if the resolv library is found before checking if it has res_init.
2025-05-25 09:58:19 +02:00
Albert Lee 97ceefd183 core: avoid dynamic format strings for Clang -Werror=format-security 2025-05-25 09:58:17 +02:00
Albert Lee 7a757d94c0 gui: use NCURSES_CFLAGS if available 2025-05-25 09:58:08 +02:00
Albert Lee f07d439cec python: use built-in CMake FindPython module from CMake 3.12 or higher 2025-05-25 09:57:59 +02:00
Albert Lee 3f670d31fe core: always define _XPG4_2 and __EXTENSIONS__ on Solaris/illumos 2025-05-25 09:56:21 +02:00
Albert Lee 558087325d core: check if res_init requires linking with libresolv 2025-05-25 09:56:19 +02:00
Albert Lee 3766d52bd3 core: improve support for non-macro htonll and htobe64 2025-05-25 09:56:17 +02:00
Albert Lee 2df0b3e2c3 core: use same msgfmt invocation to perform checks and create weechat.mo
On Illumos, msgfmt aborts when `--output-file=/dev/null` is used.
2025-05-25 09:56:15 +02:00
Albert Lee c1115c04d5 lua: use LUA_CFLAGS from pkg-config 2025-05-25 09:56:12 +02:00
Albert Lee e6d850daa0 core: include pthread.h for pthread types 2025-05-25 09:56:10 +02:00
Sébastien Helleu a0ffb9e5dd core, plugins: replace "%p" by "%lx" in calls to sscanf 2025-05-18 22:29:39 +02:00
Sébastien Helleu 95a940294e Revert "core, plugins: replace "%lx" by "%p" in calls to sscanf"
This reverts commit e64ab3c675.

This was causing incorrect conversion of strings "0x..." to pointers on systems
like Solaris/illumos.

And as a side effect, buffers were sometimes empty in weechat relay clients
like glowing-bear.
2025-05-18 22:29:39 +02:00
Sébastien Helleu d49c6515e4 relay/api: use specifier %@ for times formatted by util_strftimeval 2025-05-18 22:23:14 +02:00
Sébastien Helleu 2f375b652b core: add support of specifier %@ for UTC time in function util_strftimeval 2025-05-18 22:23:04 +02:00
Sébastien Helleu 8a024dddad Version 4.6.4-dev 2025-05-11 11:25:48 +02:00
Sébastien Helleu 951c030082 Version 4.6.3 v4.6.3 2025-05-11 11:22:11 +02:00
Sébastien Helleu 5def4f72fe core: add API function util_version_number in upgrade guidelines 2025-05-11 10:00:27 +02:00
Sébastien Helleu 3db2f71112 core: fix buffer overflow in function eval_string_range_chars 2025-05-10 21:38:26 +02:00
Sébastien Helleu 09917a807b core: fix buffer overflow in function eval_string_base_encode 2025-05-10 21:31:22 +02:00
Sébastien Helleu 334f88ae2c core: fix buffer overflow in function eval_syntax_highlight_colorize 2025-05-10 21:30:33 +02:00
Sébastien Helleu 2e14645691 core: fix buffer overflow in function util_parse_time 2025-05-08 19:18:59 +02:00
Sébastien Helleu 2c0bbdf9b9 core: fix integer overflow in function util_version_number 2025-05-08 19:18:59 +02:00
Sébastien Helleu 5839df90e7 core: fix memory leak in function util_parse_delay 2025-05-08 18:39:03 +02:00
Sébastien Helleu 6082453002 core: fix integer overflow in base32 encoding/decoding 2025-05-05 21:39:00 +02:00
Sébastien Helleu d0568dce79 core: fix integer overflow with decimal numbers in calculation of expression 2025-05-05 21:38:28 +02:00
Sébastien Helleu 00a873dda0 ci: replace TCL 8.7 by 8.6 in FreeBSD CI 2025-04-21 08:47:37 +02:00
Sébastien Helleu 18e2badfbd Version 4.6.3-dev 2025-04-18 20:43:53 +02:00
Sébastien Helleu 120b048efb Version 4.6.2 v4.6.2 2025-04-18 20:39:02 +02:00
Sébastien Helleu 600e438b90 debian: update changelog 2025-04-18 20:03:35 +02:00
Sébastien Helleu bf3a8628ae debian: bump Standards-Version to 4.7.2 2025-04-18 20:01:08 +02:00
Sébastien Helleu 1478ecd77d core: fix write of weechat.log to stdout with weechat-headless --stdout (issue #2247) 2025-04-15 08:16:06 +02:00
Sébastien Helleu 5c9d9bc8fc core: add refresh of window title on buffer switch, when option weechat.look.window_title is set 2025-04-11 19:32:43 +02:00
Sébastien Helleu ff00323363 Version 4.6.2-dev 2025-04-09 13:37:27 +02:00
Sébastien Helleu 1d2e5ce700 Version 4.6.1 v4.6.1 2025-04-09 13:33:19 +02:00
Sébastien Helleu 2eebe241ab core: consider all keys are safe in cursor context (issue #2244) 2025-04-04 18:55:46 +02:00
Sébastien Helleu e93cebf02c core: update ChangeLog (issue #2243) 2025-04-02 23:05:16 +02:00
Alvar Penning c3db4946b2 perl: fix build when multiplicity is not available
Building WeeChat 4.6.0 on OpenBSD failed with the following error.

> /usr/ports/pobj/weechat-4.6.0/weechat-4.6.0/src/plugins/perl/weechat-perl.c:356:13: error: expected ')'
>             function) < 0)
>             ^
> /usr/ports/pobj/weechat-4.6.0/weechat-4.6.0/src/plugins/perl/weechat-perl.c:352:9: note: to match this '('
>     if (weechat_asprintf (
>         ^
> /usr/ports/pobj/weechat-4.6.0/weechat-4.6.0/src/plugins/perl/../weechat-plugin.h:1312:31: note: expanded from macro 'weechat_asprintf'
>     (weechat_plugin->asprintf)(__result, __fmt, ##__argz)

On further inspection, the line in question was recently altered in
099e11d7b8, where a comma was forgotten in the
else branch of the MULTIPLICITY ifdef.

After adding the comma, WeeChat builds as usual.
2025-04-02 23:05:14 +02:00
Sébastien Helleu 86d4da2fd1 irc: display nick changes and quit messages when option irc.look.ignore_tag_messages is enabled (closes #2241) 2025-03-28 12:11:29 +01:00
Sébastien Helleu e39ef93903 Version 4.6.1-dev 2025-03-28 12:10:53 +01:00
Sébastien Helleu 9663f79746 Version 4.6.0 v4.6.0 2025-03-23 10:42:41 +01:00