Virtually all cruising boat masts get rainwater into them, usually via the gaps near the sheaves at the masthead and any exit points for lines. Essentially impossible to avoid.
Deck stepped masts usually have a drain hole at the base, and
water simply exits there. Some
keel stepped masts have some sort of dam at the
deck level, and an drain hole there that serves just as the deck stepped ones do. Often this dam is either missing or ineffectual, and thus
water reaches the below decks step. Sometimes (as on our boat) it is possible to drain this off to a lower
bilge or, in our case, the
shower sump. The amounts are usually small, and our
shower sump pump, on a float switch, empties it easily as would a proper
bilge pump. Nothing to worry about.
In the case of the OP's situation, it doesn't look like the foot of the
mast is seriously compromised; aluminium
corrosion products do make a disproportionate mess!. A good cleanup and
inspection would be in order, but I don't think it would indicate an immediate need for mitigation. The amount of
corrosion suggests that the spigot on the inside (the locating "pin") might be stainless, or that there is some scrap stainless lying about in there. If he should buy the boat, at a convenient time unstepping the
mast and checking everything out would be a good idea, but IMO, not a pressing matter.
No one likes water inside a boat, but at least this water is usually fresh, and delivered right to the
bilge area. How much nicer than deck leaks!
Cheers,
Jim