CVE-2026-131959 (GCVE-0-2026-131959)

Vulnerability from cvelistv5 – Published: 2026-11-18 07:34 – Updated: 2026-11-18 07:34
VLAI
Summary
GNU Emacs 31.1 contains a code injection vulnerability in its handling of directory-local variables. A crafted .dir-locals.el can supply a (REGEXP FUNCTION t) entry in auto-mode-alist; when a matching file is opened, Emacs calls FUNCTION before set-auto-mode--dir-local-valid-p validates it, executing arbitrary Emacs Lisp with the privileges of the Emacs process. (Emacs 30.2 is unaffected.)
CWE
  • CWE-829 - Inclusion of Functionality from Untrusted Control Sphere
Assigner
mitre CNA under the mitre root
CNA scorecard E 29/100 over 2121 records in the last 180 days details
Impacted products
Vendor Product Version CPE status
GNU Emacs Affected: 31.1 (custom)
    cpe:2.3:a:gnu:emacs:*:*:*:*:*:*:*:*
Create a notification for this product.
Show details on NVD website

{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unknown",
          "product": "Emacs",
          "programFiles": [
            "lisp/files.el"
          ],
          "programRoutines": [
            {
              "name": "set-auto-mode--find-matching-alist-entry"
            }
          ],
          "repo": "https://git.savannah.gnu.org/cgit/emacs.git",
          "vendor": "GNU",
          "versions": [
            {
              "status": "affected",
              "version": "31.1",
              "versionType": "custom"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:a:gnu:emacs:*:*:*:*:*:*:*:*",
                  "versionEndIncluding": "31.1",
                  "versionStartIncluding": "31.1",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "GNU Emacs 31.1 contains a code injection vulnerability in its handling of directory-local variables. A crafted .dir-locals.el can supply a (REGEXP FUNCTION t) entry in auto-mode-alist; when a matching file is opened, Emacs calls FUNCTION before set-auto-mode--dir-local-valid-p validates it, executing arbitrary Emacs Lisp with the privileges of the Emacs process. (Emacs 30.2 is unaffected.)"
        }
      ],
      "metrics": [
        {
          "cvssV3_1": {
            "attackComplexity": "LOW",
            "attackVector": "LOCAL",
            "availabilityImpact": "HIGH",
            "baseScore": 7.8,
            "baseSeverity": "HIGH",
            "confidentialityImpact": "HIGH",
            "integrityImpact": "HIGH",
            "privilegesRequired": "NONE",
            "scope": "UNCHANGED",
            "userInteraction": "REQUIRED",
            "vectorString": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
            "version": "3.1"
          },
          "format": "CVSS",
          "scenarios": [
            {
              "lang": "en",
              "value": "GENERAL"
            }
          ]
        }
      ],
      "problemTypes": [
        {
          "descriptions": [
            {
              "cweId": "CWE-829",
              "description": "CWE-829 Inclusion of Functionality from Untrusted Control Sphere",
              "lang": "en",
              "type": "CWE"
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-11-18T07:34:30.502Z",
        "orgId": "8254265b-2729-46b6-b9e3-3dfca2d5bfca",
        "shortName": "mitre"
      },
      "references": [
        {
          "url": "https://www.openwall.com/lists/oss-security/2026/11/11/7"
        },
        {
          "url": "https://cgit.git.savannah.gnu.org/cgit/emacs.git/commit/?id=205ae0b0583dbfe09e258164adbc49e130645221"
        },
        {
          "tags": [
            "third-party-advisory"
          ],
          "url": "https://x3r0day.github.io"
        },
        {
          "url": "https://debbugs.gnu.org/82213"
        }
      ],
      "solutions": [
        {
          "lang": "en",
          "supportingMedia": [
            {
              "base64": false,
              "type": "text/html",
              "value": "Apply the fix from commit 205ae0b0583dbfe09e258164adbc49e130645221\u003cbr\u003e(emacs-31 branch), or upgrade to Emacs 31.2 or later when released."
            }
          ],
          "value": "Apply the fix from commit 205ae0b0583dbfe09e258164adbc49e130645221\n(emacs-31 branch), or upgrade to Emacs 31.2 or later when released."
        }
      ],
      "workarounds": [
        {
          "lang": "en",
          "supportingMedia": [
            {
              "base64": false,
              "type": "text/html",
              "value": "\u003cdiv\u003eDo not open files in untrusted directories that contain a .dir-locals.el. Setting enable-dir-local-variables to nil disables directory-local variables.\u003cbr\u003e\u003c/div\u003e"
            }
          ],
          "value": "Do not open files in untrusted directories that contain a .dir-locals.el. Setting enable-dir-local-variables to nil disables directory-local variables."
        }
      ],
      "x_generator": {
        "engine": "CVE-Request-form 0.0.1"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "8254265b-2729-46b6-b9e3-3dfca2d5bfca",
    "assignerShortName": "mitre",
    "cveId": "CVE-2026-131959",
    "datePublished": "2026-11-18T07:34:30.502Z",
    "dateReserved": "2026-11-18T07:34:30.134Z",
    "dateUpdated": "2026-11-18T07:34:30.502Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "vulnerability-lookup:meta": {
    "nvd": {
      "cve": {
        "affected": [
          {
            "affectedData": [
              {
                "defaultStatus": "unknown",
                "product": "Emacs",
                "programFiles": [
                  "lisp/files.el"
                ],
                "programRoutines": [
                  {
                    "name": "set-auto-mode--find-matching-alist-entry"
                  }
                ],
                "repo": "https://git.savannah.gnu.org/cgit/emacs.git",
                "vendor": "GNU",
                "versions": [
                  {
                    "status": "affected",
                    "version": "31.1",
                    "versionType": "custom"
                  }
                ]
              }
            ],
            "source": "cve@mitre.org"
          }
        ],
        "cveTags": [],
        "descriptions": [
          {
            "lang": "en",
            "value": "GNU Emacs 31.1 contains a code injection vulnerability in its handling of directory-local variables. A crafted .dir-locals.el can supply a (REGEXP FUNCTION t) entry in auto-mode-alist; when a matching file is opened, Emacs calls FUNCTION before set-auto-mode--dir-local-valid-p validates it, executing arbitrary Emacs Lisp with the privileges of the Emacs process. (Emacs 30.2 is unaffected.)"
          }
        ],
        "id": "CVE-2026-131959",
        "lastModified": "2026-11-18T08:17:19.593",
        "metrics": {
          "cvssMetricV31": [
            {
              "cvssData": {
                "attackComplexity": "LOW",
                "attackVector": "LOCAL",
                "availabilityImpact": "HIGH",
                "baseScore": 7.8,
                "baseSeverity": "HIGH",
                "confidentialityImpact": "HIGH",
                "integrityImpact": "HIGH",
                "privilegesRequired": "NONE",
                "scope": "UNCHANGED",
                "userInteraction": "REQUIRED",
                "vectorString": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
                "version": "3.1"
              },
              "exploitabilityScore": 1.8,
              "impactScore": 5.9,
              "source": "cve@mitre.org",
              "type": "Secondary"
            }
          ]
        },
        "published": "2026-11-18T08:17:19.593",
        "references": [
          {
            "source": "cve@mitre.org",
            "url": "https://cgit.git.savannah.gnu.org/cgit/emacs.git/commit/?id=205ae0b0583dbfe09e258164adbc49e130645221"
          },
          {
            "source": "cve@mitre.org",
            "url": "https://debbugs.gnu.org/82213"
          },
          {
            "source": "cve@mitre.org",
            "url": "https://www.openwall.com/lists/oss-security/2026/11/11/7"
          },
          {
            "source": "cve@mitre.org",
            "url": "https://x3r0day.github.io"
          }
        ],
        "sourceIdentifier": "cve@mitre.org",
        "vulnStatus": "Received",
        "weaknesses": [
          {
            "description": [
              {
                "lang": "en",
                "value": "CWE-829"
              }
            ],
            "source": "cve@mitre.org",
            "type": "Primary"
          }
        ]
      }
    }
  }
}


Solutions

CNA · mitre
Apply the fix from commit 205ae0b0583dbfe09e258164adbc49e130645221 (emacs-31 branch), or upgrade to Emacs 31.2 or later when released.

Workarounds

CNA · mitre
Do not open files in untrusted directories that contain a .dir-locals.el. Setting enable-dir-local-variables to nil disables directory-local variables.

Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Vulnerability timeline

Sightings and recorded dates, grouped by day · UTC

JSON
How durations are calculated

Following the VTEM framework (Black Hat USA 2015), time to patch starts when the vendor or a coordinator was informed, total time to patch at discovery, and disclosure to patch at public disclosure; vendor response time runs from the report to its acknowledgement. Time to exploit and time unpatched start at the earliest discovery or report, falling back to public disclosure. Unpatched time ends at the first recorded patch, or the calculation time when no patch is recorded. Exploitation to patch shows the interval between those two events; a published proof of concept is a public exploit, not exploitation.

Each result shows its source dates. A negative interval means the end event came first; when date-only inputs leave the order open, the result says so. Date-only inputs are approximate. The earliest evidence wins: KEV report dates and sightings are labelled as such. Records describing another vulnerability are listed but never calculated from, and a PoC alone does not establish exploitation. Missing patch evidence does not prove that no patch exists. Filters below change the event list only.

Events included in the timeline

Loading timeline…


    Loading…

    Loading…

    Loading…

    Related by attack behaviour

    Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.