GNU Emacs
Don't miss out!
Thousands of developers use stack.watch to stay informed.Get an email whenever new security vulnerabilities are reported in GNU Emacs.
By the Year
In 2026 there have been 5 vulnerabilities in GNU Emacs with an average score of 5.6 out of ten. Last year, in 2025 Emacs had 1 security vulnerability published. That is, 4 more vulnerabilities have already been reported in 2026 as compared to last year. Last year, the average CVE base score was greater by 3.18
| Year | Vulnerabilities | Average Score |
|---|---|---|
| 2026 | 5 | 5.62 |
| 2025 | 1 | 8.80 |
| 2024 | 6 | 7.80 |
| 2023 | 7 | 8.01 |
| 2022 | 1 | 7.80 |
It may take a day or so for new Emacs vulnerabilities to show up in the stats or in the list of recent security vulnerabilities. Additionally vulnerabilities may be tagged under a different product or component name.
Recent GNU Emacs Security Vulnerabilities
Emacs <31.0.91 Integer Overflow in Image Loader leaks Heap
CVE-2026-77219
6.9 - Medium
- August 21, 2026
GNU Emacs before 31.0.91 contains an integer overflow in the PBM/PPM/PGM image loader that allows an attacker to leak heap memory contents by supplying a crafted image with large dimensions and an elevated max color index. The image loader multiplies image dimensions and channel count using signed integer arithmetic; for sufficiently large values, the result wraps to a negative number, bypassing the bounds check and causing the pixel reader to access heap memory past the end of the allocated buffer. The over-read contents are interpreted as pixel color values and rendered on screen.
Integer Overflow or Wraparound
GNU Emacs for Android improperly validates the table header input in sfnt_read_table_directory() in src/sfnt.c
CVE-2026-71394
5.3 - Medium
- August 10, 2026
GNU Emacs for Android improperly validates the table header input in sfnt_read_table_directory() in src/sfnt.c. Due to an incorrect comparison variable in the read-length check, a crafted font file that claims to contain more table directory entries than actually present causes the parser to return a struct with uninitialized heap memory in the table directory entries. An attacker can deliver a malicious font file via email, EWW (Emacs Web Wowser), or documents with custom faces, causing Emacs to load it. This leads to the use of uninitialized heap data in subsequent table lookups, potentially resulting in information disclosure, crashes, or arbitrary memory access on 32-bit targets. This issue is fixed after commit 7621ee1d01229d50e5c0cddea6bf0b01095a62cf
Improper Validation of Specified Quantity in Input
GNU Emacs for Android is vulnerable to an integer overflow in sfnt_read_name_table() in src/sfnt.c
CVE-2026-71393
5.3 - Medium
- August 10, 2026
GNU Emacs for Android is vulnerable to an integer overflow in sfnt_read_name_table() in src/sfnt.c. The function computes an allocation size using a 32-bit length value from a TrueType font file without overflow checking. On 32-bit targets, a crafted font causes the calculation to wrap, resulting in an undersized heap allocation. A subsequent read() call writes beyond the buffer, causing a heap buffer overflow. An attacker can deliver a malicious font file via email, EWW (Emacs Web Wowser), or documents with custom faces, causing Emacs to load it. This can lead to heap memory corruption and potential code execution. This issue was fixed in commit d51a4722316efe0960994d371e1859099894d1ca
Integer Overflow or Wraparound
GNU Emacs for Android is vulnerable to an integer overflow in the sfnt_read_cmap_format_12() function in src/sfnt.c
CVE-2026-71392
5.3 - Medium
- August 10, 2026
GNU Emacs for Android is vulnerable to an integer overflow in the sfnt_read_cmap_format_12() function in src/sfnt.c. When processing a crafted TrueType font file, an unguarded addition in the xmalloc allocation call wraps around on 32-bit builds, causing a heap buffer overflow write. An attacker can deliver a malicious font file via email, EWW (Emacs Web Wowser), or documents with custom faces, causing Emacs to load it. This results in heap memory corruption that can lead to code execution. This issue was fixed in commit c4e20777c26548722a37b03db93243e83a0d6188
Integer Overflow or Wraparound
GNU Emacs for Android contains an off-by-one error in the gvar table parser in src/sfnt.c
CVE-2026-71391
5.3 - Medium
- August 10, 2026
GNU Emacs for Android contains an off-by-one error in the gvar table parser in src/sfnt.c. The shared-coordinate index boundary check in sfnt_vary_simple_glyph() and sfnt_vary_compound_glyph() uses a strict greater-than comparison instead of greater-than-or-equal, allowing a crafted TrueType variable font to bypass the check and trigger a heap-based out-of-bounds read via memcpy. An attacker can deliver a malicious font file via email, EWW (Emacs Web Wowser), or documents with custom faces, causing Emacs to load it. This exposes heap memory contents which can be later used to defeat ASLR. This issue was fixed in commit 95ab9ef627b212d74d321c5bbb5b56a1be7b9fbe
off-by-five
Emacs URL Redirect Injection: Remote Shell
CVE-2025-1244
8.8 - High
- February 12, 2025
A command injection flaw was found in the text editor Emacs. It could allow a remote, unauthenticated attacker to execute arbitrary shell commands on a vulnerable system. Exploitation is possible by tricking users into visiting a specially crafted website or an HTTP URL with a redirect.
Shell injection
GNU Emacs elisp-mode Unsafe Macro Expansion Code Execution Vulnerability
CVE-2024-53920
7.8 - High
- November 27, 2024
In elisp-mode.el in GNU Emacs before 30.1, a user who chooses to invoke elisp-completion-at-point (for code completion) on untrusted Emacs Lisp source code can trigger unsafe Lisp macro expansion that allows attackers to execute arbitrary code. (This unsafe expansion also occurs if a user chooses to enable on-the-fly diagnosis that byte compiles untrusted Emacs Lisp source code.)
Code Injection
Emacs Org Link Abuse: unsafe %(...) expands shell-command-to-string before 29.4
CVE-2024-39331
- June 23, 2024
In Emacs before 29.4, org-link-expand-abbrev in lisp/ol.el expands a %(...) link abbrev even when it specifies an unsafe function, such as shell-command-to-string. This affects Org Mode before 9.7.5.
Emacs <=29.2: Default LaTeX Preview in email attachments triggers code exec
CVE-2024-30204
- March 25, 2024
In Emacs before 29.3, LaTeX preview is enabled by default for e-mail attachments.
Emacs<=29.3 Org Mode XSS: Eval arbitrary Lisp code before 9.6.23
CVE-2024-30202
- March 25, 2024
In Emacs before 29.3, arbitrary Lisp code is evaluated as part of turning on Org mode. This affects Org Mode before 9.6.23.
GNU Emacs Gnus Inline MIME Trust Bypass before 29.3
CVE-2024-30203
- March 25, 2024
In Emacs before 29.3, Gnus treats inline MIME contents as trusted.
Org Mode remote file trust in Emacs <29.3 / <9.6.23
CVE-2024-30205
- March 25, 2024
In Emacs before 29.3, Org mode considers contents of remote files to be trusted. This affects Org Mode before 9.6.23.
Emacs org-babel Execute- LaTeX: Arbitrary Command Execution (CVE-2023-2491)
CVE-2023-2491
7.8 - High
- May 17, 2023
A flaw was found in the Emacs text editor. Processing a specially crafted org-mode code with the "org-babel-execute:latex" function in ob-latex.el can result in arbitrary command execution. This CVE exists because of a CVE-2023-28617 security regression for the emacs package in Red Hat Enterprise Linux 8.8 and Red Hat Enterprise Linux 9.2.
Command Injection
Org Mode 9.6.1 Shell Metachar Abuse in ob-latex Execute
CVE-2023-28617
7.8 - High
- March 19, 2023
org-babel-execute:latex in ob-latex.el in Org Mode through 9.6.1 for GNU Emacs allows attackers to execute arbitrary commands via a file name or directory name that contains shell metacharacters.
Shell injection
Emacs 28.1-28.2: Mailto Shell Injection via emacsclient-mail.desktop
CVE-2023-27985
7.8 - High
- March 09, 2023
emacsclient-mail.desktop in Emacs 28.1 through 28.2 is vulnerable to shell command injections through a crafted mailto: URI. This is related to lack of compliance with the Desktop Entry Specification. It is fixed in 29.0.90
Shell injection
Emacs 28.x Emacsclient-Mail Desktop Lisp Injection via mailto:
CVE-2023-27986
7.8 - High
- March 09, 2023
emacsclient-mail.desktop in Emacs 28.1 through 28.2 is vulnerable to Emacs Lisp code injections through a crafted mailto: URI with unescaped double-quote characters. It is fixed in 29.0.90.
Code Injection
Command Injection via etags in GNU Emacs before 28.3
CVE-2022-48337
9.8 - Critical
- February 20, 2023
GNU Emacs through 28.2 allows attackers to execute commands via shell metacharacters in the name of a source-code file, because lib-src/etags.c uses the system C library function in its implementation of the etags program. For example, a victim may use the "etags -u *" command (suggested in the etags documentation) in a situation where the current working directory has contents that depend on untrusted input.
Shell injection
Command injection via gem in GNU Emacs ruby-mode <=28.2
CVE-2022-48338
7.3 - High
- February 20, 2023
An issue was discovered in GNU Emacs through 28.2. In ruby-mode.el, the ruby-find-library-file function has a local command injection vulnerability. The ruby-find-library-file function is an interactive function, and bound to C-c C-f. Inside the function, the external command gem is called through shell-command-to-string, but the feature-name parameters are not escaped. Thus, malicious Ruby source files may cause commands to be executed.
Command Injection
GNU Emacs <=28.2 htmlfontify.el Command Injection
CVE-2022-48339
7.8 - High
- February 20, 2023
An issue was discovered in GNU Emacs through 28.2. htmlfontify.el has a command injection vulnerability. In the hfy-istext-command function, the parameter file and parameter srcdir come from external input, and parameters are not escaped. If a file name or directory name contains shell metacharacters, code may be executed.
Output Sanitization
Command Exec via Shell Metachar in GNU Emacs 28.2 ctags
CVE-2022-45939
7.8 - High
- November 28, 2022
GNU Emacs through 28.2 allows attackers to execute commands via shell metacharacters in the name of a source-code file, because lib-src/etags.c uses the system C library function in its implementation of the ctags program. For example, a victim may use the "ctags *" command (suggested in the ctags documentation) in a situation where the current working directory has contents that depend on untrusted input.
Shell injection