The relay plugin checks the password received from a client in the command init of the weechat protocol, as plain text (option password) or hashed (option password_hash), for example with PBKDF2, which the client can choose in the command handshake (allowed by default, see option relay.network.password_hash_algo), and which computes the hash with the number of iterations set in the option relay.network.password_hash_iterations (100000 by default).
Every option password and password_hash received in the command init is checked, so a single command init can contain thousands of hashed passwords, and force WeeChat to compute as many PBKDF2 hashes in the main loop, before the client is authenticated. As each hash takes several milliseconds to compute, a single command blocks WeeChat for minutes.
In version 2.8, the client chooses the number of iterations (since version 2.9, it is set by the option relay.network.password_hash_iterations), so a single hashed password can block WeeChat even longer.
Any remote user able to connect to the relay port, without knowing the relay password, can freeze WeeChat, by sending such commands repeatedly.
With the fix, only the first password (option password or password_hash) and the first TOTP (option totp) are checked, the next ones are ignored.
A new section in the user's guide describes how to protect the relay against abuse.
Mitigation
There are multiple ways to mitigate this issue:
Do not use the relay with the weechat protocol, see: /relay list and /help relay
Restrict the IP addresses allowed to connect to the relay, see: /help relay.network.allowed_ips
Listen only on a local address or a UNIX domain socket, and connect through a VPN or an SSH tunnel, see: /help relay.network.bind_address and /help relay
Do not allow PBKDF2 hash algorithms, see: /help relay.network.password_hash_algo
Credit
The issue was discovered by Acts1631.
WSA-2026-31: [Relay] Bypass of TOTP and denial of service with invalid TOTP received from a relay client.
The relay plugin can require a Time-based One-Time Password (TOTP) as secondary authentication factor, when the option relay.network.totp_secret is set: the client sends the TOTP in the command init of the weechat protocol, or in the header x-weechat-totp of the api protocol.
The TOTP received is validated with the info totp_validate, which uses the length of the TOTP received as number of digits, instead of the 6 digits generated by authenticator applications. As a shorter TOTP is the end of the full TOTP, the last 4 or 5 digits of the current TOTP are accepted: a client sending 4 digits has to guess one value out of 10,000 instead of 1,000,000.
In addition, with the weechat protocol, the TOTP is added without any check to the arguments of the info totp_validate, which are separated by commas. With escaped commas in the TOTP, a client can add its own arguments to the info, like the number of TOTP accepted before and after the current one. With a large number, almost any TOTP is accepted, and the validation computes millions of hashes, blocking WeeChat for up to tens of seconds for each command init.
A remote user knowing the relay password can bypass the TOTP, and get full access to WeeChat through the relay; any remote user able to connect to the relay port, without knowing the relay password, can freeze WeeChat when TOTP is enabled, by sending such commands repeatedly.
With the fix, the TOTP received from a client must have exactly 6 digits, otherwise it is rejected, with both protocols.
In version 5.0.0, the info totp_validate has a new optional argument with the number of digits (6 by default), and the TOTP must have exactly this number of digits, containing only digits: this also protects scripts using this info. With older versions, scripts using the info totp_validate must check that the TOTP has the expected number of digits, and contains only digits, before calling the info.
Mitigation
There are multiple ways to mitigate this issue:
Restrict the IP addresses allowed to connect to the relay, see: /help relay.network.allowed_ips
Listen only on a local address or a UNIX domain socket, and connect through a VPN or an SSH tunnel, see: /help relay.network.bind_address and /help relay
Do not use the relay with the weechat protocol, which is the most affected, see: /relay list and /help relay
Use a strong password for the relay, unique and not shared with other services, see: /help relay.network.password
WSA-2026-30: [Xfer] Incoming files and chats auto-accepted from a nick on the wrong server.
The option xfer.file.auto_accept_nicks is a list of nicks for which incoming files and chats are automatically accepted, with the format server.nick (for a specific server) or nick (for all servers).
For the format server.nick, only the beginning of the server name is compared, so the nick is also auto-accepted on any other server whose name starts with the same chars.
For example with libera.alice, files and chats sent by nick alice are automatically accepted on servers libera, libera2 or libera_test.
On these other servers, any user able to use this nick (which may not be registered there) can send files that are automatically saved in the download directory, or start DCC chats, without confirmation.
Mitigation
There are multiple ways to mitigate this issue:
Keep the option xfer.file.auto_accept_nicks empty (default), see: /help xfer.file.auto_accept_nicks
Check that no server name in this option is the beginning of another server name, see: /server list
WSA-2026-29: [Relay] Missing check of the number of hash iterations received from a remote relay.
When connecting to a remote relay (command /remote), WeeChat sends a handshake request and the remote replies with the password hash algorithm and the number of hash iterations to use for authentication.
The number of iterations is not checked: a malicious remote, or a man-in-the-middle when the connection is not secured with TLS, can send a huge number of iterations (up to about 2 billion), so that WeeChat is blocked for a very long time while computing the password hash with the algorithm pbkdf2+sha256 or pbkdf2+sha512.
With the fix, the number of iterations must be between 1 and 1000000 (the range allowed in option relay.network.password_hash_iterations), otherwise the handshake fails and WeeChat disconnects from the remote.
Mitigation
There are multiple ways to mitigate this issue:
Connect only to trusted remote relays
Connect only with TLS (URL starting with https://) and certificate verification enabled (default), to prevent man-in-the-middle attacks, see: /help remote and option relay.remote.xxx.tls_verify
WSA-2026-28: [Xfer] Missing checks of the resume position received in DCC RESUME and DCC ACCEPT.
When a DCC file transfer is resumed (option xfer.file.auto_resume, enabled by default), WeeChat sends a DCC RESUME message with the size of the partial file already received, and the remote peer replies with a DCC ACCEPT message containing the position to resume from.
The position received in DCC ACCEPT is not checked against the position sent by WeeChat, and it replaces it:
With a position equal to the file size, the transfer is immediately marked as successfully completed: the truncated partial file is kept as if it was complete, and its temporary suffix (option xfer.file.download_temporary_suffix) is removed.
With any other position, the data received is appended to the partial file at the wrong offset, so the file received is corrupted.
The transfer is identified only by its port, so a DCC ACCEPT message sent by another IRC user knowing the port can have the same effect.
In addition, the position received in DCC RESUME and DCC ACCEPT is not parsed strictly: an invalid value is not rejected, and when sending a file, a position greater than or equal to the file size is accepted.
Mitigation
There are multiple ways to mitigate this issue:
Disable the automatic resume of file transfers: /set xfer.file.auto_resume off
Keep the automatic accept of incoming files disabled (default) and accept files only from trusted users, see: /help xfer.file.auto_accept_files
Check the size or the checksum of files received after a resumed transfer
Credit
The issue was discovered by Acts1631.
WSA-2026-27: [Relay] Denial of service with huge IRC messages received from a relay client.
The relay plugin does not limit the length of IRC messages received from a client connected with the irc protocol: each message is fully parsed, including all its parameters, before the client is authenticated.
A message of a few megabytes with millions of parameters blocks WeeChat for a long time while it is parsed, and the memory used during parsing is much greater than the size of the message (hundreds of megabytes).
Any remote user able to connect to the relay port, without knowing the relay password, can freeze WeeChat and cause high CPU and memory usage, by sending such messages repeatedly.
With the fix, IRC messages longer than 4096 bytes are ignored and WeeChat replies with numeric 417 (ERR_INPUTTOOLONG), like IRC servers do.
Mitigation
There are multiple ways to mitigate this issue:
Do not use the relay with the irc protocol, see: /relay list and /help relay
Restrict the IP addresses allowed to connect to the relay, see: /help relay.network.allowed_ips
Listen only on a local address or a UNIX domain socket, see: /help relay.network.bind_address and /help relay
Credit
The issue was discovered by Acts1631.
WSA-2026-26: [IRC] Missing checks in SASL authentication with SCRAM mechanisms.
With SASL mechanisms scram-sha-1, scram-sha-256 and scram-sha-512, the IRC plugin does not properly check the data received from the server:
The SASL success (numeric 903 or 907) is accepted even if the server did not send its signature, so the server is not authenticated: a malicious server, or a man-in-the-middle, can impersonate the IRC server without knowing the password.
The iteration count is not checked: a malicious server, or a man-in-the-middle, can send a very low iteration count (for example 1), so that the client proof sent by WeeChat makes an offline dictionary attack on the password cheap, or a very high iteration count, so that WeeChat is blocked for a long time while computing the proof.
The server nonce is not checked: it must start with the nonce sent by the client, as required by RFC 5802.
The purpose of SCRAM is to authenticate both the client and the server without sending the password to the server, so these missing checks defeat the protection expected by users choosing these mechanisms.
Mitigation
There are multiple ways to mitigate this issue:
Connect only with TLS and certificate verification enabled (default), to prevent man-in-the-middle attacks, see: /help irc.server_default.tls and /help irc.server_default.tls_verify
Use the SASL mechanism external with a client certificate, see: /help irc.server_default.sasl_mechanism
Use a strong password, unique for each IRC server, to make an offline dictionary attack ineffective