Just wanted to throw this out there as there wasn't much info on the issue.
2010 Subaru Outback - We had a pretty substantial leak in the roof (no sunroof model) that I had a hell of a time tracking down. First thought was the 3rd brake light, which once I pulled it out the gasket was shot. This is a known issue, and easy enough to fix with some silicone and 20 minutes. Still had the leak though. Maybe not as bad in the rear, but near the passenger side rear door it was getting to the point of not being able to take the Soob on the next trip. Couldn't find anything useful on the Outback forums, so I did what I usually do, throw out the book and start taking shit apart. I pulled the headliner, which was a bit less daunting than it was portrayed. Not something I want to do a lot, but got it out in about a half hour by myself (with some help carrying it into the house). What I found were 3 flange bolts that hold the roof rack on were missing. This basically meant that I had 3 gaping holes in the roof as the gasket around the stock roof rack is not (and not meant to be) water tight. So I removed the rack on that side, put some goop (Black Jack elastomeric cement) around the studs, and on the nuts. Slapped it all back together. I decided to loosen the nuts on the driver's side and goop them as well, thinking it would be quick and I was already working up there. That's when the problem came up. The studs from the rack are M6 x 1.0 3/4" long, and they attach to the plastic roof rack by sliding into a channel. Well one of the studs decided to be difficult and start spinning in it's plastic retainer. Enter cut off tool... Replacing the stud would be super simple if I had the part handy, but naturally it would be almost a week to get one, and my car isn't waterproof in the mean time. We don't have a garage we can park in. So off to the hardware store. Turns out a 5/16" x 3/4" long bolt will wedge itself nicely in the place the old stud was, and with a washer and nut, or flange nut, and a bunch of goop, is plenty water tight, and possibly stronger than the OEM stud.
So there you have it, if you have a phantom leak, it's worth checking those nuts holding the roof rack on, at least on a Gen 4 Outback. Not sure why 3 were missing. Maybe they forgot to put them in, and it took 8 years to leak? Maybe a previous owner took the rack off to replace it or repair it? Who knows. I did water test it before putting the headliner back in (not as easy as removing it, but not horrible either) just to be safe. We sprayed water from a garden hose with a higher pressure nozzle all around the car with me inside inspecting things. So far, so good. But only time will tell for sure I suppose.
For reference, there are 9 studs on each rack. They are 10mm nuts. You will most definitely have to remove 2 bolts holding the side curtain airbag module in the rear storage area to the roof, they are also 10mm. It will hang safely on it's own. The rear most stud is near the gate through a hole in the supports. A deep well 10mm on a 3/8" drive socket will get there, but an extension wouldn't hurt. DON'T DROP THAT NUT! A ratcheting box end 10mm will be an absolute life saver, and this job would have taken FOR-EV-ER without it. Otherwise all I used to remove the headliner was a phillips, small blade flat head, and a prybar (I actually used a clip remover because I had one handy, but a prybar would be fine in this case) to get some of the harder to reach clips unclipped while pulling trim panels.
Should have made a video, but you know how it goes when working on projects. If you have questions on any of this stuff, feel free to shoot me a message. This info is also useful to anyone looking to swap the factory rack for another style.