This can be fixed by not assigning and executing functions directly to global variables in uiNamespace or any other persistent namespace. The only safe place to inline define functions is missionNamespace, as that resets at the start of all missions and will load only code from the mission or from the addons.
Make sure all functions cached/compiled in uiNamespace use compileFinal. Any inline functions should use local variables.
This security exploit affects user modification that use uiNamespace in this manner as well.