CVE-2026-31742
vt: discard stale unicode buffer on alt screen exit after resize
Check your servers for CVE-2026-31742
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2026-31742 affects the running kernel, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
Description
In the Linux kernel, the following vulnerability has been resolved:
vt: discard stale unicode buffer on alt screen exit after resize
When enter_alt_screen() saves vc_uni_lines into vc_saved_uni_lines and sets vc_uni_lines to NULL, a subsequent console resize via vc_do_resize() skips reallocating the unicode buffer because vc_uni_lines is NULL. However, vc_saved_uni_lines still points to the old buffer allocated for the original dimensions.
When leave_alt_screen() later restores vc_saved_uni_lines, the buffer dimensions no longer match vc_rows/vc_cols. Any operation that iterates over the unicode buffer using the current dimensions (e.g. csi_J clearing the screen) will access memory out of bounds, causing a kernel oops:
BUG: unable to handle page fault for address: 0x0000002000000020 RIP: 0010:csi_J+0x133/0x2d0
The faulting address 0x0000002000000020 is two adjacent u32 space characters (0x20) interpreted as a pointer, read from the row data area past the end of the 25-entry pointer array in a buffer allocated for 80x25 but accessed with 240x67 dimensions.
Fix this by checking whether the console dimensions changed while in the alternate screen. If they did, free the stale saved buffer instead of restoring it. The unicode screen will be lazily rebuilt via vc_uniscr_check() when next needed.
Severity (CVSS)
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- Attack vector
- local: the attacker needs local access, or a user has to open a prepared file
- Attack complexity
- low: an attack works without special conditions
- Privileges required
- low: the attacker needs an ordinary user account
- User interaction
- none: nobody has to click or open anything
- Scope
- unchanged: the damage stays inside the vulnerable component
- Impact
- confidentiality high, integrity high, availability high: what an attacker can read (confidentiality), change (integrity) or stop (availability)
Exploitation
EPSS 0.13%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 3.02% of all scored CVEs. Scores of 1 Dec 2026.
The assessment of CISA (SSVC, 16 Oct 2026):
- Exploitation
- none: CISA did not find evidence of exploitation or a public proof of concept
- Automatable
- no: each attack takes manual steps
- Technical impact
- total: full control of the component or of its data
Weakness
- CWE-125 Out-of-bounds Read
Affected products
As the CNA lists them.
| Product | Versions |
|---|---|
| Linux |
affected from c4efef65a46f610418a3f69149c51492d31c8591, before 891d790fdb5c96c6e1d2841e06ee6c360f2d1288 affected from 1cf66bd9127447c57295f5199029e8d8b47c6c67, before 428fdf55301e6c8fa5a36b426240797b1cf86570 affected from 5eb608319bb56464674a71b4a66ea65c6c435d64, before 40014493cece72a0be5672cd86763e53fb3ec613
Other versions: unaffected
|
| Linux |
affected from 6.18.20, before 6.18.22 affected from 6.19.10, before 6.19.12
Other versions: unaffected
|
Is my server affected?
This CVE is in the Linux kernel. Compare the running kernel with the fixed kernel version of your distribution, and reboot after a kernel update:
uname -r
# Debian, Ubuntu: does the changelog of the running kernel name the CVE?
zgrep -l CVE-2026-31742 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2026-31742
With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2026-31742
trivy image --scanners vuln IMAGE | grep CVE-2026-31742
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Other references
- https://git.kernel.org/stable/c/891d790fdb5c96c6e1d2841e06ee6c360f2d1288 git.kernel.org
- https://git.kernel.org/stable/c/428fdf55301e6c8fa5a36b426240797b1cf86570 git.kernel.org
- https://git.kernel.org/stable/c/40014493cece72a0be5672cd86763e53fb3ec613 git.kernel.org
Source: the record CVE-2026-31742 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST; the CWE catalog of MITRE, CWE Terms of Use. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse