CVE-2026-31786

Buffer overflow in drivers/xen/sys-hypervisor.c

7.8 high EPSS 0.22%

Published 30 Apr 2026 Updated 19 Oct 2026 CNA: Linux

Check your servers for CVE-2026-31786

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-31786 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.

Check my servers

Description

In the Linux kernel, the following vulnerability has been resolved:

Buffer overflow in drivers/xen/sys-hypervisor.c

The build id returned by HYPERVISOR_xen_version(XENVER_build_id) is neither NUL terminated nor a string.

The first causes a buffer overflow as sprintf in buildid_show will read and copy till it finds a NUL.

00000000 f4 91 51 f4 dd 38 9e 9d 65 47 52 eb 10 71 db 50 |..Q..8..eGR..q.P| 00000010 b9 a8 01 42 6f 2e 32 |...Bo.2| 00000017

So use a memcpy instead of sprintf to have the correct value:

00000000 f4 91 51 f4 dd 00 9e 9d 65 47 52 eb 10 71 db 50 |..Q.....eGR..q.P| 00000010 b9 a8 01 42 |...B| 00000014

(the above have a hack to embed a zero inside and check it's returned correctly).

This is XSA-485 / CVE-2026-31786

Severity (CVSS)

7.8 high CVSS 3.1 from Linux (CNA)
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.22%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 7.02% of all scored CVEs. Scores of 30 Nov 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-120 Buffer Copy without Checking Size of Input

Affected products

As the CNA lists them.

ProductVersions
Linux
affected from 84b7625728ea311ea35bdaa0eded53c1c56baeaa, before e3af585e1728c917682b6a3de9a69b41fb9194d4
affected from 84b7625728ea311ea35bdaa0eded53c1c56baeaa, before 8288d031a01dbacfde3fc643f7be3d23504de64d
affected from 84b7625728ea311ea35bdaa0eded53c1c56baeaa, before f458ba102da97fafca106327086fc95f3fc764cb
affected from 84b7625728ea311ea35bdaa0eded53c1c56baeaa, before 4b4defd2fce3f966c25adabf46644a85558f1169
affected from 84b7625728ea311ea35bdaa0eded53c1c56baeaa, before 5c5ff7c7bd15bb536f44b10b3fb5b8408f344d0a
affected from 84b7625728ea311ea35bdaa0eded53c1c56baeaa, before d5f59216650c51e5e3fcb7517c825bc8047f60ef
affected from 84b7625728ea311ea35bdaa0eded53c1c56baeaa, before 52cecff98bda2c51eed1c6ce9d21c5d6268fb19d
affected from 84b7625728ea311ea35bdaa0eded53c1c56baeaa, before 27fdbab4221b375de54bf91919798d88520c6e28
Other versions: unaffected
Linux
affected 4.13
unaffected before 4.13
unaffected from 5.10.254 up to and including 5.10.*
unaffected from 5.15.204 up to and including 5.15.*
unaffected from 6.1.170 up to and including 6.1.*
unaffected from 6.6.137 up to and including 6.6.*
unaffected from 6.12.85 up to and including 6.12.*
unaffected from 6.18.26 up to and including 6.18.*
unaffected from 7.0.3 up to and including 7.0.*
unaffected 7.1 and later
Other versions: affected

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-31786 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2026-31786

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-31786
trivy image --scanners vuln IMAGE | grep CVE-2026-31786

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

Source: the record CVE-2026-31786 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.