From ab7a65f9513ddd9d8aabc43fb18dc67b9faf3538 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Fri, 13 Jan 2023 09:53:05 +0000 Subject: Fix cloak_md5 leaking the cloak key over server links. This was introduced when adding the modern cloak system and does not affect v3. --- src/modules/m_cloak_md5.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_cloak_md5.cpp b/src/modules/m_cloak_md5.cpp index 9eca2189b..0e2971d85 100644 --- a/src/modules/m_cloak_md5.cpp +++ b/src/modules/m_cloak_md5.cpp @@ -219,11 +219,18 @@ struct CloakInfo final break; } data["domain-parts"] = ConvToStr(domainparts); - data["hash"] = Hash ? Hash->name : "broken"; data["ignore-case"] = ignorecase ? "yes" : "no"; - data["key"] = key; data["prefix"] = prefix; data["suffix"] = suffix; + + // IMPORTANT: link data is sent over unauthenticated server links so we + // can't directly send the key here. Instead we use dummy cloaks that + // allow verification of or less the same thing. + const std::string broken = "missing-sha2-module"; + data["cloak-v4"] = Hash ? Generate("123.123.123.123") : broken; + data["cloak-v6"] = Hash ? Generate("dead:beef:cafe::") : broken; + data["cloak-host"] = Hash ? Generate("cloak.inspircd.org") : broken; + compatdata = GetCompatLinkData(); } -- cgit v1.3.1-10-gc9f91