| Summary: | Implement warning for homoglyphs in identifiers | ||
|---|---|---|---|
| Product: | gcc | Reporter: | David Malcolm <dmalcolm> |
| Component: | preprocessor | Assignee: | Not yet assigned to anyone <unassigned> |
| Status: | NEW --- | ||
| Severity: | normal | CC: | dongjianqiang2, egallager, hp, mpolacek, reini.urban, sundeep.kokkonda |
| Priority: | P3 | Keywords: | diagnostic, patch |
| Version: | 12.0 | ||
| Target Milestone: | --- | ||
| URL: | https://gcc.gnu.org/pipermail/gcc-patches/2021-November/583039.html | ||
| See Also: |
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103026 https://bugs.eclipse.org/bugs/show_bug.cgi?id=339146 https://github.com/golang/go/issues/20209 |
||
| Host: | Target: | ||
| Build: | Known to work: | ||
| Known to fail: | Last reconfirmed: | 2021-11-01 00:00:00 | |
| Bug Depends on: | |||
| Bug Blocks: | 87403 | ||
|
Description
David Malcolm
2021-11-01 15:05:16 UTC
I have a work-in-progress patch for this, though it has some issues that need discussion; I hope to post it soon. Initial version of patch posted for discussion to: https://gcc.gnu.org/pipermail/gcc-patches/2021-November/583039.html For reference, here's a patch to clang-tidy for this (currently under review): https://reviews.llvm.org/D112916 Just checking confusables.txt and ignoring the official TR39 Unicode security guidelines for identifiers won't get you very far. It's merely fighting a tiny symptom of a huge attack space. I suggest to properly implement TR39, such as I did in libu8ident and proposed to the C++/C working groups. Latest here: https://github.com/rurban/libu8ident/blob/master/doc/P2528R1.md confusables.txt itself is almost useless. I used it only to restrict some Greek letters not to be confused with its Latin counterparts. Checking mixed scripts is much more secure. Note that the TR31 XID lists are also pretty insecure still, even if C23 will restrict the XID's to the official TR31 XID lists. Example bug that this warning flag could have found, if the string involved were a C string: https://twitter.com/nyt_first_said/status/1513148451210637313 This bug is still not in Confirmed status. Is it still active and is there a fix planned? (In reply to Sundeep KOKKONDA from comment #6) > This bug is still not in Confirmed status. Is it still active and is there a > fix planned? For bugzilla New is the confirmed status. While there is an unconfirmed status. I have not looked into why the patch was not included yet though. |