(At-Thahreem) 66 : 2
قَدْ فَرَضَ اللَّهُ لَكُمْ تَحِلَّةَ أَيْمَانِكُمْ ۚ وَاللَّهُ مَوْلَاكُمْ ۖ وَهُوَ الْعَلِيمُ الْحَكِيمُ

Surely Allah has imposed to you the way for freeing from your oath, and Allah is your Master, and He is all Knowing, the Wise.

While Allah is the Three Time Knower and your Master, no oath should be made to anyone forgetting Allah. The believer who approves Allah as the owner as explained in verses 7: 172-173, shouldn’t obey anyone against the dos and don’ts of Adhikr-the Permission of Lord. The ransom for violating oath and pledge is explained in verse 5: 89. See explanation 2: 224-225, 286; 9: 51; and 22: 78.