If a child is in danger of death, would a secret baptism – without the parents' knowledge – be valid?

Full Question

My sister’s newborn suffered a stroke during delivery and is not expected to live. She and her husband refuse to have their son baptized, so my mother wants to baptize their baby in secret. Would such a baptism be valid?

Answer

A baptism in a clear danger-of-death situation would be considered licit and valid, providing the baptism was conferred with the correct form, the correct matter, and the correct intention (see CCC 1256). According to the Code of Canon Law, “An infant of Catholic parents or even of non-Catholic parents can be baptized licitly in danger of death even against the will of the parents” (CIC 868 §2). However, the New Commentary on the Code of Canon Law makes it clear that the canon “in no way advocates that a child, even in danger of death, be baptized against the express will of the parents. It simply presents a juridical clarification of the liceity of a baptism administered under those conditions” (1057). Canon 868 states:
For an infant to be baptized licitly:

the parents or at least one of them or the person who legitimately takes their place must consent;

there must be a founded hope that the infant will be brought up in the Catholic religion; if such hope is altogether lacking, the baptism is to be delayed according to the prescripts of particular law after the parents have been advised about the reason.