charcheck

package
v1.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 8, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package charcheck provides character-level security checks shared across path validation (localfileio) and input validation (validate) packages. Keeping these checks in one place ensures consistent detection of dangerous Unicode and control characters throughout the codebase.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsDangerousUnicode

func IsDangerousUnicode(r rune) bool

IsDangerousUnicode identifies Unicode code points used for visual spoofing attacks. These characters are invisible or alter text direction, allowing attackers to make "report.exe" display as "report.txt" (Bidi override) or insert hidden content (zero-width characters).

func RejectControlChars

func RejectControlChars(value, flagName string) error

RejectControlChars rejects C0 control characters (except \t and \n) and dangerous Unicode characters (Bidi overrides, zero-width, line/paragraph separators) that enable visual spoofing attacks.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL