VYPR
Unrated severityNVD Advisory· Published Jun 23, 2026· Updated Jun 23, 2026

CVE-2026-57053

CVE-2026-57053

Description

GNU libidn before 1.44 is prone to out-of-bounds reads of uninitialized memory in the ToUnicode APIs because of mishandling in idna_to_unicode_internal. The affected code is not present in libidn2.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

Affected products

1

Patches

Vulnerability mechanics

Root cause

"The round-trip verification in idna_to_unicode_internal assumes the ToASCII output always starts with the ACE prefix 'xn--', so it compares the original label against tmpout + 4; when the decoded label is short ASCII this offset lands in uninitialized stack memory."

Attack vector

An attacker supplies a crafted domain name to an application that normalizes input using the Libidn ToUnicode API (e.g. `idna_to_unicode_8z8z()`). The attacker includes a label such as `xn--com-` that decodes to a short ASCII string like `com`. Because `tmpout + 4` points into the uninitialized tail of the stack buffer, the round-trip comparison may match on stale stack bytes, causing the invalid ACE label to be silently normalized to `com`, `net`, `www`, etc. [CWE-457]. The effect can also carry across separate API calls if earlier labels leave matching bytes on the stack. The victim application may then use the incorrectly normalized hostname for allowlists, blocklists, routing, or logging decisions.

Affected code

The bug resides in `idna_to_unicode_internal()` in `lib/idna.c`. The function decodes a Punycode label, calls `idna_to_ascii_4i()` into a local stack buffer `tmpout[64]`, then compares the original label against `tmpout + strlen(IDNA_ACE_PREFIX)` assuming the ToASCII result always begins with `xn--`. When the decoded label is pure ASCII, the ToASCII routine leaves it unchanged, so a short ASCII label (fewer than 4 characters) causes the comparison to read stale stack bytes past the initialized string.

What the fix does

The patch [patch_id=7163099] implements the fix suggested in the initial report [ref_id=1]. It adds a check that the ToASCII result actually begins with the ACE prefix before comparing the suffix: if `tmpout` does not start with `xn--`, the function returns `IDNA_ROUNDTRIP_VERIFY_ERROR` immediately. This prevents reading past the initialized portion of `tmpout` when the decoded label is all ASCII and therefore unchanged by ToASCII. The advisory [ref_id=2] recommends upgrading to libidn 1.44 or applying the patch.

Preconditions

  • inputApplication calls one of the libidn ToUnicode APIs (e.g. idna_to_unicode_8z8z) to normalize user-supplied domain input.
  • inputAttacker controls a domain string containing an ACE label whose Punycode-decoded form is a short (less than 4 characters) ASCII label.
  • inputThe stack slot used for tmpout must contain stale data that produces a matching comparison. This can be arranged through an earlier label in the same domain or by prior API calls.

Generated on Jun 24, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

2

News mentions

0

No linked articles in our index yet.