Actually it was touched on in a number of episodes (which i don't feel like digging up) but in more than once instance they mentioned that the replicators had safety systems that prevented unauthorized creation of at least some dangerous materials, (from what i recall, poisons were mentioned in one, weapons themselves i'm not sure).