This will be a criminal offense. If you do this on a ship, it is equivalent to using drugs on the territory of the state that owns the ship. Because the jurisdiction extends to both ships and aircraft and spacecraft. If it was on the ISS, then it depends on the station segment. There, the segments are divided between countries.
At the moment, space flights are carried out either as a regular cosmonaut of a country, or as a so-called space tourist. In the first case, I think, everything is clear anyway: the sending state simply cannot afford such liberties for a number of reasons (financial, the threat of a drop in authority due to the failure of the operation, etc.). In the second, there are more freedoms, but restrictions a la "if you want to do something strange - do it, but it will turn out to be this and that", that is, the sender is at risk. Clear generally accepted prohibitions have not yet been formulated, because space travel has not yet become widespread. You can just as well be interested in the existence of shabby etiquette in space: there are simply too few of those who would follow it.