This very simple plugin blocks messages or commands including "${...}". It also blocks anvil renames with "${...}" included in the custom name because when the named entity is killed or someone kills something with a custom name sword with "${...}" included in the name, it may also be vulnerable.
This can be used also if the server is 1.18.1 or later but uses ViaBackwards to allow old version.
This plugin does not use NMS and is decompilable to it's original code using Procyon