Al-Hasan (may Allah have mercy on him) said: The inheritance of an abandoned child (foundling) goes to the Muslims, and the liability for his offences is also placed on them; the one who raises him receives only the reward.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الولاء / 21467