Endonuclease which cleaves flap structures at the junction between single-stranded DNA and double-stranded DNA. Specific for 5'-overhanging flap structures in which the 5'-upstream of the flap is completely double-stranded. Prefers the blocked-flap structures similar to those occurring at replication forks, in which the 5' single-strand overhang of the flap is double-stranded. Also possesses weak 5'- to 3'-exonuclease activity on nicked but not gapped double-stranded DNA. Does not cleave bubble-like or Holliday junction substrates (By similarity). Binds 2 magnesium ions per subunit. They probably participate in the reaction catalyzed by the enzyme. May bind an additional third magnesium ion after substrate binding. Belongs to the XPG/RAD2 endonuclease family. GEN subfamily.