I heard the Messenger of Allah ﷺ say, "Vows are of two kinds. Whatever vow is made in obedience to Allah belongs to Allah and must be fulfilled. Whatever vow is made in disobedience to Allah belongs to Satan and must not be fulfilled, and its expiation is the same as the expiation for breaking an oath."
أخبرني محمد بن وهب قال حدثنا محمد بن سلمة قال حدثني ابن إسحق عن محمد بن الزبير عن أبيه عن رجل من أهل البصرة قال صحبت
سمعت رسول الله ﷺ يقول النذر نذران فما كان من نذر في طاعة الله فذلك لله وفيه الوفاء وما كان من نذر في معصية الله فذلك للشيطان ولا وفاء فيه ويكفره ما يكفر اليمين