# CVE-2026-31778: ALSA: caiaq: fix stack out-of-bounds read in init\_card

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.1
- **CVSS:** 7.1 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.17% (percentile 4, 2026-11-28)
- **CWE:** CWE-125
- **Published:** 2026-05-01T14:15:05.804Z
- **Modified:** 2026-11-11T21:10:00.200Z

## Who should check

- Anyone running Linux \>= bafeee5b1f8d32cbf791c322b40a6fa91d8ccf7a, \< 02d9c5b0b5553a391448b6d655262bd829f90234; \>= bafeee5b1f8d32cbf791c322b40a6fa91d8ccf7a, \< 3f7f8bae0d52cbd07ab04b76b6aac89ef98ee9f6; \>= bafeee5b1f8d32cbf791c322b40a6fa91d8ccf7a, \< 66194c2575a4f567577ae70b1d7561163ce791a6; \>= bafeee5b1f8d32cbf791c322b40a6fa91d8ccf7a, \< a82c1bce2d1299dd3c686a8fe48cf75b79a403c7; \>= bafeee5b1f8d32cbf791c322b40a6fa91d8ccf7a, \< 3178b62e2e31bab39f63d4c8e54bf4ee0a425627; \>= bafeee5b1f8d32cbf791c322b40a6fa91d8ccf7a, \< 3afa2e67f3523a980a2f90fd63c22322ac2b9ce0; \>= bafeee5b1f8d32cbf791c322b40a6fa91d8ccf7a, \< 7594a6464873d90fd229e5b94cdd3b92c9feabed; \>= bafeee5b1f8d32cbf791c322b40a6fa91d8ccf7a, \< 45424e871abf2a152e247a9cff78359f18dd95c0
- Anyone running Linux 2.6.31

## Description

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

ALSA: caiaq: fix stack out-of-bounds read in init\_card

The loop creates a whitespace-stripped copy of the card shortname
where \`len \< sizeof(card-\>id)\` is used for the bounds check. Since
sizeof(card-\>id) is 16 and the local id buffer is also 16 bytes,
writing 16 non-space characters fills the entire buffer,
overwriting the terminating nullbyte.

When this non-null-terminated string is later passed to
snd\_card\_set\_id() -\> copy\_valid\_id\_string(), the function scans
forward with \`while (\*nid && ...)\` and reads past the end of the
stack buffer, reading the contents of the stack.

A USB device with a product name containing many non-ASCII, non-space
characters (e.g. multibyte UTF-8) will reliably trigger this as follows:

  BUG: KASAN: stack-out-of-bounds in copy\_valid\_id\_string
       sound/core/init.c:696 \[inline\]
  BUG: KASAN: stack-out-of-bounds in snd\_card\_set\_id\_no\_lock+0x698/0x74c
       sound/core/init.c:718

The off-by-one has been present since commit bafeee5b1f8d ("ALSA:
snd\_usb\_caiaq: give better shortname") from June 2009 (v2.6.31-rc1),
which first introduced this whitespace-stripping loop. The original
code never accounted for the null terminator when bounding the copy.

Fix this by changing the loop bound to \`sizeof(card-\>id) - 1\`,
ensuring at least one byte remains as the null terminator.

## Affected and fixed versions

- Linux: \>= bafeee5b1f8d32cbf791c322b40a6fa91d8ccf7a, \< 02d9c5b0b5553a391448b6d655262bd829f90234; \>= bafeee5b1f8d32cbf791c322b40a6fa91d8ccf7a, \< 3f7f8bae0d52cbd07ab04b76b6aac89ef98ee9f6; \>= bafeee5b1f8d32cbf791c322b40a6fa91d8ccf7a, \< 66194c2575a4f567577ae70b1d7561163ce791a6; \>= bafeee5b1f8d32cbf791c322b40a6fa91d8ccf7a, \< a82c1bce2d1299dd3c686a8fe48cf75b79a403c7; \>= bafeee5b1f8d32cbf791c322b40a6fa91d8ccf7a, \< 3178b62e2e31bab39f63d4c8e54bf4ee0a425627; \>= bafeee5b1f8d32cbf791c322b40a6fa91d8ccf7a, \< 3afa2e67f3523a980a2f90fd63c22322ac2b9ce0; \>= bafeee5b1f8d32cbf791c322b40a6fa91d8ccf7a, \< 7594a6464873d90fd229e5b94cdd3b92c9feabed; \>= bafeee5b1f8d32cbf791c322b40a6fa91d8ccf7a, \< 45424e871abf2a152e247a9cff78359f18dd95c0 (cvelist)
- Linux: 2.6.31 (cvelist)

## Mitigation

- Upgrade Linux to 45424e871abf2a152e247a9cff78359f18dd95c0 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-31778. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-31778.md
Affected: Linux >= bafeee5b1f8d32cbf791c322b40a6fa91d8ccf7a, < 02d9c5b0b5553a391448b6d655262bd829f90234; >= bafeee5b1f8d32cbf791c322b40a6fa91d8ccf7a, < 3f7f8bae0d52cbd07ab04b76b6aac89ef98ee9f6; >= bafeee5b1f8d32cbf791c322b40a6fa91d8ccf7a, < 66194c2575a4f567577ae70b1d7561163ce791a6; >= bafeee5b1f8d32cbf791c32…
Fixed in: Linux 02d9c5b0b5553a391448b6d655262bd829f90234, Linux 3f7f8bae0d52cbd07ab04b76b6aac89ef98ee9f6, Linux 66194c2575a4f567577ae70b1d7561163ce791a6, Linux 3178b62e2e31bab39f63d4c8e54bf4ee0a425627, Linux 3afa2e67f3523a980a2f90fd63c22322ac2b9ce0, Linux 7594a6464873d90fd229e5b94cdd3b92c9feabed, Linux 45424…

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2026-31778 being exploited?

There is no confirmed exploitation: CVE-2026-31778 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.17% chance of exploitation in the next 30 days (as of 2026-11-28).

### How serious is CVE-2026-31778?

High: CVSS 7.1 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2026-31778?

Linux \>= bafeee5b1f8d32cbf791c322b40a6fa91d8ccf7a, \< 02d9c5b0b5553a391448b6d655262bd829f90234; \>= bafeee5b1f8d32cbf791c322b40a6fa91d8ccf7a, \< 3f7f8bae0d52cbd07ab04b76b6aac89ef98ee9f6; \>= bafeee5b1f8d32cbf791c322b40a6fa91d8ccf7a, \< 66194c2575a4f567577ae70b1d7561163ce791a6; \>= bafeee5b1f8d32cbf791c322b40a6fa91d8ccf7a, \< a82c1bce2d1299dd3c686a8fe48cf75b79a403c7; \>= bafeee5b1f8d32cbf791c322b40a6fa91d8ccf7a, \< 3178b62e2e31bab39f63d4c8e54bf4ee0a425627; \>= bafeee5b1f8d32cbf791c322b40a6fa91d8ccf7a, \< 3afa2e67f3523a980a2f90fd63c22322ac2b9ce0; \>= bafeee5b1f8d32cbf791c322b40a6fa91d8ccf7a, \< 7594a6464873d90fd229e5b94cdd3b92c9feabed; \>= bafeee5b1f8d32cbf791c322b40a6fa91d8ccf7a, \< 45424e871abf2a152e247a9cff78359f18dd95c0; Linux 2.6.31.

### Is there a fix for CVE-2026-31778?

Yes. Fixed in Linux 02d9c5b0b5553a391448b6d655262bd829f90234, Linux 3f7f8bae0d52cbd07ab04b76b6aac89ef98ee9f6, Linux 66194c2575a4f567577ae70b1d7561163ce791a6, Linux 3178b62e2e31bab39f63d4c8e54bf4ee0a425627, Linux 3afa2e67f3523a980a2f90fd63c22322ac2b9ce0, Linux 7594a6464873d90fd229e5b94cdd3b92c9feabed, Linux 45424e871abf2a152e247a9cff78359f18dd95c0. Upgrade Linux to 45424e871abf2a152e247a9cff78359f18dd95c0 or later.

### How do I check if I'm affected by CVE-2026-31778?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/02d9c5b0b5553a391448b6d655262bd829f90234>
- patch: <https://git.kernel.org/stable/c/3f7f8bae0d52cbd07ab04b76b6aac89ef98ee9f6>
- patch: <https://git.kernel.org/stable/c/66194c2575a4f567577ae70b1d7561163ce791a6>
- patch: <https://git.kernel.org/stable/c/a82c1bce2d1299dd3c686a8fe48cf75b79a403c7>
- patch: <https://git.kernel.org/stable/c/3178b62e2e31bab39f63d4c8e54bf4ee0a425627>
- patch: <https://git.kernel.org/stable/c/3afa2e67f3523a980a2f90fd63c22322ac2b9ce0>
- patch: <https://git.kernel.org/stable/c/7594a6464873d90fd229e5b94cdd3b92c9feabed>
- patch: <https://git.kernel.org/stable/c/45424e871abf2a152e247a9cff78359f18dd95c0>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-31778>

HTML: <https://flawdb.com/CVE-2026-31778> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-31778>
