Count the noncharacters of every plane as Unshown #6

Open
opened 2026-11-22 13:22:18 +00:00 by jorijnvdgraaf · 0 comments

Unshown is the library's list of code points that draw nothing or tell text where to go. Its comment ends the list with "what is no character at all", and the table has those of the first plane (U+FDD0 to U+FDEF, U+FFFE, U+FFFF) and, through the two planes of private use, those of the last two. The noncharacters of the planes between, U+1FFFE and U+1FFFF up to U+EFFFE and U+EFFFF, are not in it.

sd-bus refuses a string with any noncharacter. So a name from the bank that holds one of those passes nostrod's Shown() into the summary of a password dialog, and the question to polkit, which carries the summary as a string, cannot be built: appending it throws, and the caller is answered InvalidArgument, "text that is not UTF-8 cannot be sent to nostrod". The call fails closed: nobody is asked, and nothing is paid.

Found by the pre-push review of 1.0.0 (the bug-prover and security lenses). The table moved from the worker into Nostro:Utils in that release, unchanged, so this is older than it.

Where

Links are to the tree at 8dd31e2 (1.0.0).

  • Unshown: {0xFDD0, 0xFDEF}, {0xFFFE, 0xFFFF}, {0xE0000, 0xE0FFF} and {0xF0000, 0xFFFFFFFF}, and nothing that holds 0x1FFFE.
  • Shown() leaves out what is Unshown, and Ask appends the summary and the details to the question as strings.
  • The app's reader of pay links has a check of its own for these since 1.0.0 (Plain(): (code & 0xFFFE) == 0xFFFE), with a comment saying that Unshown lacks them.

Who can reach it

Not a caller that uses sd-bus, as Nostro::Client does: it cannot append such a string. Whether nostrod's sd-bus reads one that a client of another library sent was not tried. What is left is text nostrod reads from the bank: an account's name, a counterparty's name on a request or a draft. nlohmann's parser takes a noncharacter as the valid UTF-8 it is.

What it would take

  • Unshown true for every code point whose low sixteen bits are FFFE or FFFF, in the function or as ranges in its table.
  • ShouldHandleMoneyAndText holds the table at the ends of its ranges, and gets the new ones. ShouldServeEveryUser could show a bank's name with U+1FFFE in a summary without it.
  • Plain()'s own check and its comment can then go.
  • AGENTS.consumer.md describes Unshown in a line, which #4 has as inexact already.

What was run, and what was read

Run, against libsystemd 262.1: sd_bus_message_append_basic with type s returns -EINVAL for U+1FFFE, U+2FFFF and U+EFFFF, as for U+FFFE and U+FDD0. That a summary with one fails at the question to polkit is from reading the code, not from a run.

`Unshown` is the library's list of code points that draw nothing or tell text where to go. Its comment ends the list with "what is no character at all", and the table has those of the first plane (U+FDD0 to U+FDEF, U+FFFE, U+FFFF) and, through the two planes of private use, those of the last two. The noncharacters of the planes between, U+1FFFE and U+1FFFF up to U+EFFFE and U+EFFFF, are not in it. sd-bus refuses a string with any noncharacter. So a name from the bank that holds one of those passes nostrod's `Shown()` into the summary of a password dialog, and the question to polkit, which carries the summary as a string, cannot be built: appending it throws, and the caller is answered `InvalidArgument`, "text that is not UTF-8 cannot be sent to nostrod". The call fails closed: nobody is asked, and nothing is paid. Found by the pre-push review of 1.0.0 (the bug-prover and security lenses). The table moved from the worker into `Nostro:Utils` in that release, unchanged, so this is older than it. ## Where Links are to the tree at 8dd31e2 (1.0.0). - [`Unshown`](https://forgejo.catcrafts.net/Catcrafts/Nostro/src/commit/8dd31e2bb9eb3ac3f7c73ea5f35ad1986b61877b/interfaces/Nostro-Utils.cppm#L175-L194): `{0xFDD0, 0xFDEF}`, `{0xFFFE, 0xFFFF}`, `{0xE0000, 0xE0FFF}` and `{0xF0000, 0xFFFFFFFF}`, and nothing that holds 0x1FFFE. - [`Shown()`](https://forgejo.catcrafts.net/Catcrafts/Nostro/src/commit/8dd31e2bb9eb3ac3f7c73ea5f35ad1986b61877b/implementations/Nostro-Daemon-Worker.cpp#L135-L179) leaves out what is `Unshown`, and [`Ask`](https://forgejo.catcrafts.net/Catcrafts/Nostro/src/commit/8dd31e2bb9eb3ac3f7c73ea5f35ad1986b61877b/implementations/Nostro-Daemon-Worker.cpp#L424-L456) appends the summary and the details to the question as strings. - The app's reader of pay links has a check of its own for these since 1.0.0 ([`Plain()`](https://forgejo.catcrafts.net/Catcrafts/Nostro/src/commit/8dd31e2bb9eb3ac3f7c73ea5f35ad1986b61877b/implementations/Nostro.App-Forms.cpp#L66-L85): `(code & 0xFFFE) == 0xFFFE`), with a comment saying that `Unshown` lacks them. ## Who can reach it Not a caller that uses sd-bus, as `Nostro::Client` does: it cannot append such a string. Whether nostrod's sd-bus reads one that a client of another library sent was not tried. What is left is text nostrod reads from the bank: an account's name, a counterparty's name on a request or a draft. nlohmann's parser takes a noncharacter as the valid UTF-8 it is. ## What it would take - `Unshown` true for every code point whose low sixteen bits are FFFE or FFFF, in the function or as ranges in its table. - `ShouldHandleMoneyAndText` holds the table at the ends of its ranges, and gets the new ones. `ShouldServeEveryUser` could show a bank's name with U+1FFFE in a summary without it. - `Plain()`'s own check and its comment can then go. - `AGENTS.consumer.md` describes `Unshown` in a line, which #4 has as inexact already. ## What was run, and what was read Run, against libsystemd 262.1: `sd_bus_message_append_basic` with type `s` returns `-EINVAL` for U+1FFFE, U+2FFFF and U+EFFFF, as for U+FFFE and U+FDD0. That a summary with one fails at the question to polkit is from reading the code, not from a run.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Catcrafts/Nostro#6
No description provided.