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
If the server sends a JSON response containing non-ASCII (UTF-8) characters, a bug arises in the code that generates ranges for this transcript. This occurs because of how byte arrays are converted to strings, leading to discrepancies in character lengths.
In this code const transcript = this.#prover.transcript(); is an array of bytes but const recv = Buffer.from(transcript.recv).toString(); is a string. If there are some utf8 (non-ASCII) characters in transcipt then
Here, transcript.length represents the number of characters, not bytes. When non-ASCII characters are present, this value is shorter than the actual byte length of the transcript. This discrepancy causes end, _processEOL and subsequent JSON parsing to behave incorrectly, as the range boundaries do not align with the original byte array.
The text was updated successfully, but these errors were encountered:
If the server sends a JSON response containing non-ASCII (UTF-8) characters, a bug arises in the code that generates ranges for this transcript. This occurs because of how byte arrays are converted to strings, leading to discrepancies in character lengths.
In this code
const transcript = this.#prover.transcript();
is an array of bytes butconst recv = Buffer.from(transcript.recv).toString();
is a string. If there are some utf8 (non-ASCII) characters in transcipt thenThe length mismatch propagates into the processTranscript function:
Here,
transcript.length
represents the number of characters, not bytes. When non-ASCII characters are present, this value is shorter than the actual byte length of the transcript. This discrepancy causesend
,_processEOL
and subsequent JSON parsing to behave incorrectly, as the range boundaries do not align with the original byte array.The text was updated successfully, but these errors were encountered: