Skip to content
Heist/ feed
Back to feed
Critical

Socket versions before 2.041 for Perl have an out-of-bounds heap read

Type: advisorySources: OSV

Socket versions before 2.041 for Perl have an out-of-bounds heap read. In Socket.xs, pack_ip_mreq_source() checks the length of its source argument before the argument is read, so the check tests the byte length carried over from the preceding multiaddr argument instead. Both addresses occupy a 4-byte field, so a valid multiaddr lets a source of any length pass the check, and the source is then copied into the 4-byte imr_sourceaddr field with a fixed-size copy. A source shorter than 4 bytes is not rejected, and the copy reads up to 3 bytes past the end of its buffer. Calling pack_ip_mreq_source() with a source value shorter than 4 bytes copies adjacent heap memory into the returned packed structure.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2026-12087
Confirmed fixed CVEs
Not specified
Updated in this feed
4 Nov 2026, 22:55 UTC · Revision 1

Source evidence

Socket versions before 2.041 for Perl have an out-of-bounds heap read

core-osv · Original source

Published 15 Jun 2026, 21:11 UTC

Socket versions before 2.041 for Perl have an out-of-bounds heap read. In Socket.xs, pack_ip_mreq_source() checks the length of its source argument before the argument is read, so the check tests the byte length carried over from the preceding multiaddr argument instead. Both addresses occupy a 4-byte field, so a valid multiaddr lets a source of any length pass the check, and the source is then copied into the 4-byte imr_sourceaddr field with a fixed-size copy. A source shorter than 4 bytes is not rejected, and the copy reads up to 3 bytes past the end of its buffer. Calling pack_ip_mreq_source() with a source value shorter than 4 bytes copies adjacent heap memory into the returned packed structure.

osv:CVE-2026-12087
Complete source record
{
  "id": "a537807cfb795f183a90c7943ed732e539b4c03596dccc0ee8c927ff7578eb3d",
  "url": "https://osv.dev/vulnerability/CVE-2026-12087",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Socket versions before 2.041 for Perl have an out-of-bounds heap read",
    "summary": "Socket versions before 2.041 for Perl have an out-of-bounds heap read. In Socket.xs, pack_ip_mreq_source() checks the length of its source argument before the argument is read, so the check tests the byte length carried over from the preceding multiaddr argument instead. Both addresses occupy a 4-byte field, so a valid multiaddr lets a source of any length pass the check, and the source is then copied into the 4-byte imr_sourceaddr field with a fixed-size copy. A source shorter than 4 bytes is not rejected, and the copy reads up to 3 bytes past the end of its buffer. Calling pack_ip_mreq_source() with a source value shorter than 4 bytes copies adjacent heap memory into the returned packed structure.",
    "evidence": "osv:CVE-2026-12087",
    "products": [],
    "severity": "critical",
    "structured": {
      "id": "CVE-2026-12087",
      "aliases": [
        "CVE-2026-12087"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/perl/perl5",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "de19a0b0ad1900fef976c5c1400bd8f11ec6c6cb"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "range": [
                      {
                        "fixed": "de19a0b0ad1900fef976c5c1400bd8f11ec6c6cb"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v5.43.10",
            "v5.43.9",
            "v5.43.8",
            "v5.42.0",
            "v5.43.6",
            "v5.43.2",
            "v5.43.1",
            "v5.43.0",
            "v5.42.0-RC3",
            "v5.42.0-RC2",
            "v5.42.0-RC1",
            "v5.41.13",
            "v5.41.12",
            "v5.41.11",
            "v5.41.10",
            "v5.41.9",
            "v5.41.8",
            "v5.41.7",
            "v5.41.5",
            "v5.41.4",
            "v5.41.3",
            "v5.40.0",
            "v5.41.2",
            "v5.41.1",
            "v5.41.0",
            "v5.40.0-RC2",
            "v5.40.0-RC1",
            "v5.39.8",
            "v5.39.7",
            "v5.39.5",
            "v5.39.4",
            "v5.38.0",
            "v5.39.3",
            "v5.39.1",
            "v5.39.0",
            "v5.38.0-RC2",
            "v5.38.0-RC1",
            "v5.37.11",
            "v5.37.10",
            "v5.37.9",
            "v5.37.7",
            "v5.37.6",
            "v5.37.5",
            "v5.37.4",
            "v5.37.3",
            "v5.37.2",
            "v5.37.1",
            "v5.36.0",
            "v5.37.0",
            "v5.36.0-RC3",
            "v5.35.11",
            "v5.35.10",
            "v5.34.0",
            "v5.35.9",
            "v5.35.8",
            "v5.35.6",
            "v5.35.5",
            "v5.35.3",
            "v5.35.0",
            "v5.34.0-RC2",
            "v5.34.0-RC1",
            "v5.33.9",
            "v5.33.8",
            "v5.33.7",
            "v5.32.0",
            "v5.33.4",
            "v5.33.3",
            "v5.33.2",
            "v5.33.1",
            "v5.33.0",
            "v5.32.0-RC1",
            "v5.31.11",
            "v5.31.7",
            "v5.31.5",
            "v5.30.0",
            "v5.31.4",
            "v5.31.3",
            "v5.31.2",
            "v5.31.1",
            "v5.31.0",
            "v5.30.0-RC2",
            "v5.30.0-RC1",
            "v5.29.10",
            "v5.29.9",
            "v5.29.8",
            "v5.29.7",
            "v5.29.6",
            "v5.29.5",
            "v5.28.0",
            "v5.29.1",
            "v5.29.0",
            "v5.28.0-RC4",
            "v5.28.0-RC3",
            "v5.28.0-RC2",
            "v5.28.0-RC1",
            "v5.27.11",
            "v5.27.10",
            "v5.27.8",
            "v5.27.7",
            "v5.27.6",
            "v5.27.5",
            "v5.27.3",
            "v5.26.0",
            "v5.27.0",
            "v5.26.0-RC2",
            "v5.25.11",
            "v5.25.9",
            "v5.25.7",
            "v5.25.5",
            "v5.25.4",
            "v5.25.3",
            "v5.24.0",
            "v5.25.2",
            "v5.25.0",
            "v5.24.0-RC5",
            "v5.24.0-RC4",
            "v5.24.0-RC3",
            "v5.24.0-RC2",
            "v5.24.0-RC1",
            "v5.23.7",
            "v5.23.6",
            "v5.23.4",
            "v5.23.3",
            "if-0.0605",
            "v5.23.2",
            "v5.23.1",
            "v5.23.0",
            "v5.22.0",
            "v5.22.0-RC2",
            "v5.22.0-RC1",
            "v5.21.11",
            "if-0.0604",
            "v5.21.10",
            "v5.21.9",
            "v5.21.8",
            "v5.21.6",
            "v5.21.5",
            "v5.21.4",
            "v5.21.1",
            "v5.21.0",
            "v5.20.0",
            "v5.20.0-RC1",
            "v5.19.11",
            "v5.19.7",
            "v5.19.5",
            "v5.19.3",
            "v5.19.2",
            "if-0.0603",
            "v5.19.1",
            "v5.18.0",
            "v5.19.0",
            "v5.18.0-RC4",
            "v5.18.0-RC3",
            "v5.18.0-RC2",
            "v5.18.0-RC1",
            "v5.17.9",
            "v5.17.8",
            "v5.17.7.0",
            "v5.17.7",
            "v5.17.6",
            "v5.17.4",
            "v5.17.2",
            "v5.17.0",
            "v5.16.0",
            "v5.16.0-RC2",
            "v5.16.0-RC1",
            "v5.15.9",
            "v5.15.5",
            "v5.15.4",
            "v5.15.3",
            "v5.15.2",
            "v5.15.1",
            "v5.15.0",
            "v5.14.0",
            "v5.14.0-RC3",
            "v5.14.0-RC2",
            "v5.14.0-RC1",
            "v5.13.11",
            "v5.13.10",
            "v5.13.9",
            "v5.13.8",
            "v5.13.7",
            "v5.13.6",
            "v5.13.5",
            "v5.13.4",
            "v5.13.3",
            "v5.13.2",
            "v5.13.1",
            "v5.12.0",
            "v5.13.0",
            "v5.12.0-RC5",
            "v5.12.0-RC4",
            "v5.12.0-RC3",
            "v5.12.0-RC2",
            "v5.12.0-RC1",
            "v5.12.0-RC0",
            "v5.11.5",
            "v5.11.4",
            "v5.11.3",
            "v5.11.1",
            "v5.11.0",
            "GitLive-blead",
            "v5.10.0",
            "perl-5.9.5",
            "perl-5.9.4",
            "perl-5.9.3",
            "perl-5.9.2",
            "perl-5.9.1",
            "perl-5.9.0",
            "perl-5.8.0",
            "perl-5.7.3",
            "perl-5.7.2",
            "perl-5.7.1",
            "perl-5.7.0",
            "perl-5.6.0",
            "perl-5.005",
            "perl-5.003",
            "perl-5.002_01",
            "perl-5.002",
            "perl-5.001n",
            "perl-5.001",
            "perl-5.000o",
            "perl-5.000",
            "perl-5a9",
            "perl-5a2",
            "perl-4.0.36",
            "perl-4.0.00",
            "perl-3.044",
            "perl-3.000",
            "perl-2.0",
            "perl-1.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-12087.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:40.138587272Z",
      "provider": "osv",
      "references": [
        "https://cpan.org/modules",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/12xxx/CVE-2026-12087.json",
        "https://metacpan.org/release/PEVANS/Socket-2.041/changes",
        "https://nvd.nist.gov/vuln/detail/CVE-2026-12087",
        "https://github.com/Perl/perl5/commit/de19a0b0ad1900fef976c5c1400bd8f11ec6c6cb.patch"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-125",
          "CWE-805"
        ],
        "cna_assigner": "CPANSec",
        "unresolved_ranges": [
          {
            "extracted_events": [
              {
                "range": [
                  {
                    "fixed": "2.041"
                  }
                ],
                "source": "AFFECTED_FIELD",
                "strategy": "StandardRange"
              }
            ]
          },
          {
            "extracted_events": [
              {
                "range": [
                  {
                    "fixed": "2.041"
                  },
                  {
                    "last_affected": "3"
                  }
                ],
                "source": "DESCRIPTION"
              }
            ]
          }
        ],
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/12xxx/CVE-2026-12087.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-12087",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 507765,
  "published_at": "2026-06-15T21:11:09.876+00:00"
}