r/emacs • u/mindstormer12 • 19h ago
Question Is auto completion a real security risk?
Completion menu on point in buffer showing automatically on typing e.g. functions is useful because it usually saves a lot keystrokes (not just completing the function name but even just triggering it with e.g. TAB key). There's a warning to enable this on corfu:
Auto completion is disabled by default for safety and unobtrusiveness. Note that completion can be vulnerable to arbitrary code execution. Auto completion can be enabled by setting corfu-auto to t. Only enable auto completion locally in trusted buffers or globally if you edit trusted files only.
That warning is repeated in this post which also mentions performance concerns using the setting.
Is the security (and to a lesser extent performance) concern a practical risk or is the warning just conservative? Does typical Emacs usage involve added risk when enabling this? I feel like if one uses any third-party packages (practically every user) all of these risks already exist in general unless they are reading all the source code. Could one still use this feature reasonably safely e.g. with tips to harden it?
Coming from Neovim, I've never heard of any these risks associated with auto completion enabled--not sure how they implement it or maybe these same risks are implied and/or reasonably acceptable?