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: hash.update(<short runtime string>) segfaults in bytes_from_ptr (SSO string read as a header pointer) #11481
crypto.createHash(...).update(<short string>) segfaults in perry_stdlib::crypto::util::bytes_from_ptr when the argument is a short (inline / SSO) string built at runtime.
Node 26.5.1: prints 15da3daa68966ce00bc4d1103f0561573cd36b8a.
Perry at 7071a126f (Linux x86_64, --release with CARGO_PROFILE_RELEASE_CODEGEN_UNITS=16, PERRY_NO_AUTO_OPTIMIZE=1): SIGSEGV. Also reproduced with a separate main build at b6a85cdad on the same host.
Longer strings (for example "request-path-/api/items/" + n) work. That fits the short-string (SSO) representation reaching a reader that assumes a heap StringHeader.
decode_hash_update_value calls bytes_from_ptr(arg_ptr(value)), and arg_ptr only masks the low 48 bits. An SSO string value carries no heap pointer, so bytes_from_ptr reads the masked bits as a StringHeader*. arg_bytes / arg_string use the same pattern, so other crypto arguments are probably affected as well (for example the update encoding argument and createHmac keys).
Possibly the same class as #11430, which is a pg segfault being fixed by reading the SSO bytes directly rather than through a header pointer.
Fixed by #11486 (merged): crypto natives now accept SSO strings. hash.update(<short string>) no longer segfaults in bytes_from_ptr, and test_gap_11430_crypto_short_string_args covers hash.update, HMAC, pbkdf2Sync, hkdfSync and AES.
Activity
proggeramlug commentedon Sep 27, 2026
Fixed by #11486 (merged): crypto natives now accept SSO strings.
hash.update(<short string>)no longer segfaults in bytes_from_ptr, and test_gap_11430_crypto_short_string_args covers hash.update, HMAC, pbkdf2Sync, hkdfSync and AES.