gosec
gosec copied to clipboard
Feature request: Add check for Trojan Source attacks (CVE-2021-42574)
Feature request
gosec currently does not detect Trojan Source attacks (CVE-2021-42574). This attack uses Unicode bidirectional control characters to make source code appear different to reviewers than what compilers actually execute.
What I would like to add
Add a new rule that detects Unicode Bidi control characters in source code.
Additional context
- Bandit (Python) already has this check as B613
- Reference: https://trojansource.codes/
I'm happy to submit a PR if this feature is welcomed.
I'd like to work on this feature. I will submit a PR to add a new rule.
fixed by #1431