harden: show a personal message's hex and its text in byte order, hidden characters marked (closes #403)
The signature screen showed only the text a personal message decodes to, with bidirectional, right-to-left and zero-width characters acting on it, so a site could make the message read differently from the bytes that are signed, and a message that was not hex was decoded into NUL characters. The screen now shows the hex as "Raw data" alongside the text, lays the text out left to right in byte order, and shows each control character, line and paragraph separator, and character that paints nothing (the set src/shared/symbolSpoof.js already strips) as a U+XXXX mark. A message is hex when getBytes, which signing uses, reads it; one that is not cannot be signed, so it is shown as plain text with "Sign" disabled. Model: opus-5-5
This commit was merged in pull request #435.
This commit is contained in:
@@ -64,3 +64,13 @@ body {
|
||||
white-space: nowrap;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
/* A personal message on the signature screen is laid out left to right in
|
||||
* the order of its bytes. Without this, right-to-left characters in it move
|
||||
* the characters around them: `5`, U+05C3, `00` would read as `500`
|
||||
* followed by U+05C3. A paragraph separator (U+2029) ends this layout for
|
||||
* the text after it, so src/popup/views/approval.js shows one as a mark. */
|
||||
.am-byte-order {
|
||||
direction: ltr;
|
||||
unicode-bidi: bidi-override;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user