[verified] sanitize peer chat/control/bidi before store and TUI render
Some checks failed
ci / test (pull_request) Failing after 2m2s

Strip C0 (except tab/newline), DEL, C1, and bidi/format marks at ingest
and render; keep ZWJ; lossy UTF-8 stays U+FFFD. Reject the same set in
fil names. Docs match the policy.
This commit is contained in:
Sirius DevOps 2026-09-11 23:42:48 -04:00
commit e3738c51f7
No known key found for this signature in database
9 changed files with 181 additions and 5 deletions

View file

@ -10,6 +10,7 @@ use ratatui::{DefaultTerminal, Frame};
use crate::node::Node;
use crate::qr::{self, QrPayload};
use crate::sanitize;
use crate::store::{Friend, FriendProfile};
const C_ACCENT: Color = Color::Rgb(232, 165, 75);
@ -1458,7 +1459,7 @@ impl App {
.iter()
.map(|m| {
let side = if m.dir == "out" { "you" } else { "them" };
format!("{side}: {}", String::from_utf8_lossy(&m.plaintext))
format!("{side}: {}", sanitize::display_text(&m.plaintext))
})
.collect(),
Err(e) => vec![e],