Soldermask is basically liquid paint, which means it can have similar defects: varying thickness, and more worrying in your case, pinholes. Its purpose is to prevent solder bridges and protect copper from oxidation, but it isn't specified as a high voltage isolator.
If the module has vias, these will create bare copper areas on its bottom... so all that remains is the soldermask on the mainboard.
Since the module won't be touching the pcb (rather, it will be spaced by the thickness of the soldermask) it would be okay at low voltages... but definitely not 230VAC.
More information here.
Note that if the entire bottom of the module is (for example) a ground plane and the traces you run below it are only a few volts from this ground plane, then it would be OK.
If you must run traces, and this is a one-off or low volume, consider putting some insulating tape on the back of the module, like kapton tape. It should be thin enough not to interfere with soldering the module.
Additionally if high frequencies are involved you'd have to consider noise, due to the capacitance of two parallel plates, and also magnetic (transformer) coupling between tracks on the pcb and on the module.