It is not permissible to buy and sell pigs or any part of them, such as the skin, bones and fat, because Allah, may He be exalted, says (interpretation of the meaning):
“Say (O Muhammad ): ‘I find not in that which has been inspired to me anything forbidden to be eaten by one who wishes to eat it, unless it be Maytatah (a dead animal) or blood poured forth (by slaughtering or the like), or the flesh of swine (pork, etc.) for that surely is impure”
Al-Jassaas (may Allah have mercy on him) said: Although meat is singled out for mention, what is meant is all parts (of the pig). The meat is only singled out for mention because that is what is mostly used and sought from it.
End quote from Ahkaam al-Qur’aan, 1/153.
It was narrated from Jaabir ibn ‘Abdullah (may Allah be pleased with him) that he heard the Messenger of Allah (blessings and peace of Allah be upon him) say in the year of the conquest when he was in Makkah: “Verily Allah and His Messenger have forbidden the sale of alcohol, dead meat (from animals that were not slaughtered properly), pork and idols.” It was said: O Messenger of Allah, what do you think about the fat of animals that were not slaughtered properly, for it is used to caulk ships and is applied to leather and people use it to light lamps? He said: “No, it is haraam.”
Narrated by al-Bukhaari, 2082; Muslim, 2960.
Ibn Battaal (may Allah have mercy on him) said: The scholars are unanimously agreed that buying and selling pork is haraam.
End quote from Ibn Battaal’s commentary on Saheeh al-Bukhaari, 6/344
Ibn al-Qayyim (may Allah have mercy on him) said: With regard to the prohibition on selling pork, it includes the entire pig and all of its parts, outside and inside.
End quote from Zaad al-Ma‘aad, 5/674
But… If it is not possible to acquire pig bones except by buying them and there is no other substance that can take its place, then there is nothing wrong with you doing that because this is a case of necessity, and necessity makes permissible that which is forbidden as Allah, may He be exalted, said (interpretation of the meaning):
“while He has explained to you in detail what is forbidden to you, except under compulsion of necessity”
There is nothing wrong with making use of pig bones in the way mentioned to manufacture glue, because bones come under the same rulings as the fat of dead animals, and the hadeeth only forbade selling it, not making use of it. Ibn al-Qayyim (may Allah have mercy on him) said: There are two scholarly opinions concerning the phrase “it is haraam”. One is that these actions are haraam, and the other is that selling is haraam if the purchaser is buying it for that purpose. These two opinions are based on the question of whether the prohibition applies to selling it for the purpose mentioned or to the use mentioned. The former is the opinion favoured by our shaykh and it is more likely to be correct, because when the Prophet (blessings and peace of Allah be upon him) told them of this prohibition, he was not referring to these uses of it; rather he told them about the prohibition on selling, then they told him that they trade in it for these purposes, and he did not grant them a concession allowing them to sell it, but he did not forbid them to use it in the ways mentioned. The fact that something is permissible to sell does not necessarily mean that it is permissible to use. And Allah knows best.
End quote from I‘laam al-Muwaqqi‘een, 4/248.
So it is permissible to make use of these bones without buying them. If there is a need for that and it is not possible to find them except by buying, then it is permissible to buy them.
And Allah knows best.