Kathir bin Abdullah al-Muzani narrated from his father, from his grandfather (may Allah be pleased with him), that the Messenger of Allah (peace and blessings be upon him) said: "The Muslims are bound by their conditions, except a condition that makes the lawful unlawful or the unlawful lawful."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصداق / 14433