Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1336 CNY

100%

CVE-2021-42694 PoC — Unicode 安全漏洞

Source
Associated Vulnerability
Title: Unicode 安全漏洞 (CVE-2021-42694)
Description:An issue was discovered in the character definitions of the Unicode Specification through 14.0. The specification allows an adversary to produce source code identifiers such as function names using homoglyphs that render visually identical to a target identifier. Adversaries can leverage this to inject code via adversarial identifier definitions in upstream software dependencies invoked deceptively in downstream software. NOTE: the Unicode Consortium offers the following alternative approach to presenting this concern. An issue is noted in the nature of international text that can affect applications that implement support for The Unicode Standard (all versions). Unless mitigated, an adversary could produce source code identifiers using homoglyph characters that render visually identical to but are distinct from a target identifier. In this way, an adversary could inject adversarial identifier definitions in upstream software that are not detected by human reviewers and are invoked deceptively in downstream software. The Unicode Consortium has documented this class of security vulnerability in its document, Unicode Technical Report #36, Unicode Security Considerations. The Unicode Consortium also provides guidance on mitigations for this class of issues in Unicode Technical Standard #39, Unicode Security Mechanisms.
Description
Generate malicious files using recently published homoglyphic-attack (CVE-2021-42694)
Readme
# CVE-2021-42694
Generate malicious files using recently published homoglyph-attack vulnerability, which was discovered at least in C, C++, C#, Go, Python, Rust, JS, ...

Cite from [cve.mitre.org](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-42694)
> An issue was discovered in the character definitions of the Unicode Specification through 14.0. The specification allows an adversary to produce source code identifiers such as function names using homoglyphs that render visually identical to a target identifier. Adversaries can leverage this to inject code via adversarial identifier definitions in upstream software dependencies invoked deceptively in downstream software.

Raw data for homoglyphs (`homoglyphs.txt`) taken from [here](https://github.com/codebox/homoglyph) and cleaned data to sort out italic and dissimilar characters.

See the original source from Camebridge University:<br>
https://www.trojansource.codes/trojan-source.pdf

## Usage
`python3 codegen.py [-h] [-i INFILE] [-o OUTFILE] [-r] [-a]`
| arg | long arg | param | descrption |
|-----|----------|-------|------------|
| -h | --help | none | show this help message and exit |
| -i | --infile | INFILE | Input file containing homoglyph placeholders |
| -o | --outfile | OUTFILE | Output file to store the final code |
| -r | --random | none | SET flag to choose random homoglyph; take first one if not set |
| -a | --about | none | Print about text |

## Examples
Examples were created by me or are takem from the referenced PDF. To run these examples, execute `codegen.py` with the required arguments:

`python3 codegen.py -i infile.xyz -o outfile.xyz` and run/compile `outfile.xyz`.

## Create own template
Currently are only digits [0-9], as well as lower- and uppercase characters [a-zA-Z] supported. To replace a supported char within your template with a (random) homoglyph, simply enclose the char with dollar signs `$`. See the examples to have a first impression on how a template could look like.
File Snapshot

Log in to view the POC file snapshot cached by Shenlong Bot

Log in to view
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →