CVE-2025-22003: can: ucan: fix out of bound read in strscpy() source
In the Linux kernel, the following vulnerability has been resolved:
can: ucan: fix out of bound read in strscpy() source
Commit 7fdaf8966aae ("can: ucan: use strscpy() to instead of strncpy()")
unintentionally introduced a one byte out of bound read on strscpy()'s
source argument (which is kind of ironic knowing that strscpy() is meant
to be a more secure alternative :)).
Let's consider below buffers:
dest[len + 1]; /* will be NUL terminated */
src[len]; /* may not be NUL terminated */
When doing:
strncpy(dest, src, len);
dest[len] = '\0';
strncpy() will read up to len bytes from src.
On the other hand:
strscpy(dest, src, len + 1);
will read up to len + 1 bytes from src, that is to say, an out of bound
read of one byte will occur on src if it is not NUL terminated. Note
that the src[len] byte is never copied, but strscpy() still needs to
read it to check whether a truncation occurred or not.
This exact pattern happened in ucan.
The root cause is that the source is not NUL terminated. Instead of
doing a copy in a local buffer, directly NUL terminate it as soon as
usb_control_msg() returns. With this, the local firmware_str[] variable
can be removed.
On top of this do a couple refactors:
- ucan_ctl_payload->raw is only used for the firmware string, so
rename it to ucan_ctl_payload->fw_str and change its type from u8 to
char.
- ucan_device_request_in() is only used to retrieve the firmware
string, so rename it to ucan_get_fw_str() and refactor it to make it
directly handle all the string termination logic.
Security readout for executives and security teams
Plain-English summary
CVE-2025-22003 is a Linux kernel flaw in the ucan CAN driver. A string-copy change caused a one-byte out-of-bounds read when handling a firmware string. The published impact is mainly availability, not data theft. It requires local access with low privileges, so urgency is higher for shared systems or environments using this driver.
Executive priority
Treat as a moderate-priority kernel maintenance item. It is not currently supported by evidence of active exploitation, but kernel availability impact can matter on shared, embedded, industrial, or hardware-connected Linux systems.
Technical view
The issue is CWE-125 in the Linux kernel ucan driver. strscpy() could read one byte past a non-NUL-terminated source returned through usb_control_msg(). The kernel fix NUL-terminates the firmware string immediately after the USB control response and refactors related ucan firmware-string handling. CVSS is 5.5, AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H.
Likely exposure
Exposure is likely limited to Linux systems running affected kernels with the ucan CAN driver present or in use. The CVE data lists Linux kernel versions/branches and stable kernel fix references, but exact distribution package impact must be confirmed with each vendor.
Exploitation context
The provided sources do not show active exploitation, and the CVE is not marked KEV. The CVSS vector indicates local access, low attack complexity, low privileges, and no user interaction, with high availability impact. No confidentiality or integrity impact is listed.
Researcher notes
Evidence is limited to the CVE record and Linux stable commits. The root cause is a strncpy-to-strscpy conversion where the source buffer may lack NUL termination. The fix changes ucan firmware-string handling, not a broad strscpy issue.
Mitigation direction
Apply Linux kernel updates that include the referenced stable ucan fixes.
Check distribution advisories for exact fixed kernel packages.
Prioritize shared systems and hosts using ucan-supported CAN hardware.
If patching is delayed, limit untrusted local access and untrusted USB CAN device exposure.
Validation and detection
Inventory Linux kernel versions across affected systems.
Determine whether the ucan CAN driver is enabled, loaded, or required.
Compare installed kernels with vendor advisories and referenced stable commits.
Verify patched kernels include the ucan firmware-string termination fix.
Monitor vendor errata for corrected affected-version mapping.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · low confidence lookup
CWE-125: Exact CWE lookup
Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.
CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.
CWE-125 · source CWE mapping
Out-of-bounds Read
Out-of-bounds Read represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.