Even if the deceased unit and the deceased agreed on confidentiality obligations in the contract before their death, then such contractual obligations are only valid for the deceased and not for the heirs.
The heirs of the estate have general obligations to the claims and debts of the decedent (that is, the deceased) before his death. Inheriting the deceased's property also means that he has to bear the debts corresponding to the inheritance share, but the performance of the deceased's debts is limited to the inherited property. You can't inherit the debt unless you give up the inheritance right. Otherwise, China's inheritance law clearly stipulates that you must bear the debts of the deceased at the same time.
It is not wrong or illegal for a third person to consult the original unit of the deceased about the transfer of the deceased's estate. It is not illegal for a unit to disclose the behavior of its heir to a third person. Unless there is a clear confidentiality obligation between the successor and the deceased unit, the unit will not bear the responsibility.