Since no combustion is involved, the lack of oxygen does not matter.
I will say it again, gunpowder does not burn.
Gunpowder, like any other high explosive, does in fact burn. How fast it burns is what makes it "high" explosive vs. "low" explosive.
Black powder is considered a low explosive because it burns rather slow. Smokeless powder is considered a high explosive because it burns quite a bit faster.
What makes is work in a firearm, is controlling the burn rate. If you have a high explosive, and just add fire, it burns slower. If you add concussion with the fire, then it burns much faster (some where a long the lines of 27,000 fps.)
To test this, lay out a pile of smokeless powder, add a match and watch it flair. Lay out another pile of smokeless powder, add a blasting cap, and it goes high order (explodes).
As to low explosive, such as black powder. You don't change the burning rate that much (notice the "that much", it does change a bit). You add a pile of black powder to a match, it flairs, much faster then the smokeless powder, kind of goes "poof". You add a blasting cap to the black powder if goes "poof" but looks like an explosion because you get a bigger 'poof" simply because you are scattering the black powder with the blast of the blasting cap.
Where you can get "what looks" like an explosion with black powder is if when you don't pack it. As in not seating the bullet on the charge, leaving air space between the charge of powder and projectile. You have to look at the pressure curve. Black powder appears to burn faster when loose, it builds its pressure curve "right now", then that pressure or gas hitting the projectile cause it to be retarded, or hit Resistance. In stead of a steady burn as in smokeless powder which will push the bullet out the barrel, the BP hits the bullet and whats to keep going fast, looking for the path of least resistance which could burst the barrel.
Smokeless powder builds up its pressure slower, starting from zero working its way out the barrel, if that pressure hits resistance (the bullet) it doesn't care, its still building up and will start pushing slowly, increasing until you get the velocity of the bullet you desire. To see this, read above about the difference when adding a match to black powder compaired to smokeless powder. Black powder appears to burn faster. It does at first.
The over all pressure is going to be higher with smokeless power then with black powder, its when that pressure is reach that counts.
Another way to look at it as to burning rate is to understand smokeless powder is made with nitrocellulose (gun cotton) or nitroglycerine or both. We know that different powders have different burning rates. This is accomplished with the size of the powder or the shape (tube vs flake). Some are coated to control the burning rate and to make it moisture proof.
As to having to have oxygen to burn, gun powder creates its own. As in black powder the oxygen comes from the saltpeter.
Sorry to muddy up the post. I know its a GUN forum and not a Bomb forum, but I didn't know how else to explain it with out interjectiong some EOD lingo.
As to shooting on the moon, that's a non issue with me, too far to drive and they don't let you smoke when you fly any more.