You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
crypto: cipher update process crash with input of max int32 length #45757
changed the title [-]crypto cause process crash with magic data length[/-][+]crypto: cipher update process crash with input of max int32 length[/+]on Dec 6, 2022
It's a signed integer overflow, caused by openssl using ints for sizes and node mixing int and size_t (and not being diligent enough about overflow checking.)
This particular issue isn't that hard to fix but it's probably just one of many similar bugs lurking in src/crypto.
Activity
panva commentedon Dec 6, 2022
cc @nodejs/crypto
[-]crypto cause process crash with magic data length[/-][+]crypto: cipher update process crash with input of max int32 length[/+]panva commentedon Dec 6, 2022
marco-ippolito commentedon Dec 7, 2022
I'll work on it. If need help can I bother you @panva ?
bnoordhuis commentedon Dec 7, 2022
It's a signed integer overflow, caused by openssl using ints for sizes and node mixing
intandsize_t(and not being diligent enough about overflow checking.)This particular issue isn't that hard to fix but it's probably just one of many similar bugs lurking in src/crypto.
bnoordhuis commentedon Dec 7, 2022
Here is a quick fix:
Note:
len + block_sizeis not UB becauseblock_sizegets converted tosize_tsincelenis asize_t.panva commentedon Dec 7, 2022
@marco-ippolito absolutely, go for it.
crypto: fix CipherBase Update int32 overflow
crypto: fix CipherBase Update int32 overflow
crypto: fix CipherBase Update int32 overflow