ovis icon indicating copy to clipboard operation
ovis copied to clipboard

account: signSafetyRecord should sign and return one copy of the record

Open devswha opened this issue 1 week ago • 0 comments

From CodeRabbit on #4278 (shared/account-records.ts, signSafetyRecord). The signing bytes are taken before the await, while the returned fields and id are read from the caller's object after it. A caller that mutates the record while signing is pending gets a record whose signature does not verify. It fails closed: verification refuses it and nothing is accepted. Fix: copy the record once before signing, and use the copy for the bytes, the id and the result, with a test that mutates the input during the await. Step 2 follow-up; no caller mutates today.

devswha avatar Nov 19 '26 20:11 devswha