The law doesn't care who's right or wrong. The law only cares
about if it is legal or illegal, no matter what every believe
it's morally wrong or right. (quote from the movie "the reader")
Here's the answer in most US states:
In most states, such as CA, the victim husband (or even boyfriend)
in such case usually have a very short period to dispute (usually
within 6months to 1 year after the child was born). On the other hand,
if the court established a court order, in the situation that the
victim husband (or even boyfriend) defaulted, (usually the victim
even didn't know there were a case filed by the mother.) he will have
a shorter period, usually less than 2 weeks, to dispute.
While in other states, for example NY, if the child was produced
within the marriage, the court even would refuse to issue a DNA test
and the victim husband is obligated to financially support the child.
google Paternity fraud or custody law for more info.