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
fix(js): cap PBKDF2 iterations and output length to prevent runtime DoS
crypto.subtle.deriveBits/deriveKey for PBKDF2 passed the iteration count
and output length from page JS straight into op_subtle_pbkdf2 with no
bound. Because the JS runtime is single-threaded and shared across the
CDP connection, a page calling deriveBits with iterations=4294967295
pins the V8 isolate for hours and blocks every other command; a huge
requested length forces an unbounded vec![0u8; length] allocation.
Split the derivation into a testable pbkdf2_derive helper that rejects
iteration counts above 10_000_000 and output lengths above 1 MiB — both
far above any legitimate use (OWASP recommends ~600k iterations; derived
keys are tens of bytes) — with an OperationError before doing the work.
Closes#580
0 commit comments