CVE-2026-74766: CWE-416 Use After Free
Net::IDN::Punycode versions from 2.301 before 2.590 for Perl allow a heap use-after-free via a decoded code point that reallocates the output buffer in decode_punycode. The XS backend inserts each decoded code point into the string buffer of the scalar it returns. decode_punycode computes the insertion pointer first and only then grows the buffer when the code point does not fit. The growth reallocates the buffer and updates every pointer except the insertion pointer, so the move that follows and the write of the code point go through a freed pointer. The buffer starts at twice the label length, and a code point above U+FFFF takes four bytes in the output, so a label of such code points outgrows it and forces the reallocation. Version 2.301, the fix for CVE-2016-15059, introduced the defect. Only the XS backend is affected. Decoding an attacker-supplied punycode label reads and writes freed heap memory.
AI Analysis
Technical Summary
The vulnerability in Net::IDN::Punycode (CVE-2026-74766) is a heap use-after-free in the XS backend's decode_punycode function. The function calculates the insertion pointer before growing the output buffer, which reallocates memory and invalidates the insertion pointer. Subsequent writes use this stale pointer, leading to use-after-free conditions. This flaw was introduced in version 2.301 and persists in all versions before 2.590. The issue arises when decoding punycode labels containing code points above U+FFFF, which require more bytes than initially allocated, triggering buffer reallocation.
Potential Impact
An attacker can cause the application to read from and write to freed heap memory by supplying a malicious punycode label. This can lead to memory corruption, potentially causing crashes or undefined behavior. The exact impact depends on how the affected library is used, but use-after-free vulnerabilities can be leveraged for denial of service or potentially arbitrary code execution in some contexts.
Mitigation Recommendations
Users should upgrade Net::IDN::Punycode to version 2.590 or later where this vulnerability is fixed. No vendor advisory is provided in the input, but the affected version range indicates that versions before 2.590 are vulnerable and presumably fixed in 2.590. Until upgrading, avoid processing untrusted punycode labels with the XS backend. Patch status is not explicitly confirmed by a vendor advisory; check the official Net::IDN::Punycode release notes or CPAN for confirmation and updates.
CVE-2026-74766: CWE-416 Use After Free
Description
Net::IDN::Punycode versions from 2.301 before 2.590 for Perl allow a heap use-after-free via a decoded code point that reallocates the output buffer in decode_punycode. The XS backend inserts each decoded code point into the string buffer of the scalar it returns. decode_punycode computes the insertion pointer first and only then grows the buffer when the code point does not fit. The growth reallocates the buffer and updates every pointer except the insertion pointer, so the move that follows and the write of the code point go through a freed pointer. The buffer starts at twice the label length, and a code point above U+FFFF takes four bytes in the output, so a label of such code points outgrows it and forces the reallocation. Version 2.301, the fix for CVE-2016-15059, introduced the defect. Only the XS backend is affected. Decoding an attacker-supplied punycode label reads and writes freed heap memory.
CVSS v3.1
Score 8.4high
Affected software
pkg:github/Net-IDN-EncodeRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability in Net::IDN::Punycode (CVE-2026-74766) is a heap use-after-free in the XS backend's decode_punycode function. The function calculates the insertion pointer before growing the output buffer, which reallocates memory and invalidates the insertion pointer. Subsequent writes use this stale pointer, leading to use-after-free conditions. This flaw was introduced in version 2.301 and persists in all versions before 2.590. The issue arises when decoding punycode labels containing code points above U+FFFF, which require more bytes than initially allocated, triggering buffer reallocation.
Potential Impact
An attacker can cause the application to read from and write to freed heap memory by supplying a malicious punycode label. This can lead to memory corruption, potentially causing crashes or undefined behavior. The exact impact depends on how the affected library is used, but use-after-free vulnerabilities can be leveraged for denial of service or potentially arbitrary code execution in some contexts.
Mitigation Recommendations
Users should upgrade Net::IDN::Punycode to version 2.590 or later where this vulnerability is fixed. No vendor advisory is provided in the input, but the affected version range indicates that versions before 2.590 are vulnerable and presumably fixed in 2.590. Until upgrading, avoid processing untrusted punycode labels with the XS backend. Patch status is not explicitly confirmed by a vendor advisory; check the official Net::IDN::Punycode release notes or CPAN for confirmation and updates.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- CPANSec
- Date Reserved
- 2026-08-15T21:52:57.406Z
- State
- PUBLISHED
Threat ID: 6ab22f39f7a7c54106d716ab
Added to database: 09/22/2026, 07:33:13 UTC
Last enriched: 09/22/2026, 07:48:03 UTC
Last updated: 09/22/2026, 15:46:26 UTC
Views: 13
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.