Both Manu as well as Matsya Purana prohibit marriage with sapinda relatives on the mother’s side and sagotra relatives on the father’s side.
Quoted in Dharmakosa –
असपिण्डा या मातुरसगोत्रा च या पितुः /
सा प्रशस्ता द्विजातीनां दारकर्मणि मैथुने //
Dharmakosa, pub. Prajna pathasala mandal, Wai, Satara. III.1.p.177 ff