Re: How to make Emacs more secure?
Stéphane Marks <[email protected]>
| Newsgroups | gmane.emacs.help |
|---|---|
| Message-ID | <CAN+1Hbro0CvNdnnqV6hLasRXWAR4GxaRZvwQDw0mr00tUbcSGA@mail.gmail.com> |
On Sun, May 3, 2026 at 5:21 AM <[email protected]> wrote: > Hi all, > > I started a job with quite strict security requirements, and I need to > reduce any risks, for example connected with possible injections of > malicious code. > > For example, I will be running a coding agent harness in a virtual > machine to restrict its access to files on my host. > > I'm considering doing the same with Emacs, but I'd really prefer to run > it on the host machine, for several reasons (GUI vs terminal is one of > them; also, I'd like to be able to use Magit, also to communicate with > the central repo, so it will need the credentials). > > Now, what can I do to reduce risks connected with that? An obvious > thing is to use as few external packages as possible, pin their versions > to known "good" ones, and of course restrict oneself to Elpa (so no > Melpa packages) and as few packages from Non-GNU Elpa as possible. > > However, I'm not really a security expert, so maybe there are some risks > (or mitigations worth pursuing) I don't see? > > I had a "chat" with an LLM, and here are its main points: > > - There are risks connected with just opening untrusted files (file/dir > local variables, the enriched-mode issue we had some time ago, and many > more). > > - Malicious agent skill could inject something into .git/, like > https://nvd.nist.gov/vuln/detail/CVE-2024-32002 (which I would not > notice because it is obviously not version-controlled). > > - Malicious agent could even create a `.el` file with malicious content > and trick me into evaluating it. > > Do you have any suggestions about how to deal with these risks? Are > there any people in a similar situations who could share their (or their > companies') policies? Any general opinions etc.? > Ask them how they secure npm and the javascript zoo including VSCode or whatever their poisons are. Do they have supply-chain warranties from their vendors? e.g., if they contract with JetBrains, who is responsible for auditing downloaded content and how do they do that? etc etc. Your tools don't have to be held to a higher standard than the lowest one they're willing to accept if only because they don't know those tools.