Last active
March 21, 2026 03:57
-
-
Save oshinko/9454bf9fd0fbd0d2a85d4ffd975c45f4 to your computer and use it in GitHub Desktop.
GlassWorm Demo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // https://www.aikido.dev/blog/glassworm-returns-unicode-attack-github-npm-vscode | |
| const s = v => [...v].map(w => ( | |
| w = w.codePointAt(0), | |
| 0xFE00 <= w && w <= 0xFE0F ? w - 0xFE00 : | |
| 0xE0100 <= w && w <= 0xE01EF ? w - 0xE0100 + 16 : null | |
| )).filter(n => n !== null); | |
| const d = v => typeof Buffer !== 'undefined' ? | |
| Buffer.from(s(v)).toString('utf-8') : | |
| new TextDecoder().decode(Uint8Array.from(s(v))); | |
| const maliciousScript = d(`󠅓󠅟󠅞󠅣󠅟󠅜󠅕󠄞󠅜󠅟󠅗󠄘󠄒󠄸󠅕󠅜󠅜󠅟󠄜󠄐󠅇󠅟󠅢󠅜󠅔󠄑󠄒󠄙`); | |
| console.log(maliciousScript); | |
| // eval(maliciousScript); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment