International
The Morning Dev

Only the news worth knowing

‹
 
B45/100

Vulnerability · high

Emacs .dir-locals.el arbitrary code execution

Tier B · Patch this week – Put it in the sprint

Who’s exposed: Emacs 31.1 users opening projects with malicious .dir-locals.el files

Tier B because: Full takeover OR secrets exposed OR supply chain

Reach

Attack

Damage

Fix

Popular tool · Full takeover · No fix yet

What to do

  1. Stay on or fall back to Emacs 30.2, which is unaffected, until Emacs 31.2 is released.
  2. Apply the patch from Stefan Monnier attached to the disclosure, or upgrade to Emacs 31.2 once it ships.

The Brief

  • Emacs 31.1 did not adequately validate the contents of .dir-locals.el before executing code from it, allowing arbitrary code execution.
  • Emacs 30.2 is unaffected.
  • A patch from Stefan Monnier is attached to the disclosure and will be included in the upcoming Emacs 31.2 release.

Why it matters

Opening a project containing a malicious .dir-locals.el file could run attacker-chosen code on a developer's machine when using Emacs 31.1.

The checklist behind the tier

Checklist · 4 of 10 yes
YesHits tech teamsJudgment: Emacs is a developer text editor used by programmers to edit code.
NoCore infrastructureJudgment: a single editor, not infrastructure that nearly every team runs.
YesPopular toolJudgment: Emacs is a widely used developer editor with a large user base.
NoExploited in the wildOpen Source Security: a researcher discovered the flaw; no observed attacks are reported.
NoPublic exploitOpen Source Security: only discovery and a patch are mentioned; no public exploit or PoC is reported.
NoRemote, no loginOpen Source Security: flaw is in .dir-locals.el handling; no unauthenticated network attack is described.
YesFull takeoverOpen Source Security: the flaw is described as arbitrary code execution.
NoSecrets exposedOpen Source Security: no theft or exposure of credentials, tokens, or data is reported.
NoSupply chainOpen Source Security: a flaw in code validation; no compromised package, update, or pipeline is reported.
YesNo fix yetOpen Source Security: a patch is attached and will be included in the upcoming 31.2 release, so no fixed release yet.

Timeline

  1. Vulnerability disclosed on the oss-security list by Sean Whitton

  2. Open Source Security

    Emacs .dir-locals.el arbitrary code execution

Source

Emacs .dir-locals.el arbitrary code execution ↗ Open Source Security · 2h ago

First seen · 1 source · Full story page · How tiers are decided