it could be due to dirt build up around the rubber seal?if not i suggest test it with running water and check where it`s coming from and try to rectify the water leak?if you find it clean around it with a scriber or check for rust around the rubber seal remove sunroof and cure rust,bog it up and paint.