The Messenger of Allah ﷺ said, "Whoever plants crops on someone else's land without their permission has no right to any of the produce, but his expenses are to be reimbursed to him."
حدثنا عبد الله بن عامر بن زرارة حدثنا شريك عن أبي إسحق عن عطاء
قال رسول الله ﷺ من زرع في أرض قوم بغير إذنهم فليس له من الزرع شيء وترد عليه نفقته
[Its chain of transmission is daif] Abu Dawud narrated it in the Book of Sales, chapter on cultivating land without the owner's permission, hadith no. 3403, from the hadith of Sharik the judge with this wording, though I did not find any explicit statement that he heard it directly. Qays bin Rabi corroborated him, as found in Bayhaqi, 6/136. Tirmidhi graded the hadith hasan, hadith no. 1366, and so did Bukhari. Ataa did not hear from Rafi, may Allah be pleased with him (Khattabi). Abu Ishaq transmitted it using the ambiguous "an" formula, as noted earlier, hadith no. 46, and there is another defect in it, see hadith no. 1039. It also has corroborating witnesses.