CVE-2022-50156 (GCVE-0-2022-50156)

Vulnerability from cvelistv5 – Published: 2025-06-18 11:03 – Updated: 2026-05-11 19:13
VLAI
Title
HID: cp2112: prevent a buffer overflow in cp2112_xfer()
Summary
In the Linux kernel, the following vulnerability has been resolved: HID: cp2112: prevent a buffer overflow in cp2112_xfer() Smatch warnings: drivers/hid/hid-cp2112.c:793 cp2112_xfer() error: __memcpy() 'data->block[1]' too small (33 vs 255) drivers/hid/hid-cp2112.c:793 cp2112_xfer() error: __memcpy() 'buf' too small (64 vs 255) The 'read_length' variable is provided by 'data->block[0]' which comes from user and it(read_length) can take a value between 0-255. Add an upper bound to 'read_length' variable to prevent a buffer overflow in memcpy().
Severity
No CVSS data available.
Assigner
Impacted products
Vendor Product Version
Linux Linux Affected: 542134c0375b5ca2b1d18490c02b8a20bfdd8d74 , < 3af7d60e9a6c17d6d41c4341f8020511887d372d (git)
Affected: 542134c0375b5ca2b1d18490c02b8a20bfdd8d74 , < 519ff31a6ddd87aa4905bd9bf3b92e8b88801614 (git)
Affected: 542134c0375b5ca2b1d18490c02b8a20bfdd8d74 , < ebda3d6b004bb6127a66a616524a2de152302ca7 (git)
Affected: 542134c0375b5ca2b1d18490c02b8a20bfdd8d74 , < 8489a20ac481b08c0391608d81ed3796d373cfdf (git)
Affected: 542134c0375b5ca2b1d18490c02b8a20bfdd8d74 , < e7028944e61014ae915e7fb74963d3835f2f761a (git)
Affected: 542134c0375b5ca2b1d18490c02b8a20bfdd8d74 , < 26e427ac85c2b8d0d108cc80b6de34d33e2780c4 (git)
Affected: 542134c0375b5ca2b1d18490c02b8a20bfdd8d74 , < 381583845d19cb4bd21c8193449385f3fefa9caf (git)
Create a notification for this product.
Linux Linux Affected: 4.15
Unaffected: 0 , < 4.15 (semver)
Unaffected: 4.19.256 , ≤ 4.19.* (semver)
Unaffected: 5.4.211 , ≤ 5.4.* (semver)
Unaffected: 5.10.137 , ≤ 5.10.* (semver)
Unaffected: 5.15.61 , ≤ 5.15.* (semver)
Unaffected: 5.18.18 , ≤ 5.18.* (semver)
Unaffected: 5.19.2 , ≤ 5.19.* (semver)
Unaffected: 6.0 , ≤ * (original_commit_for_fix)
Create a notification for this product.
Show details on NVD website

{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "drivers/hid/hid-cp2112.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "3af7d60e9a6c17d6d41c4341f8020511887d372d",
              "status": "affected",
              "version": "542134c0375b5ca2b1d18490c02b8a20bfdd8d74",
              "versionType": "git"
            },
            {
              "lessThan": "519ff31a6ddd87aa4905bd9bf3b92e8b88801614",
              "status": "affected",
              "version": "542134c0375b5ca2b1d18490c02b8a20bfdd8d74",
              "versionType": "git"
            },
            {
              "lessThan": "ebda3d6b004bb6127a66a616524a2de152302ca7",
              "status": "affected",
              "version": "542134c0375b5ca2b1d18490c02b8a20bfdd8d74",
              "versionType": "git"
            },
            {
              "lessThan": "8489a20ac481b08c0391608d81ed3796d373cfdf",
              "status": "affected",
              "version": "542134c0375b5ca2b1d18490c02b8a20bfdd8d74",
              "versionType": "git"
            },
            {
              "lessThan": "e7028944e61014ae915e7fb74963d3835f2f761a",
              "status": "affected",
              "version": "542134c0375b5ca2b1d18490c02b8a20bfdd8d74",
              "versionType": "git"
            },
            {
              "lessThan": "26e427ac85c2b8d0d108cc80b6de34d33e2780c4",
              "status": "affected",
              "version": "542134c0375b5ca2b1d18490c02b8a20bfdd8d74",
              "versionType": "git"
            },
            {
              "lessThan": "381583845d19cb4bd21c8193449385f3fefa9caf",
              "status": "affected",
              "version": "542134c0375b5ca2b1d18490c02b8a20bfdd8d74",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "drivers/hid/hid-cp2112.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "4.15"
            },
            {
              "lessThan": "4.15",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "4.19.*",
              "status": "unaffected",
              "version": "4.19.256",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.4.*",
              "status": "unaffected",
              "version": "5.4.211",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.10.*",
              "status": "unaffected",
              "version": "5.10.137",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.15.*",
              "status": "unaffected",
              "version": "5.15.61",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.18.*",
              "status": "unaffected",
              "version": "5.18.18",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.19.*",
              "status": "unaffected",
              "version": "5.19.2",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.0",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "4.19.256",
                  "versionStartIncluding": "4.15",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.4.211",
                  "versionStartIncluding": "4.15",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.10.137",
                  "versionStartIncluding": "4.15",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.15.61",
                  "versionStartIncluding": "4.15",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.18.18",
                  "versionStartIncluding": "4.15",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.19.2",
                  "versionStartIncluding": "4.15",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.0",
                  "versionStartIncluding": "4.15",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nHID: cp2112: prevent a buffer overflow in cp2112_xfer()\n\nSmatch warnings:\ndrivers/hid/hid-cp2112.c:793 cp2112_xfer() error: __memcpy()\n\u0027data-\u003eblock[1]\u0027 too small (33 vs 255)\ndrivers/hid/hid-cp2112.c:793 cp2112_xfer() error: __memcpy() \u0027buf\u0027 too\nsmall (64 vs 255)\n\nThe \u0027read_length\u0027 variable is provided by \u0027data-\u003eblock[0]\u0027 which comes\nfrom user and it(read_length) can take a value between 0-255. Add an\nupper bound to \u0027read_length\u0027 variable to prevent a buffer overflow in\nmemcpy()."
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-05-11T19:13:53.452Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/3af7d60e9a6c17d6d41c4341f8020511887d372d"
        },
        {
          "url": "https://git.kernel.org/stable/c/519ff31a6ddd87aa4905bd9bf3b92e8b88801614"
        },
        {
          "url": "https://git.kernel.org/stable/c/ebda3d6b004bb6127a66a616524a2de152302ca7"
        },
        {
          "url": "https://git.kernel.org/stable/c/8489a20ac481b08c0391608d81ed3796d373cfdf"
        },
        {
          "url": "https://git.kernel.org/stable/c/e7028944e61014ae915e7fb74963d3835f2f761a"
        },
        {
          "url": "https://git.kernel.org/stable/c/26e427ac85c2b8d0d108cc80b6de34d33e2780c4"
        },
        {
          "url": "https://git.kernel.org/stable/c/381583845d19cb4bd21c8193449385f3fefa9caf"
        }
      ],
      "title": "HID: cp2112: prevent a buffer overflow in cp2112_xfer()",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2022-50156",
    "datePublished": "2025-06-18T11:03:13.913Z",
    "dateReserved": "2025-06-18T10:57:27.425Z",
    "dateUpdated": "2026-05-11T19:13:53.452Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "vulnerability-lookup:meta": {
    "epss": {
      "cve": "CVE-2022-50156",
      "date": "2026-05-25",
      "epss": "0.00064",
      "percentile": "0.19875"
    },
    "nvd": "{\"cve\":{\"id\":\"CVE-2022-50156\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2025-06-18T11:15:45.747\",\"lastModified\":\"2025-11-25T15:21:57.797\",\"vulnStatus\":\"Analyzed\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nHID: cp2112: prevent a buffer overflow in cp2112_xfer()\\n\\nSmatch warnings:\\ndrivers/hid/hid-cp2112.c:793 cp2112_xfer() error: __memcpy()\\n\u0027data-\u003eblock[1]\u0027 too small (33 vs 255)\\ndrivers/hid/hid-cp2112.c:793 cp2112_xfer() error: __memcpy() \u0027buf\u0027 too\\nsmall (64 vs 255)\\n\\nThe \u0027read_length\u0027 variable is provided by \u0027data-\u003eblock[0]\u0027 which comes\\nfrom user and it(read_length) can take a value between 0-255. Add an\\nupper bound to \u0027read_length\u0027 variable to prevent a buffer overflow in\\nmemcpy().\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: HID: cp2112: evitar un desbordamiento de b\u00fafer en cp2112_xfer() Advertencias de Smatch: drivers/hid/hid-cp2112.c:793 Error de cp2112_xfer(): __memcpy() \u0027data-\u0026gt;block[1]\u0027 demasiado peque\u00f1o (33 frente a 255) drivers/hid/hid-cp2112.c:793 Error de cp2112_xfer(): __memcpy() \u0027buf\u0027 demasiado peque\u00f1o (64 frente a 255) La variable \u0027read_length\u0027 la proporciona \u0027data-\u0026gt;block[0]\u0027, que proviene del usuario, y puede tomar un valor entre 0 y 255. A\u00f1ada un l\u00edmite superior a la variable \u0027read_length\u0027 para evitar un desbordamiento de b\u00fafer en memcpy().\"}],\"metrics\":{\"cvssMetricV31\":[{\"source\":\"nvd@nist.gov\",\"type\":\"Primary\",\"cvssData\":{\"version\":\"3.1\",\"vectorString\":\"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H\",\"baseScore\":7.8,\"baseSeverity\":\"HIGH\",\"attackVector\":\"LOCAL\",\"attackComplexity\":\"LOW\",\"privilegesRequired\":\"LOW\",\"userInteraction\":\"NONE\",\"scope\":\"UNCHANGED\",\"confidentialityImpact\":\"HIGH\",\"integrityImpact\":\"HIGH\",\"availabilityImpact\":\"HIGH\"},\"exploitabilityScore\":1.8,\"impactScore\":5.9}]},\"weaknesses\":[{\"source\":\"nvd@nist.gov\",\"type\":\"Primary\",\"description\":[{\"lang\":\"en\",\"value\":\"CWE-787\"}]}],\"configurations\":[{\"nodes\":[{\"operator\":\"OR\",\"negate\":false,\"cpeMatch\":[{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"4.15.1\",\"versionEndExcluding\":\"4.19.256\",\"matchCriteriaId\":\"3DEB3209-65EF-4ABE-99F9-60C53FF4046D\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"4.20\",\"versionEndExcluding\":\"5.4.211\",\"matchCriteriaId\":\"B1C63D19-C08C-4308-A848-B2523C9275BD\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"5.5\",\"versionEndExcluding\":\"5.10.137\",\"matchCriteriaId\":\"C2BF720F-C5EE-4DE2-9BDF-CE4CFBC767F4\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"5.11\",\"versionEndExcluding\":\"5.15.61\",\"matchCriteriaId\":\"51861563-7F40-460F-82CD-2D3FBDAD6618\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"5.16\",\"versionEndExcluding\":\"5.18.18\",\"matchCriteriaId\":\"5B42E453-8837-49D0-A5EF-03F818A6DC11\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"5.19\",\"versionEndExcluding\":\"5.19.2\",\"matchCriteriaId\":\"A1A2A5A5-4598-4D7E-BA07-4660398D6C8F\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:4.15:-:*:*:*:*:*:*\",\"matchCriteriaId\":\"3B4D39AF-668B-442B-8085-639A6D4FA5AC\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:4.15:rc6:*:*:*:*:*:*\",\"matchCriteriaId\":\"639D2465-65E0-40E2-B7A8-BEA9E221DE54\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:4.15:rc7:*:*:*:*:*:*\",\"matchCriteriaId\":\"A282AD0B-2D63-4F05-8F89-109A0975B423\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:4.15:rc8:*:*:*:*:*:*\",\"matchCriteriaId\":\"30358221-183C-4699-994E-AF51F5D534FC\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:4.15:rc9:*:*:*:*:*:*\",\"matchCriteriaId\":\"A5ED80A8-E656-4AE9-921B-C22402C94A4C\"}]}]}],\"references\":[{\"url\":\"https://git.kernel.org/stable/c/26e427ac85c2b8d0d108cc80b6de34d33e2780c4\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/381583845d19cb4bd21c8193449385f3fefa9caf\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/3af7d60e9a6c17d6d41c4341f8020511887d372d\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/519ff31a6ddd87aa4905bd9bf3b92e8b88801614\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/8489a20ac481b08c0391608d81ed3796d373cfdf\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/e7028944e61014ae915e7fb74963d3835f2f761a\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/ebda3d6b004bb6127a66a616524a2de152302ca7\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]}]}}"
  }
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…
Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.


Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…