If it's a factory sunroof than it's probably not leaking. They do
have drain holes. you can put some compressed air in it to see.
the problem is most likely the drain holes in the fenders. That's
where the water drains when it coems off your windshield. It's hard
to decribe but just follow where the water goes. It gets filles with
leaves and junk and over time it composts there and cloggs the hole.
Then it backs up and floods your HVAC fan.