# CVE-2026-12087: Socket versions before 2.041 for Perl have an out-of-bounds heap read

> An out-of-bounds heap read in the Perl Socket library allows attackers to disclose adjacent memory contents by providing a short source address.

- **Severity:** Critical 9.1 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 15 Jun 2026
- **Updated:** 16 Jun 2026
- **Also known as:** AZL-90156, DEBIAN-CVE-2026-12087, ECHO-31e4-d78e-2b62, GHSA-q5cv-5vf6-95gp, MGASA-2026-0251, OESA-2026-2843, OESA-2026-2844, OESA-2026-2845, OESA-2026-2846, RHSA-2026:11342, ROOT-OS-DEBIAN-11-CVE-2026-12087, UBUNTU-CVE-2026-12087

## What is CVE-2026-12087?

CVE-2026-12087 is a critical memory corruption vulnerability in PEVANS Socket, published on 15 Jun 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

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.

Weakness: CWE-805 (Buffer Access with Incorrect Length Value), CWE-125 (Out-of-bounds Read)

## Which versions are affected by CVE-2026-12087?


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `perl-Socket` | Red Hat:hummingbird:1 | All versions | 0:2.041-1.hum1 |
| `perl-Socket-tests` | Red Hat:hummingbird:1 | All versions | 0:2.041-1.hum1 |

## How do I fix CVE-2026-12087?

Upgrade to a fixed version.

## Is CVE-2026-12087 being exploited?

There is no known exploitation of CVE-2026-12087 in the wild and no public exploit code.

Public exploit code:

- Patch: Heap overflow in SSL-VPN (Fortinet FortiOS) (github_poc): https://github.com/gduma-phData/patch-CVE-2026-12087

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-12087 and fix it if it is affected.

What it is: CVE-2026-12087 is a critical memory corruption vulnerability in PEVANS Socket, published on 15 Jun 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-12087 in the wild and no public exploit code.

Affected product: PEVANS Socket. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-12087/ (Markdown: https://insights.sbomify.com/CVE-2026-12087/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-12087
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-12087
- OSV: https://osv.dev/vulnerability/CVE-2026-12087

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-12087/
Summaries are generated and may contain mistakes; the official description above is the record.
