I had this issue and it was the front passenger sun roof drain pipe, which had come off the drain connection. Was a bit of a pain to sort as you have to drop the roof lining and A pillar trim to connect the pipe back up.
I ended up using a fresh piece of silicon hose instead of the brittle 17 year old clear drain pipe, to make sure it wouldn't come off again in a hurry.
Best test to see if this is your issue is to get a small cup of water and pour it down the front sunroof (passenger side) drain hole with the door shut and note where the water exits - outside your car near front of the door, you're fine. Inside the car = good luck!
