The Messenger of Allah ﷺ said, "Injury caused by livestock carries no liability, a well carries no liability, and a mine carries no liability. As for buried treasure, a fifth is due on it."
أخبرنا قتيبة عن مالك عن ابن شهاب عن سعيد وأبي سلمة
أن رسول الله ﷺ قال جرح العجماء جبار والبئر جبار والمعدن جبار وفي الركاز الخمس
Bukhari narrated it in the chapter on zakat, "The Chapter on the Fifth of Buried Treasure," hadith no. 1499, and Muslim in the chapter on legal punishments, "The Chapter on Injury Caused by an Animal, a Mine, and a Well Being Without Liability," hadith no. 45/1710, from the hadith of Malik through this route. It is also found in Muwatta (Yahya's recension), 2/868, 869, and in Al-Kubra, hadith no. 2276.