We have narrated in the hadith of Sayyidah Aishah (may Allah be pleased with her) that the Prophet (peace and blessings be upon him) said: "Any condition that is not in the Book of Allah is void, even if they are a hundred conditions."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الشركة / Q11429
It is narrated from Sayyiduna Abu Hurayrah (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "Muslims are bound by their conditions."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الشركة / 11429
Kathir bin Abdullah al-Muzani narrates from his father, and he from his grandfather (may Allah be pleased with him), that the Messenger of Allah (peace and blessings be upon him) said: "Muslims abide by their conditions, except a condition that makes the lawful unlawful or a condition that makes the unlawful lawful."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الشركة / 11430