Skip to content
Heist/ feed
Back to feed
Medium

Out-of-bounds read and write in BLE L2CAP module

Type: advisorySources: OSV

Contiki-NG is an open-source, cross-platform operating system for Next-Generation IoT devices. Versions prior to 4.9 are vulnerable to an Out-of-bounds read. While processing the L2CAP protocol, the Bluetooth Low Energy stack of Contiki-NG needs to map an incoming channel ID to its metadata structure. While looking up the corresponding channel structure in get_channel_for_cid (in os/net/mac/ble/ble-l2cap.c), a bounds check is performed on the incoming channel ID, which is meant to ensure that the channel ID does not exceed the maximum number of supported channels.However, an integer truncation issue leads to only the lowest byte of the channel ID to be checked, which leads to an incomplete out-of-bounds check. A crafted channel ID leads to out-of-bounds memory to be read and written with attacker-controlled data. The vulnerability has been patched in the "develop" branch of Contiki-NG, and will be included in release 4.9. As a workaround, Users can apply the patch in Contiki-NG pull request 2081 on GitHub.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2022-41873
Confirmed fixed CVEs
Not specified
Updated in this feed
2 Nov 2026, 19:59 UTC · Revision 1

Source evidence

Out-of-bounds read and write in BLE L2CAP module

core-osv · Original source

Published 11 Nov 2022, 00:00 UTC

Contiki-NG is an open-source, cross-platform operating system for Next-Generation IoT devices. Versions prior to 4.9 are vulnerable to an Out-of-bounds read. While processing the L2CAP protocol, the Bluetooth Low Energy stack of Contiki-NG needs to map an incoming channel ID to its metadata structure. While looking up the corresponding channel structure in get_channel_for_cid (in os/net/mac/ble/ble-l2cap.c), a bounds check is performed on the incoming channel ID, which is meant to ensure that the channel ID does not exceed the maximum number of supported channels.However, an integer truncation issue leads to only the lowest byte of the channel ID to be checked, which leads to an incomplete out-of-bounds check. A crafted channel ID leads to out-of-bounds memory to be read and written with attacker-controlled data. The vulnerability has been patched in the "develop" branch of Contiki-NG, and will be included in release 4.9. As a workaround, Users can apply the patch in Contiki-NG pull request 2081 on GitHub.

osv:CVE-2022-41873
Complete source record
{
  "id": "c0c912473f46cd2551f98434d2cba7509d02f97e5dc5c30c8b4057a0373e7d87",
  "url": "https://osv.dev/vulnerability/CVE-2022-41873",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Out-of-bounds read and write in BLE L2CAP module",
    "summary": "Contiki-NG is an open-source, cross-platform operating system for Next-Generation IoT devices. Versions prior to 4.9 are vulnerable to an Out-of-bounds read. While processing the L2CAP protocol, the Bluetooth Low Energy stack of Contiki-NG needs to map an incoming channel ID to its metadata structure. While looking up the corresponding channel structure in get_channel_for_cid (in os/net/mac/ble/ble-l2cap.c), a bounds check is performed on the incoming channel ID, which is meant to ensure that the channel ID does not exceed the maximum number of supported channels.However, an integer truncation issue leads to only the lowest byte of the channel ID to be checked, which leads to an incomplete out-of-bounds check. A crafted channel ID leads to out-of-bounds memory to be read and written with attacker-controlled data. The vulnerability has been patched in the \"develop\" branch of Contiki-NG, and will be included in release 4.9. As a workaround, Users can apply the patch in Contiki-NG pull request 2081 on GitHub.",
    "evidence": "osv:CVE-2022-41873",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2022-41873",
      "aliases": [
        "CVE-2022-41873",
        "GHSA-m5cj-fw8m-ffgf"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:A/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/contiki-ng/contiki-ng",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "c20b12cd2db707d6c07918f8b26cfeb52cf298ca"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "4.9"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StringRangeExpression"
                  }
                ]
              }
            }
          ],
          "versions": [
            "release/v4.8",
            "release/v4.7",
            "release/v4.6",
            "release/v4.5",
            "release/v4.4",
            "release/v4.3",
            "release/v4.2",
            "release/v4.1",
            "release/v4.0",
            "develop/v4.0",
            "fork",
            "develop/v3.x-fork",
            "old/v2.6",
            "2.6-rc0",
            "2.6",
            "2.5-release",
            "old/v2.4",
            "2.4",
            "old/v2.3",
            "2.3",
            "old/v2.2.3",
            "2.2.3",
            "old/v2.2.2",
            "2.2.2",
            "old/v2.2.1",
            "2.2.1",
            "old/v2.2",
            "2.2",
            "old/v2.1",
            "2.1",
            "old/v2.0",
            "2.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-41873.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:23.169323755Z",
      "provider": "osv",
      "references": [
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/41xxx/CVE-2022-41873.json",
        "https://github.com/contiki-ng/contiki-ng/security/advisories/GHSA-m5cj-fw8m-ffgf",
        "https://nvd.nist.gov/vuln/detail/CVE-2022-41873",
        "https://github.com/contiki-ng/contiki-ng/pull/2081"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-125",
          "CWE-787"
        ],
        "cna_assigner": "GitHub_M",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/41xxx/CVE-2022-41873.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2022-41873",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 489520,
  "published_at": "2022-11-11T00:00:00+00:00"
}