rtl-flip-detect 0.1.0

Detect right-to-left override (U+202E) and other bidi-control characters that flip rendering of strings. Used in filename-spoof and prompt-injection attacks. Zero deps.
Documentation
  • Coverage
  • 100%
    4 out of 4 items documented1 out of 4 items with examples
  • Size
  • Source code size: 17.82 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 250.26 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 30s Average build duration of successful builds.
  • all releases: 30s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • MukundaKatta/rtl-flip-detect
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • MukundaKatta

rtl-flip-detect

crates.io

Detect bidi-control characters (U+202A–U+202E, U+2066–U+2069) that flip rendered direction. Catches evil\u{202E}cod.exe filename-spoof and similar tricks inside LLM tool args.

use rtl_flip_detect::{has_rtl_flip, strip_rtl_flips};
let s = "evil\u{202E}cod.exe";
assert!(has_rtl_flip(s));
assert_eq!(strip_rtl_flips(s), "evilcod.exe");

Zero deps. MIT or Apache-2.0.