From 0751f31b9e7212ec6f6914ef69aad47b4d5b1c6d Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Tue, 29 Jun 2021 10:06:37 -0400 Subject: [PATCH] fix #1722 Validate operator vhosts against the configured (or default) vhosts.valid-regexp --- irc/config.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/irc/config.go b/irc/config.go index 7bcd28f2..52cc0bf9 100644 --- a/irc/config.go +++ b/irc/config.go @@ -830,6 +830,9 @@ func (conf *Config) Operators(oc map[string]*OperClass) (map[string]*Oper, error } oper.Vhost = opConf.Vhost + if oper.Vhost != "" && !conf.Accounts.VHosts.validRegexp.MatchString(oper.Vhost) { + return nil, fmt.Errorf("Oper %s has an invalid vhost: `%s`", name, oper.Vhost) + } class, exists := oc[opConf.Class] if !exists { return nil, fmt.Errorf("Could not load operator [%s] - they use operclass [%s] which does not exist", name, opConf.Class)