QCD factorization in diffraction