The Messenger of Allah ﷺ said, "An injury caused by an animal is not compensated, mines are not liable for compensation, wells are not liable for compensation, and on buried treasure a fifth is due."
حدثنا مسدد حدثنا سفيان عن الزهري عن سعيد بن المسيب وأبي سلمة سمعا
عن رسول الله ﷺ قال العجماء جرحها جبار والمعدن جبار والبئر جبار وفي الركاز الخمس
Muslim narrated it in the Book of Legal Penalties, chapter on the ruling that an animal's injury, a mine, and a well involve no liability, hadith no. 1710, from the hadith of Sufyan bin Uyayna. Bukhari narrated it in the Book of Zakat, chapter on the fifth being due on buried treasure, hadith no. 1499, from the hadith of Zuhri, with the same chain.