1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-06-29 14:26:40 +02:00
Commit Graph

10325 Commits

Author SHA1 Message Date
Bram Matthys 400a6080ab Actually make it possible for set::best-practices::trusted-cert-valid-hostname
to be turned off (it was seen as an unknown option). Reported by PeGaSuS.
2025-09-10 16:30:57 +02:00
Bram Matthys 76934cb815 Fix incorrect message about non-trusted SSL/TLS certificate when you use
the default certificate/key (conf/tls/server.cert.pem) even when that
cert is valid and issued by a trusted CA (like Let's Encrypt).
You would get such an incorrect "best practices advice" on-boot, but
(fortunately) not on each subsequent REHASH.

This was because the TLS system was not yet initialized completely at
the time of the best practices checks, ctx_server was NULL. This is
now solved by re-ordering some function calls.
This does change some win_error() and config_load_failed() stuff for
Windows so I hope that's okay.

Reported by Bun-Bun.
2025-09-10 07:35:50 +02:00
Bram Matthys bc27eb48fb ** UnrealIRCd 6.2.0 ** 2025-09-09 18:10:49 +02:00
Bram Matthys 399dfde33e Update curl-ca-bundle.crt to Tue Aug 12 03:12:01 2025 GMT 2025-09-08 20:10:11 +02:00
Bram Matthys 256308a707 Switch back to OpenSSL for the Windows build:
* In 2016 we switched from OpenSSL to LibreSSL because the OpenSSL
  codebase was in a bit of bad shape and LibreSSL promised to be a
  more modern codebase. Now, almost a decade later, OpenSSL has had
  many code cleanups and is more security aware (code audits etc),
  especially since OpenSSL v3 things are looking OK and it seems
  LibreSSL doesn't have much progress nowadays. Which is understandable
  as they have a lot fewer coders available but has an effect on things
  like how long it took for TLSv1.3 to appear and for other new things
  like PQC. It also seems like security fixes are now slower than
  OpenSSL instead of the other way around. Anyway, I think they did their
  job well (together with other people) in "triggering" the OpenSSL
  project to get things back on track. Let's switch back now.
* For context: it seems several Linux distro's that used to do go for
  LibreSSL have also switched back to OpenSSL.
* LibreSSL is still and will continue to be a supported library to
  use with UnrealIRCd (especially with OpenBSD and FreeBSD in mind).
  So, if there are any issues (compile problems, configuration problems,
  some feature not detected), then please report it on our bug tracker
  at https://bugs.unrealircd.org/ ! We will have to rely more on such
  user-reports now that the main devs will likely only work with OpenSSL.

Also... i have cleaned up the Makefile.windows a bit to be more consistent
Hopefully i didn't make a mistake there...

[skip ci]
2025-09-08 17:02:56 +02:00
Bram Matthys e58768eb65 antimixedutf8: ignore general punctuation block transitions
Since those can happen in ordinary text.
2025-09-06 14:02:31 +02:00
Bram Matthys e8673a06df Fix crash with "STATS tld" if tld::motd is not set. (Only IRCOps can do STATS
requests normally, unless the niche feature set::allow-user-stats is used)

The tld::motd was made optional in Jun 2022 commit 1fe6119026.
Not setting it is probably a bit rare, which explains why this bug was only
reported yesterday (Aug 2025) via the crash reporter.
2025-08-30 08:38:21 +02:00
Bram Matthys ed5bbe6ecb Stop sending 'draft/bot', and only send 'bot' (ratified 26-apr-2022)
This, obviously, only for umode +B users.
2025-08-02 17:15:43 +02:00
Bram Matthys 7603317c9b Fix some potentially confusing wording in release notes.
Just in case someone thinks we are going to msg users on plaintext ports
by default, no we don't that, or at least not this year.
This is purely a "best practices" advice to admins on config load.
[skip ci]
2025-08-01 12:09:30 +02:00
Bram Matthys 5b2c9a9890 Re-order some release notes items (mention spamfilter enhancements earlier)
[skip ci]
2025-08-01 11:43:46 +02:00
Bram Matthys aa8a8ee135 ** UnrealIRCd 6.2.0-beta3 **
This one will also be announced on the mailing list (beta1 and beta2 were not)
2025-08-01 11:28:37 +02:00
Bram Matthys 19e4a6fee9 Crash reporter: shut down TLS session gracefully
It seems like otherwise the request may not come through fully, not sure
but this seems to fix it in my tests.
2025-08-01 11:21:43 +02:00
alice 2c7bcebaca Make spamfilter:input-conversion accept deconfuse and deconfused for confusables (#316) 2025-08-01 07:39:43 +00:00
Bram Matthys 24fde4f889 Fix crash on "REHASH -dns" (IRCOp only)
Reported by vectr0n in https://bugs.unrealircd.org/view.php?id=6538
2025-07-31 17:53:40 +02:00
Bram Matthys 5e6bcaea33 After netsplit, wait for class::connfreq seconds before connecting to server.
Isn't that what it was supposed to do? Well, yes and no, previously
it only guaranteed that between reconnects (so the 2nd try not being
before class::connfreq than the 1st try), but there were no guarantees
for the first time period directly after a squit.

* When a netsplit happens and
  [set::server-linking::autoconnect-strategy](https://www.unrealircd.org/docs/Set_block#set::server-linking)
  is `sequential` (which is the default) or `sequential-fallback`
  (which is a good value for leafs) then we now consistently wait for
  [class::connfreq](https://www.unrealircd.org/docs/Class_block)
  seconds before trying to connect to the (same or next) server.
  By default this is 15 seconds in the example configuration
  server class. The reason for this is to provide a consistent behavior.
  Previously we waited semi-randomly for 0 to class::connfreq seconds.
  The previous behavior caused the picking of 'next server to try' to
  be inconsistent, which especially caused issues for `sequential-fallback`.
  If you want quicker recovery times in case of a netsplit, simply lower
  the value of [class::connfreq](https://www.unrealircd.org/docs/Class_block)
  in your configuration file, e.g. to 5 instead of 15 seconds.

Oh yeah and for connect-strategy 'parallel' things stay as is, with
the wait of 0 to class::connfreq per-server, which seems fine for that.
Unless you want a 'BOOM!' effect of mass reconnects instantly, in
which case you can just set class::connfreq very low.
2025-07-30 09:10:22 +02:00
Bram Matthys 84a1e59a44 Best practices: check if the certificate is actually valid for me::name.
That is, if the set::best-practices::trusted-cert check is on and passed
("certificate is valid and issued by a trusted CA") then we also
do this new set::best-practices::trusted-cert-valid-hostname check:

/* If the trusted-cert check passes, then we do another check to see if
 * the certificate is valid for me::name. Since users usually connect to your
 * server by your server name it is important for the certificate to be
 * valid for that name. Unless you really only care about e.g. irc.example.net,
 * and not about individual irc2.example.net server names, in which case you
 * can turn this off, but not sure if that is good practice.
 */
trusted-cert-valid-hostname yes;
2025-07-28 09:55:01 +02:00
Bram Matthys 44177f8c86 No valid trusted cert: change wording a bit ("you don't have any valid certificate"...)
Expired: this is a warning, not an error (we still want to boot the ircd)
Expired: handle the case for link::verify-certificate explicitly to avoid confusion
2025-07-28 09:19:27 +02:00
Bram Matthys 5abea8d4d2 Update release notes a bit with recent changes
[skip ci]
2025-07-27 09:52:37 +02:00
Bram Matthys 7c66adf196 Don't warn plaintext ports open if set::plaintext-policy::user is 'deny'
(.. since users won't get online then anyway)
2025-07-27 08:38:08 +02:00
Bram Matthys f39269c518 Fix uninitialized variable in config test for listen { }
Caused by previous commit 990fe22e64
2025-07-27 08:33:46 +02:00
Bram Matthys 990fe22e64 Print a best practices message if any plaintext port is open (eg 6667).
Ports that listen on 127.0.0.1 or ::1 are ignored (useful for e.g. services)

Looks like this:
[info] You have at least one IRC plaintext port open (such as 5668). Nowadays, everyone should be using SSL/TLS (on port 6697). See https://www.unrealircd.org/docs/Use_TLS.

See that https://www.unrealircd.org/docs/Use_TLS for more info (feedback welcome)

All this is in addition to somewhat related 29ce0ce29a:
[info] Your SSL/TLS certificate is not issued by a trusted Certificate Authority.
[info] It is highly recommended to use a 'real certificate'. To get a free one, see: https://www.unrealircd.org/docs/Using_Let's_Encrypt_with_UnrealIRCd

If applicable, that message is printed first, the 6667 one comes after ;)

Suggested in https://bugs.unrealircd.org/view.php?id=6500
and numerous times / discussions on IRC over the past years
It's finally time.. no.. it's overdue..
2025-07-26 16:02:33 +02:00
Bram Matthys d468473876 Add a comment about port 6667 in example.conf
/* Standard IRC port 6667:
 * Insecure plaintext (NOT for production servers)
 * This listen block is here only for quick testing.
 * Delete or comment out this listen block on production servers
 * and use TLS on port 6697 instead.
 */

Also throw it in translated example*conf's (in English),
the translators can translate it.
2025-07-26 14:45:09 +02:00
Bram Matthys eae1a2e99a Remove some check for U4 (<4.0.16+). Shouldn't matter but otherwise
one could possibly miss this cert verification warning. And since
that will later become an error, it is even more important to
notice such a (hopefully unusual) case quickly.
2025-07-26 13:34:40 +02:00
Bram Matthys 6b0d81fb77 Make a warning actually a warning 2025-07-26 13:31:50 +02:00
Bram Matthys a73186362b * Add link::options::no-certificate-verification
* Code cleanup: split connect flags in CONNECT_OUTGOING_* and CONNECT_*
* Don't print tls_link_notification_verify() stuff for localhost conns
2025-07-26 13:26:46 +02:00
Bram Matthys 26fb6b70d6 Fix localhost S2S link downgrading link-security.
On the incoming side it was correctly identified as link sec 2,
but on the outgoing side the localhost check failed and caused link sec 1 or 0.

Bug has beent here for a while but I don't think many people
link two UnrealIRCd servers over localhost that are on production
(i do, when dev'ing, but then I don't care about linksec, obviously)

Also, this wouldn't flag services from 2 to 0 because this bug only
affected outgoing UnrealIRCd server connections.
2025-07-26 13:24:00 +02:00
Bram Matthys 8f23550122 Since 2017[*] we warn about active MITM risks if a cert of a server link is
not verified. This changes the wording from "You may want to consider" to
a warning, makes it more strong and that in the future we will reject this
by default.

Actually still pondering to reject it now already by default, but let's start
with this commit first...
2025-07-26 12:22:49 +02:00
Bram Matthys fe569346b0 Call unrealircd_set_tls_groups() from url_unreal (remote includes) as well.
For url_curl it seems too complicated, added a comment there.
2025-07-25 14:03:54 +02:00
Bram Matthys 6178e2b94f *** UnrealIRCd 6.2.0-beta2 *** 2025-07-25 10:31:44 +02:00
Bram Matthys bf7edb5a51 Add extras/tests/tls/testssl_profiles/pqc.txt
Is same as baseline.txt but with this line added:
+"FS_KEMs","127.0.0.1/127.0.0.1","5901","OK","X25519MLKEM768","",""

This so debian 13 test succeeds (and other future distros with OpenSSL 3.5+)
2025-07-24 18:26:37 +02:00
Bram Matthys 11ba1edff1 Update release notes on the Post-quantum cryptography (PQC) enhancements:
* [set::tls](https://www.unrealircd.org/docs/TLS_Ciphers_and_protocols):
    Rename `ecdh-curves` to `groups` (the old name will continue to work)
  * Add (and prefer) the `X25519MLKEM768` hybrid group, which is a mix
    of `X25519` that is commonly used today and quantum-safe `ML-KEM-768`.
    This to protect against
    ["harvest now, decrypt later"](https://en.wikipedia.org/wiki/Harvest_now,_decrypt_later).
  * To benefit from this, OpenSSL 3.5.0 or later (released April 2025)
    is required on the server, and similarly a client that supports this.
    At the time of writing, almost all Linux distros don't have such an
    OpenSSL version yet (which is not a problem, this new feature will simply
    not be available). Notably Debian 13 (when released in August
    2025) will have it. LibreSSL does not support it either yet, so our
    Windows build does not have this feature.
  * Also, change the TLS information on-connect and in WHOIS etc. from
    something like `TLSv1.3-TLS_CHACHA20_POLY1305_SHA256` to
    `TLSv1.3/X25519/TLS_CHACHA20_POLY1305_SHA256`. In other words: using
    slashes as separators and showing the group / key exchange in the middle.
    The group is only shown on newer OpenSSL versions. If someone would
    use the new PQC hybrid group mentioned above then their TLS info would
    start with `TLSv1.3/X25519MLKEM768/`.
  * TL;DR: better secrecy against future quantum attacks, even though
    not many clients or servers support it at the moment.

[skip ci]
2025-07-24 16:00:03 +02:00
Bram Matthys 8a4dae71fb Fix compile problem with LibreSSL (and possibly OpenSSL <3.0.0).
Caused by 31d51fbb04
2025-07-24 15:40:43 +02:00
Bram Matthys d146da4a07 Change the cipherinfo, such as in [secure: TLSv1.3...] and in WHOIS.
Previously this was like:
TLSv1.3-TLS_CHACHA20_POLY1305_SHA256
It is now changed to be like:
TLSv1.3/X25519/TLS_CHACHA20_POLY1305_SHA256

So:
* Changed from '-' to '/' because sometimes the cipher(suite)
  contains a hyphen (TLSv1.2 and earlier)
* Show the key exchange "group" in the middle, such as X25519
  for the usual non-PQC case and X25519MLKEM768 for hybrid group
  with PQC.
* The group is shown in OpenSSL 3.0.0+ (and obviously you need
  OpenSSL 3.5.0 to ever see X25519MLKEM768 there, but that is
  something different)
2025-07-24 15:32:00 +02:00
Bram Matthys 0729382ba2 Rename ::ecdh-curves to groups and add X25519MLKEM768 to group list.
Post-quantum cryptography (PQC). Release notes will follow later.
2025-07-24 14:47:49 +02:00
Bram Matthys 9035859f0e Channel flood protection is now on by default. You can use +F to override.
[Channel flood protection by default](https://www.unrealircd.org/docs/Channel_anti-flood_settings):
This is an important change that IRCOps and chanops should know about:
* By default we now apply the anti-flood profile "normal", which should be fine for most channels.
* If a chanop does not want this they can override this by setting
  `MODE +F` with [another profile](https://www.unrealircd.org/docs/Channel_anti-flood_settings#Channel_mode_F_profiles).
* For example, for a channel with hundreds of users and lots of activity
  `+F relaxed` may be more appropriate. Or, chanops can turn anti-flood
  off entirely by setting `+F off`
* The reason for this change is that many admins and chanops in practice
  don't seem to use `+f` or `+F`. With this change they are now protected "by default"
  when no MODE `+f` or `+F` is set.
* Advanced users can can grab the detailed effective settings with `MODE #test F`
2025-07-16 14:59:42 +02:00
Bram Matthys 31d51fbb04 * UnrealIRCd can now be used if your OpenSSL does not provide MD5
(there will be an error if you use `cloak_md5`, but everything
  will work fine if you use `cloak_sha256`).

We phased out MD5 usage years ago, so it is only contained to
the old cloaking module. In fact that was the only reason we
started to provide the SHA256 cloaking module, simply so it
isn't using old MD5.

Of course, for module coders this means they should not call
DoMD5() or md5hash(), but that would be rare. Currently zero
modules in unrealircd contrib do this and it makes no sense
to start using it nowadays anyway.
2025-07-15 19:09:32 +02:00
Bram Matthys a911497290 Mention Text Analysis in release notes
[skip ci]
2025-07-14 18:48:48 +02:00
Bram Matthys 93980ee004 Include TextAnalysis in antimixedutf8 hit as well. And use "text_analysis"
and not "textanalysis" for the JSON, to keep naming of multi-word stuff
consistent.

Example:
--snip--
  "text_analysis": {
    "antimixedutf8_points": 20,
    "unicode_blocks": 9,
    "num_bytes": 55,
    "num_unicode_characters": 20,
    "deconfused": "Valware is ualwaring",
    "deconfused": "This is a testtestte",
    "unicode_blockmap": {
      "Basic Latin": 2,
      "Latin Extended-B": 2,
      "IPA Extensions": 1,
      "Greek and Coptic": 1,
      "Latin Extended Additional": 2,
      "Greek Extended": 1,
      "Number Forms": 1,
      "Tifinagh": 1,
      "Mathematical Alphanumeric Symbols": 7
    }
  },
2025-07-14 18:41:04 +02:00
Bram Matthys d135e687c3 Add TextAnalysis on spamfilter hit in the JSON logs. 2025-07-14 18:11:59 +02:00
Bram Matthys e8b5a831e1 ** UnrealIRCd 6.2.0-beta1 **
(Possibly some Windows build fixes after this, but..)
2025-07-13 11:39:00 +02:00
Bram Matthys 76358d3f0b Some more release notes updates
[skip ci]
2025-07-13 11:07:23 +02:00
Bram Matthys f85f5899dc Update release notes a bit
[skip ci]
2025-07-13 11:03:08 +02:00
Bram Matthys 93720a9533 Fix OS JUPE still allowing server in.
Since UnrealIRCd 6.0.0 when a server connects, we like to drop the
existing link so they don't need to wait on "Ping timeout".
However, that goes against the JUPE stuff that Services tend to use,
it basically negates it.

We now check if the uplink is u-lined (like for services) and if that
is the case we deny the link with "Server Exists (Juped)". So just
like before U6, and with a slightly more helpful message even.

Reported by Jellis in https://bugs.unrealircd.org/view.php?id=6498
2025-07-13 10:53:46 +02:00
Bram Matthys 97a87bdca8 Fix reputation score not expiring after 30 days of inactivity.
We now expire after 30d if score is <12 (so 1 hour of being online)
and we expire after 90d regardless of score.

Note that for this to work, all servers would need to be running
UnrealIRCd 6.2.0+ because when a score for an IP is still present
on any of the servers on a network, and a user with that IP connects,
then the score will be broadcasted from the server that still has
the score and it will be re-added by all servers with that score.

But eventually it should be like this... :D

Reported by armyn in https://bugs.unrealircd.org/view.php?id=6536
2025-07-13 10:22:40 +02:00
Bram Matthys 369f55063a For bestpractices::trusted-cert add some crude heuristics so hubs and such
are not (always) affected by this. We now check if there is any client port
exposed (to non-localhost). So if you have a hub with no client ports or
only at localhost then you won't get this bestpractices advice.

And also fix compile error on OpenSSL < 1.1.0 (undeclared var, duh)
2025-07-13 09:46:23 +02:00
Bram Matthys 29ce0ce29a Best Practices: If zero SSL/TLS certs are issued by a trusted CA, complain and
suggest to use Let's Encrypt.

This can be turned off via set::best-practices::trusted-cert, see
https://www.unrealircd.org/docs/Set_block#set::best-practices

Oh yeah, and this only works at OpenSSL 1.1.0 and higher, i didn't bother
with people running ancient versions.
2025-07-13 09:26:54 +02:00
Bram Matthys cd2deeb1e7 Add spamreport::on-server-ban. If set to yes, then the spamreport
block runs when a user is *LINEd.

TODO: avoid double sending on spamfilter with action { report; gline; }
2025-07-12 18:14:40 +02:00
Bram Matthys 96a2ea5c02 Add HOOKTYPE_BANNED_CLIENT 2025-07-12 18:06:52 +02:00
Bram Matthys af9014dbd3 Update release notes
[skip ci]
2025-07-12 17:42:52 +02:00
Bram Matthys 301fb911e8 When submitting to Central Spamreport, include TextAnalysis and
bump sending of last commands from "last 10" to "last 20".
2025-07-12 17:21:56 +02:00