The Bais Yosef YD 349 says that hair that was attached to a deceased person at the time of death, is the subject of a dispute of that hair is prohibited to have any benefit from. The Rambam, Smag, Tosfos, and the Rashba permit it. The Ramban and the Tur prohibit it.
כתב סמ"ג המת אסור בהנאה כולו חוץ משערו ע"כ: ב"ה וכ"כ הרמב"ם בפרק י"ב מהלכות סנהדרין וכל אשה שתהרג מותר ליהנות משערה: ואיני יודע מנין לו להתיר שערו ודוחק לומר דבפיאה נכרית תלוין בסיכתא קאמר דא"כ הו"ל לפרש: ב"ה והרשב"א בתשובה סימן ש"ל הביא דברי הרמב"ם וכתב שהתוס' ג"כ בפרק שור שנגח את הפרה כתבו להתיר ותמה עליהם וכתב שהרמב"ן בתורת האדם אוסר: ומ"ש רבינו אשה שנגמר דינה וכו' בס"פ בתרא דסנהדרין (קיב.):
In Shulchan Aruch 349:2 both the Mechaber and the Rama say that it is prohibited to have any benefit from hair:
אבל שערו ממש אפילו אם צוה עליו אסור בהנאה: הגה אשה שיוצאת ליהרג נהנין בשערה אף על פי שנגמר דינה אין שערותיה נאסרים עד שתקטל (טור):
but one's real hair, even if he left instructions regarding it, — [the law is that] it is forbidden to make any use of it. Gloss: If a woman is about to be put to death, use may be made of her hair, [for] although her trial is ended, her hair does not become forbidden until she is executed