bidirectional

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BidirectionalCharactersDict = map[rune]string{
	0x200E: "LRM",
	0x200F: "RLM",
	0x061C: "ALM",
	0x202A: "LRE",
	0x202B: "RLE",
	0x202C: "PDF",
	0x202D: "LRO",
	0x202E: "RLO",
	0x2066: "LRI",
	0x2067: "RLI",
	0x2068: "FSI",
	0x2069: "PDI",
}

Global dict for bidirectional characrters

Functions

func ContainBidirectionnal

func ContainBidirectionnal(str string) bool

ContainBidirectionnal reports whether the byte contains bidirectionnal character as defined by Unicode's bidirectional algorithm property; this could lead to Trojan Source vulnerability

func IsBidirectionalAlgorithm

func IsBidirectionalAlgorithm(r rune) bool

IsBidirectionalAlgorithm reports whether the rune is a bidirectionnal character as defined by Unicode's bidirectional algorithm property; This is: - Implicit Directional Formatting Characters: U+200E (LRM), U+200F (RLM), U+061C (ALM) - Explicit Directional Embedding and Override Formatting Characters: U+202A (LRE), U+202B (RLE), U+202D (LRO), U+202E (RLO), U+202C (PDF) - Explicit Directional Isolate Formatting Characters: U+2066 (LRI), U+2067 (RLI), U+2068 (FSI), U+2069 (PDI).

func Scan

func Scan(path string, cfg *config.Config)

Scan file or folder to detect potential Trojan Source vulnerability within. This function exit with status code 1 if trojan source has been detected, 0 otherwise

Types

This section is empty.

Jump to

Keyboard shortcuts

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