This is the type of question that is A LOT easier to answer if you're standing there looking at the problem, but I would tell you to check around the top of the wall if you can up between the joist spaces just to check for any other water staining. This may give you a further clue as to where it's coming from.
The rain getting in around the vent pipe is a good possibility. Go up on the roof and inspect the vent pipe flashings to check for a good seal. Take some silicone up with you