Its filthy and corroded because either it got wet years ago and no one cleaned it (why would you)
Or it is currently leaking and corroding (unlikely)
Either way, if you're worried about it, its a communal pipe and the freeholder / landlords responsibility.
If its not wet or leaking forgot about...