Now, there are still many validly-ordained (ordained before 1968/9 or so) priests floating around out there.
Do you deny the validity of the Thuc consecrations, Ladislaus?
Heretics do not have the power of the keys. It's in St. Thomas, not to mention Paul IV in cuм Ex Apostolatus Officio demands that we avoid heretics, even if they are cardinals or the Pope, who of course would cease being cardinals or the Pope.
You have "trads" in Novus Ordo and in SSPX who know that their priests are heretics and go there anyway for the sacraments. This must be a new phenomenon, and is radically different than how Catholics acted during the Arian crisis.
The Eucharist is confected, but instead of bringing you grace, it may redound to your dishonor. As for confession, heretics can't absolve sins. Heretics are not in the Church. God MAY absolve sins through them, through your contrition, but He can also do that with someone who simply waits for a real priest, and this person also avoids sacrilege.
St. Thomas also says to confess to a layman in certain cases, like if your priest is a heretic or your confession to him would be dangerous. I imagine he means if the priest is collecting information in confession to blackmail people. You have to intend to re-confess as soon as possible though. The layman of course has no power to forgive the sins but it shows God that you respect the sacrament, which is crucial, because to respect the sacrament is to respect the Church.
To just assume we are forgiven without confession, even if we have perfect contrition, could be fatal. It is presumption and offensive to the Church that Christ founded. But to avoid a heretical priest is not anything like that, and it is disturbing that people these days will go to Mass with anyone in a cassock.