This is treated as customary international law, based on a UN Security Council conclusion in 1993 making it binding also for non-signatories.
https://en.wikipedia.org/wiki/Fourth_Geneva_Convention
For instance, break it anywhere in the world by killing civilians, and enter my country (say, as a refugee), and you'll be prosecuted if caught. There's even a recent example (a man got life sentence for what he did in Rwandan conflict; the life sentence here is practically something like 12 years).