-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Description
We have a number of packages that implement parsers where a panic might lead to a Denial of Service, but returning an invalid input error instead would be perfectly harmless. We should wrap them all in a recover() and prevent the panic from propagating, as a robustness and defense in depth measure.
We need to be careful about preserving documented panic conditions, and about not leaving behind persistent state that might be corrupt following a panic.
Ideas for other packages that can benefit are welcome. Crypto packages were intentionally left out, as we should be confident in their operation. math/big has a lot of entry points and persistent state by definition (and we have a plan to drag it out of the security perimeter).
/cc @golang/security