[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 rand::RngCore;
use sha2::{Digest, Sha256};
use crate::frame;
use crate::sanitize;
pub type Result<T> = std::result::Result<T, Error>;
@ -70,6 +71,7 @@ pub fn safe_name(name: &str) -> Result<&str> {
|| name.contains('\n')
|| name == ".."
|| name == "."
|| name.chars().any(sanitize::is_control_or_bidi)
{
return Err(Error("bad file name".into()));
}