Your sunroof is designed for water to be able to leak past the glass
gasket, but it should then run down into the sunroof assembly, which has a
drain at each corner that takes the water out of the assembly to each wheel
area. If you have water entering the car, there's an actual problem,
perhaps a clogged drain.