Anas bin Malik narrated that :
the Messenger of Allah said: "To spit in the Masjid is a sin, and burying it is its atonement."
حَدَّثَنَا قُتَيْبَةُ، حَدَّثَنَا أَبُو عَوَانَةَ، عَنْ قَتَادَةَ، عَنْ أَنَسِ بْنِ مَالِكٍ، قَالَ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم " الْبُزَاقُ فِي الْمَسْجِدِ خَطِيئَةٌ وَكَفَّارَتُهَا دَفْنُهَا " .
قَالَ أَبُو عِيسَى وَهَذَا حَدِيثٌ حَسَنٌ صَحِيحٌ .
• Jami` at-Tirmidhi, Vol. 2, Book of Travelling, Hadith 572
• Jami` at-Tirmidhi, Book of Travelling, Hadith 572