Yoreh Deah Siman 267 Seif 29

כט הָיְתָה לוֹ אֶצְבַּע יְתֵרָה וַחֲתָכָהּ, אִם עוֹמֶדֶת בְּסֵדֶר הָאֶצְבָּעוֹת יוֹצֵא לְחֵרוּת.

Seif 29

If there is a slave with an extra finger gets it cut off by his master, if the finger stands in the order of the other fingers he is set free.