The Messenger of Allah ﷺ said, "Whoever stands in prayer on Laylat al-Qadr out of faith and in hope of reward will be forgiven his past sins. And whoever stands in prayer through Ramadan out of faith and in hope of reward will be forgiven his past sins."
وقال رسول الله ﷺ من قام ليلة القدر إيمانا واحتسابا فإنه يغفر له ما تقدم من ذنبه قال عفان وحدثنا أبان في هذا الإسناد بمثله
Its isnad is sahih. Bukhari related it 3/33, similar to the previous one, and Muslim likewise, similar to the previous one, and Tirmidhi 3/58, number 683, and Nasai 4/156, number 2202.