Skip to content

CVE-2021-42574 Unicode Bidi override vulnerability #12478

@NthPortal

Description

@NthPortal

Use of Unicode Bidi override control characters allows malicious attackers to write code that looks like it does one thing, but actually does another, especially by embedding such control characters in string literals or comments.

Repro:
https://gist.github.com/NthPortal/a69b08eb5d2185573e5a561978f1f94e
(GitHub already has a warning for this vulnerability, which is nice)

The compiler should disallow use of such codepoints by default, and have a flag to allow use (potentially specifying only specific files that can use them). I'm drawing my suggestion purely from what Rust has done.

References:

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions