CVE-2026-31513: Bluetooth: L2CAP: Fix stack-out-of-bounds read in l2cap_ecred_conn_req
In the Linux kernel, the following vulnerability has been resolved:
Bluetooth: L2CAP: Fix stack-out-of-bounds read in l2cap_ecred_conn_req
Syzbot reported a KASAN stack-out-of-bounds read in l2cap_build_cmd()
that is triggered by a malformed Enhanced Credit Based Connection Request.
The vulnerability stems from l2cap_ecred_conn_req(). The function allocates
a local stack buffer (`pdu`) designed to hold a maximum of 5 Source Channel
IDs (SCIDs), totaling 18 bytes. When an attacker sends a request with more
than 5 SCIDs, the function calculates `rsp_len` based on this unvalidated
`cmd_len` before checking if the number of SCIDs exceeds
L2CAP_ECRED_MAX_CID.
If the SCID count is too high, the function correctly jumps to the
`response` label to reject the packet, but `rsp_len` retains the
attacker's oversized value. Consequently, l2cap_send_cmd() is instructed
to read past the end of the 18-byte `pdu` buffer, triggering a
KASAN panic.
Fix this by moving the assignment of `rsp_len` to after the `num_scid`
boundary check. If the packet is rejected, `rsp_len` will safely
remain 0, and the error response will only read the 8-byte base header
from the stack.
Security readout for executives and security teams
Plain-English summary
A nearby unauthenticated attacker could send a malformed Bluetooth L2CAP request that makes a vulnerable Linux kernel read beyond a small stack buffer. This may expose kernel memory or crash the system. Bluetooth-enabled endpoints in physically accessible or hostile-radio environments deserve prompt review.
Executive priority
Treat this as a high-priority proximity-based risk, not an internet-wide emergency. Accelerate patching for Bluetooth-enabled systems in public, shared, operationally sensitive, or difficult-to-recover locations. Normal maintenance may suffice for systems without Bluetooth hardware or with Bluetooth reliably disabled.
Technical view
l2cap_ecred_conn_req calculated an oversized response length before validating that an Enhanced Credit Based request contained no more than five SCIDs. Its rejection path then passed that length to l2cap_send_cmd, causing an out-of-bounds read beyond the 18-byte stack PDU. The correction performs the boundary check first and leaves the rejected response length at zero.
Likely exposure
Exposure requires a Linux system using the affected Bluetooth L2CAP functionality and an attacker within Bluetooth communication range. The bundle does not provide a complete vulnerable-version range. It identifies 6.12.75, 6.18.16, and 6.19.6 as unaffected, alongside four unaffected commit identifiers.
Exploitation context
The CVSS 3.1 score is 8.1 with adjacent-network access, low complexity, no privileges, and no user interaction. The reported trigger came from syzbot and produced a KASAN panic. The CVE is not listed as KEV, and the supplied sources provide no evidence of active exploitation.
Researcher notes
The key defect is stale attacker-controlled rsp_len state on an error path, not an overflow while writing pdu. The source describes an over-read and KASAN panic; the CVSS vector also assigns high confidentiality and availability impacts. Exact vulnerable release boundaries and real-world exploitability are not established in the bundle.
Mitigation direction
Update to a vendor-supported kernel containing the applicable referenced fix.
Confirm vendor advisories before mapping fixes to distribution-specific kernel versions.
Disable Bluetooth on systems where it is unnecessary until remediation is confirmed.
Prioritize exposed kiosks, industrial systems, laptops, and other devices reachable by nearby strangers.
Validation and detection
Inventory Linux kernel versions and determine which systems have Bluetooth enabled.
Compare distribution kernel builds with vendor advisories and the four referenced stable fixes.
Verify remediated systems run an unaffected or vendor-confirmed backported kernel.
Review kernel crash and Bluetooth logs for unexplained L2CAP errors or KASAN reports.
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.
cve · low confidence lookup
CVE-2026-31513 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
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.
1CVSS vectors
3Timeline events
0ADP providers
5Source links
CVSS vector scores
1 official score
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.