1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-12 14:14:48 +02:00

13381 Commits

Author SHA1 Message Date
Sébastien Helleu f07a63755c core: add CVE IDs in ChangeLog 2026-06-09 22:13:57 +02:00
Sébastien Helleu c6f30816dd tests: increase buffer size for injection of fake IRC message 2026-06-07 08:51:20 +02:00
aizu-m c55b5836f0 relay: fix out-of-bounds read in relay_http_print_log_request (#2324) 2026-06-06 14:37:21 +02:00
Sébastien Helleu e93db7f99d relay: limit size of partial message received while reading an HTTP request to prevent memory exhaustion
A relay client could send data with no end-of-line (an unterminated method
or header line) and dribble its payload, making WeeChat accumulate it in the
partial message buffer that grew without limit, until all memory was
exhausted. This path is reachable before authentication during websocket
initialization with the "weechat" and "irc" protocols.

The accumulated partial message is now bounded by
RELAY_HTTP_PARTIAL_MESSAGE_MAX_LENGTH: once the limit is reached, the extra
data is ignored.
2026-06-06 14:37:21 +02:00
aizu-m 22ee76cdd6 xfer: fix out-of-bounds read in xfer_chat_recv_cb on empty line (#2323) 2026-06-06 14:33:34 +02:00
aizu-m cf2d0733d3 irc: fix out-of-bounds read in DCC command with quoted filename (#2322) 2026-06-06 14:31:35 +02:00
aizu-m 75b72e7f69 xfer: replace directory separator in remote nick by underscore in download filename (#2321) 2026-06-06 14:21:34 +02:00
Sébastien Helleu 03a6d9306a api: fix infinite loop in function string_replace when the search string is empty 2026-06-06 14:19:37 +02:00
Sébastien Helleu 398cfc473a relay: limit size of received websocket frame and HTTP body to prevent memory exhaustion
A relay client could announce a huge websocket frame (or HTTP body via
"Content-Length") and dribble its payload, making WeeChat accumulate it
in a buffer that grew without limit, until all memory was exhausted. The
websocket frame path is reachable before authentication with the
"weechat" and "irc" protocols.

The announced websocket frame length and HTTP "Content-Length" are now
bounded by WEBSOCKET_FRAME_MAX_LENGTH and RELAY_HTTP_BODY_MAX_LENGTH: an
oversized websocket frame closes the connection, and an oversized body is
rejected.
2026-06-06 14:19:17 +02:00
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