OSPF routing loop mechanisms summarized
In single area, the routers have the Link State Database, having the same LSDB helps the routers to build a loop-free topology.
Now in a multiarea topology, the ABRs are responsible for advertising an intra area route into another area as an inter-area route, and because the area 0 is the backbone that connects all other areas, therefore the developpers of OSPF designed the ABR as the responsible of avoiding the routing loop between areas, the rule states that when an ABR learns an LSA Type-3 from another ABR through a non-backbone area, it does not trust this Type-3, in other words it ignores it for SPF calculation.
Now what about the NSSA area, of course there is a routing loop prevention mechanism, this mechanism is based on the P-bit and it is used when two NSSA ABRs are advertising a default Type-7 using the area x default-information originate command, the P-bit in the default Type-7 LSA is cleared so that another NSSA ABR will not install a default route in its routing table, this is what we call the P-bit loop prevention mechanism.
RFC Loop mechanism, another way to ensure that the routing loop is avoided is to be sure you are using the same RFC either 2328 or 1583 on all routers in a multiarea design, otherwise a loop can occur between an internal router and an ABR because the rule of path selection differs between RFC 2328 and RFC 1583. RFC 2328 : an intra-area route through a non-backbone is always preferred than an intra-area route via backbone or any inter-area route. And the rule of RFC2583: the path selection is based on the cost when comparing two intra-area routes regardless the area from they are learned.
The last mechanism is when you have two regular ASBRs connected to the same area and advertising a default route using the default-information originate command, when an ASBR receives a Type-5 LSA for a default route and it already originated a default Type-5 using the same command, it ignores this default route, this is what i call ASBR default route loop prevention mechanism.