Search
Find a vulnerability
Search criteria
2 vulnerabilities found for idna by benoitc
CVE-2026-117678 (GCVE-0-2026-117678)
Vulnerability from nvd – Published: 2026-11-19 05:36 – Updated: 2026-11-19 14:54
VLAI
EPSS
VEX
Title
idna: punycode labels are decoded before the 63-octet length check, so a long xn-- label causes super-linear CPU use
Summary
Inefficient Algorithmic Complexity vulnerability in benoitc idna allows an attacker who controls a hostname passed to the library to exhaust CPU via an over-long xn-- label. idna:ulabel/1 in src/idna.erl hands every ASCII label that starts with xn-- to punycode:decode/1 without applying check_label_length/1, the 63-octet DNS label limit. punycode:decode/1 in src/punycode.erl builds its output with list appends in insert/4, so its cost grows super-linearly with the label length. A label of a few kilobytes keeps a scheduler busy for seconds to minutes before the label is rejected as invalid punycode.
Every decode entry point reaches this path: decode/1, decode/2, to_unicode/1 and from_ascii/1. The encode path reaches it as well, because alabel/1 calls ulabel/1 on an ASCII xn-- label before its own length check, so encode/1, encode/2 and to_ascii/1 are affected for such input.
This issue affects idna: from 0.5.0 before 8.0.0.
Severity
SSVC
Exploitation: none
Automatable: no
Technical Impact: partial
CISA Coordinator · CISA-ADP (v2.0.3)
Decision recorded 2026-11-19 14:54 UTC
CWE
- CWE-407 - Inefficient Algorithmic Complexity
Assigner
References
6 references
| URL | Tags |
|---|---|
| https://github.com/benoitc/erlang-idna/pull/44 | issue-tracking |
| https://cna.erlef.org/cves/CVE-2026-117678.html | relatedthird-party-advisory |
| https://osv.dev/vulnerability/EEF-CVE-2026-117678 | related |
| https://github.com/benoitc/erlang-idna/pull/45 | patch |
| https://github.com/benoitc/erlang-idna/commit/c8c… | related |
| https://github.com/benoitc/erlang-idna/commit/7a4… | patch |
Impacted products
Date Public
2026-10-25 13:59
{
"containers": {
"adp": [
{
"metrics": [
{
"other": {
"content": {
"id": "CVE-2026-117678",
"options": [
{
"Exploitation": "none"
},
{
"Automatable": "no"
},
{
"Technical Impact": "partial"
}
],
"role": "CISA Coordinator",
"timestamp": "2026-11-19T14:54:46.306784Z",
"version": "2.0.3"
},
"type": "ssvc"
}
}
],
"providerMetadata": {
"dateUpdated": "2026-11-19T14:54:54.820Z",
"orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
"shortName": "CISA-ADP"
},
"title": "CISA ADP Vulnrichment"
}
],
"cna": {
"affected": [
{
"collectionURL": "https://repo.hex.pm",
"cpes": [
"cpe:2.3:a:benoitc:idna:*:*:*:*:*:*:*:*"
],
"defaultStatus": "unaffected",
"modules": [
"idna",
"punycode"
],
"packageName": "idna",
"packageURL": "pkg:hex/idna",
"product": "idna",
"programFiles": [
"src/idna.erl",
"src/punycode.erl"
],
"programRoutines": [
{
"name": "idna:ulabel/1"
},
{
"name": "idna:decode/1"
},
{
"name": "idna:decode/2"
},
{
"name": "idna:to_unicode/1"
},
{
"name": "idna:from_ascii/1"
},
{
"name": "idna:alabel/1"
},
{
"name": "idna:encode/1"
},
{
"name": "idna:encode/2"
},
{
"name": "idna:to_ascii/1"
},
{
"name": "punycode:decode/1"
},
{
"name": "punycode:insert/4"
}
],
"repo": "https://github.com/benoitc/erlang-idna",
"vendor": "benoitc",
"versions": [
{
"lessThan": "8.0.0",
"status": "affected",
"version": "0.5.0",
"versionType": "semver"
}
]
},
{
"collectionURL": "https://github.com",
"cpes": [
"cpe:2.3:a:benoitc:idna:*:*:*:*:*:*:*:*"
],
"defaultStatus": "unaffected",
"modules": [
"idna",
"punycode"
],
"packageName": "benoitc/erlang-idna",
"packageURL": "pkg:github/benoitc/erlang-idna",
"product": "idna",
"programFiles": [
"src/idna.erl",
"src/punycode.erl"
],
"programRoutines": [
{
"name": "idna:ulabel/1"
},
{
"name": "idna:decode/1"
},
{
"name": "idna:decode/2"
},
{
"name": "idna:to_unicode/1"
},
{
"name": "idna:from_ascii/1"
},
{
"name": "idna:alabel/1"
},
{
"name": "idna:encode/1"
},
{
"name": "idna:encode/2"
},
{
"name": "idna:to_ascii/1"
},
{
"name": "punycode:decode/1"
},
{
"name": "punycode:insert/4"
}
],
"repo": "https://github.com/benoitc/erlang-idna",
"vendor": "benoitc",
"versions": [
{
"lessThan": "7a465b630eb793556aa7ac282fb73e49251dadd2",
"status": "affected",
"version": "c8caba6653259071f7076fe49320f37402b8b81f",
"versionType": "git"
}
]
}
],
"cpeApplicability": [
{
"nodes": [
{
"cpeMatch": [
{
"criteria": "cpe:2.3:a:benoitc:idna:*:*:*:*:*:*:*:*",
"versionEndExcluding": "8.0.0",
"versionStartIncluding": "0.5.0",
"vulnerable": true
}
],
"negate": false,
"operator": "OR"
}
],
"operator": "AND"
}
],
"credits": [
{
"lang": "en",
"type": "finder",
"value": "Andrew Moore"
},
{
"lang": "en",
"type": "finder",
"value": "Martin Karrer"
},
{
"lang": "en",
"type": "reporter",
"value": "Andrew Moore"
},
{
"lang": "en",
"type": "coordinator",
"value": "Jonatan M\u00e4nnchen / EEF"
},
{
"lang": "en",
"type": "remediation developer",
"value": "Benoit Chesneau"
},
{
"lang": "en",
"type": "remediation developer",
"value": "Martin Karrer"
}
],
"dateAssigned": "2026-10-30T12:03:25.000Z",
"datePublic": "2026-10-25T13:59:07.000Z",
"descriptions": [
{
"lang": "en",
"supportingMedia": [
{
"base64": false,
"type": "text/html",
"value": "\u003cp\u003eInefficient Algorithmic Complexity vulnerability in benoitc idna allows an attacker who controls a hostname passed to the library to exhaust CPU via an over-long \u003ccode\u003exn--\u003c/code\u003e label. \u003ccode\u003eidna:ulabel/1\u003c/code\u003e in \u003ccode\u003esrc/idna.erl\u003c/code\u003e hands every ASCII label that starts with \u003ccode\u003exn--\u003c/code\u003e to \u003ccode\u003epunycode:decode/1\u003c/code\u003e without applying \u003ccode\u003echeck_label_length/1\u003c/code\u003e, the 63-octet DNS label limit. \u003ccode\u003epunycode:decode/1\u003c/code\u003e in \u003ccode\u003esrc/punycode.erl\u003c/code\u003e builds its output with list appends in \u003ccode\u003einsert/4\u003c/code\u003e, so its cost grows super-linearly with the label length. A label of a few kilobytes keeps a scheduler busy for seconds to minutes before the label is rejected as invalid punycode.\u003c/p\u003e\n\u003cp\u003eEvery decode entry point reaches this path: \u003ccode\u003edecode/1\u003c/code\u003e, \u003ccode\u003edecode/2\u003c/code\u003e, \u003ccode\u003eto_unicode/1\u003c/code\u003e and \u003ccode\u003efrom_ascii/1\u003c/code\u003e. The encode path reaches it as well, because \u003ccode\u003ealabel/1\u003c/code\u003e calls \u003ccode\u003eulabel/1\u003c/code\u003e on an ASCII \u003ccode\u003exn--\u003c/code\u003e label before its own length check, so \u003ccode\u003eencode/1\u003c/code\u003e, \u003ccode\u003eencode/2\u003c/code\u003e and \u003ccode\u003eto_ascii/1\u003c/code\u003e are affected for such input.\u003c/p\u003e\n\u003cp\u003eThis issue affects idna: from 0.5.0 before 8.0.0.\u003c/p\u003e"
},
{
"base64": false,
"type": "text/markdown",
"value": "Inefficient Algorithmic Complexity vulnerability in benoitc idna allows an attacker who controls a hostname passed to the library to exhaust CPU via an over-long `xn--` label. `idna:ulabel/1` in `src/idna.erl` hands every ASCII label that starts with `xn--` to `punycode:decode/1` without applying `check_label_length/1`, the 63-octet DNS label limit. `punycode:decode/1` in `src/punycode.erl` builds its output with list appends in `insert/4`, so its cost grows super-linearly with the label length. A label of a few kilobytes keeps a scheduler busy for seconds to minutes before the label is rejected as invalid punycode.\n\nEvery decode entry point reaches this path: `decode/1`, `decode/2`, `to_unicode/1` and `from_ascii/1`. The encode path reaches it as well, because `alabel/1` calls `ulabel/1` on an ASCII `xn--` label before its own length check, so `encode/1`, `encode/2` and `to_ascii/1` are affected for such input.\n\nThis issue affects idna: from 0.5.0 before 8.0.0."
}
],
"value": "Inefficient Algorithmic Complexity vulnerability in benoitc idna allows an attacker who controls a hostname passed to the library to exhaust CPU via an over-long xn-- label. idna:ulabel/1 in src/idna.erl hands every ASCII label that starts with xn-- to punycode:decode/1 without applying check_label_length/1, the 63-octet DNS label limit. punycode:decode/1 in src/punycode.erl builds its output with list appends in insert/4, so its cost grows super-linearly with the label length. A label of a few kilobytes keeps a scheduler busy for seconds to minutes before the label is rejected as invalid punycode.\n\nEvery decode entry point reaches this path: decode/1, decode/2, to_unicode/1 and from_ascii/1. The encode path reaches it as well, because alabel/1 calls ulabel/1 on an ASCII xn-- label before its own length check, so encode/1, encode/2 and to_ascii/1 are affected for such input.\n\nThis issue affects idna: from 0.5.0 before 8.0.0."
}
],
"impacts": [
{
"capecId": "CAPEC-130",
"descriptions": [
{
"lang": "en",
"supportingMedia": [
{
"base64": false,
"type": "text/html",
"value": "\u003cp\u003eAn attacker who can get an application to decode or encode a hostname they control, for example from a user-supplied URL or a redirect \u003ccode\u003eLocation\u003c/code\u003e header, keeps one scheduler busy per call for seconds to hours depending on the label length. Enough concurrent calls exhaust the CPU of the VM.\u003c/p\u003e"
},
{
"base64": false,
"type": "text/markdown",
"value": "An attacker who can get an application to decode or encode a hostname they control, for example from a user-supplied URL or a redirect `Location` header, keeps one scheduler busy per call for seconds to hours depending on the label length. Enough concurrent calls exhaust the CPU of the VM."
}
],
"value": "An attacker who can get an application to decode or encode a hostname they control, for example from a user-supplied URL or a redirect Location header, keeps one scheduler busy per call for seconds to hours depending on the label length. Enough concurrent calls exhaust the CPU of the VM."
}
]
}
],
"metrics": [
{
"cvssV4_0": {
"Automatable": "NOT_DEFINED",
"Recovery": "NOT_DEFINED",
"Safety": "NOT_DEFINED",
"attackComplexity": "LOW",
"attackRequirements": "NONE",
"attackVector": "LOCAL",
"baseScore": 6.9,
"baseSeverity": "MEDIUM",
"privilegesRequired": "NONE",
"providerUrgency": "NOT_DEFINED",
"subAvailabilityImpact": "NONE",
"subConfidentialityImpact": "NONE",
"subIntegrityImpact": "NONE",
"userInteraction": "NONE",
"valueDensity": "NOT_DEFINED",
"vectorString": "CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N",
"version": "4.0",
"vulnAvailabilityImpact": "HIGH",
"vulnConfidentialityImpact": "NONE",
"vulnIntegrityImpact": "NONE",
"vulnerabilityResponseEffort": "NOT_DEFINED"
},
"format": "CVSS",
"scenarios": [
{
"lang": "en",
"value": "GENERAL"
}
]
}
],
"problemTypes": [
{
"descriptions": [
{
"cweId": "CWE-407",
"description": "CWE-407 Inefficient Algorithmic Complexity",
"lang": "en",
"type": "CWE"
}
]
}
],
"providerMetadata": {
"dateUpdated": "2026-11-19T06:59:47.303Z",
"orgId": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db",
"shortName": "EEF"
},
"references": [
{
"name": "Check label length before Punycode and fix the transform\u0027s complexity",
"tags": [
"issue-tracking"
],
"url": "https://github.com/benoitc/erlang-idna/pull/44"
},
{
"name": "EEF CNA record for CVE-2026-117678",
"tags": [
"related",
"third-party-advisory"
],
"url": "https://cna.erlef.org/cves/CVE-2026-117678.html"
},
{
"name": "OSV record EEF-CVE-2026-117678",
"tags": [
"related"
],
"url": "https://osv.dev/vulnerability/EEF-CVE-2026-117678"
},
{
"name": "Reject over-long labels before Punycode and speed up the transform",
"tags": [
"patch"
],
"url": "https://github.com/benoitc/erlang-idna/pull/45"
},
{
"name": "Introducing commit c8caba6 in benoitc/erlang-idna",
"tags": [
"related"
],
"url": "https://github.com/benoitc/erlang-idna/commit/c8caba6653259071f7076fe49320f37402b8b81f"
},
{
"name": "Fix commit 7a465b6 in benoitc/erlang-idna",
"tags": [
"patch"
],
"url": "https://github.com/benoitc/erlang-idna/commit/7a465b630eb793556aa7ac282fb73e49251dadd2"
}
],
"source": {
"discovery": "EXTERNAL"
},
"title": "idna: punycode labels are decoded before the 63-octet length check, so a long xn-- label causes super-linear CPU use",
"workarounds": [
{
"lang": "en",
"supportingMedia": [
{
"base64": false,
"type": "text/html",
"value": "\u003cp\u003eBefore passing a hostname to idna, reject any domain that contains a label longer than 63 octets. The DNS limits labels to that length, so legitimate names pass unchanged, and the decoder never runs on the crafted label. The check must run before every call that reaches \u003ccode\u003eidna:ulabel/1\u003c/code\u003e, including \u003ccode\u003eencode/1\u003c/code\u003e and \u003ccode\u003eto_ascii/1\u003c/code\u003e, because \u003ccode\u003ealabel/1\u003c/code\u003e decodes an ASCII \u003ccode\u003exn--\u003c/code\u003e label before checking its length.\u003c/p\u003e"
},
{
"base64": false,
"type": "text/markdown",
"value": "Before passing a hostname to idna, reject any domain that contains a label longer than 63 octets. The DNS limits labels to that length, so legitimate names pass unchanged, and the decoder never runs on the crafted label. The check must run before every call that reaches `idna:ulabel/1`, including `encode/1` and `to_ascii/1`, because `alabel/1` decodes an ASCII `xn--` label before checking its length."
}
],
"value": "Before passing a hostname to idna, reject any domain that contains a label longer than 63 octets. The DNS limits labels to that length, so legitimate names pass unchanged, and the decoder never runs on the crafted label. The check must run before every call that reaches idna:ulabel/1, including encode/1 and to_ascii/1, because alabel/1 decodes an ASCII xn-- label before checking its length."
}
],
"x_proofOfConcept": [
{
"lang": "en",
"supportingMedia": [
{
"base64": false,
"type": "text/html",
"value": "\u003col\u003e\n\u003cli\u003eBuild an ASCII domain whose label is \u003ccode\u003exn--\u003c/code\u003e followed by several thousand \u003ccode\u003ea\u003c/code\u003e characters and the digits \u003ccode\u003e99\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003eCall \u003ccode\u003eidna:decode/1\u003c/code\u003e on it and measure the call with \u003ccode\u003etimer:tc/1\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003eThe call exits with an invalid punycode error only after the decoder has processed the whole label. The reporter measured on OTP 27: 506 bytes in 72 ms, 1006 bytes in 494 ms, 2006 bytes in 3.3 s and 4006 bytes in 27.2 s, about 8x per doubling.\u003c/li\u003e\n\u003c/ol\u003e"
},
{
"base64": false,
"type": "text/markdown",
"value": "1. Build an ASCII domain whose label is `xn--` followed by several thousand `a` characters and the digits `99`.\n2. Call `idna:decode/1` on it and measure the call with `timer:tc/1`.\n3. The call exits with an invalid punycode error only after the decoder has processed the whole label. The reporter measured on OTP 27: 506 bytes in 72 ms, 1006 bytes in 494 ms, 2006 bytes in 3.3 s and 4006 bytes in 27.2 s, about 8x per doubling."
}
],
"value": "* Build an ASCII domain whose label is xn-- followed by several thousand a characters and the digits 99.\n* Call idna:decode/1 on it and measure the call with timer:tc/1.\n* The call exits with an invalid punycode error only after the decoder has processed the whole label. The reporter measured on OTP 27: 506 bytes in 72 ms, 1006 bytes in 494 ms, 2006 bytes in 3.3 s and 4006 bytes in 27.2 s, about 8x per doubling."
}
],
"x_technicalAnalysis": [
{
"lang": "en",
"supportingMedia": [
{
"base64": false,
"type": "text/html",
"value": "\u003cp\u003e\u003cstrong\u003e1. Label dispatch.\u003c/strong\u003e \u003ccode\u003eidna:decode/2\u003c/code\u003e in \u003ccode\u003esrc/idna.erl\u003c/code\u003e lowercases the domain, splits it into labels and passes each one to \u003ccode\u003eulabel/1\u003c/code\u003e. For an all-ASCII label that starts with \u003ccode\u003exn--\u003c/code\u003e, \u003ccode\u003eulabel/1\u003c/code\u003e strips the prefix and calls \u003ccode\u003epunycode:decode/1\u003c/code\u003e on the remainder. No length check runs before that call. \u003ccode\u003echeck_label_length/1\u003c/code\u003e, which rejects labels longer than 63 octets, is only called from \u003ccode\u003ealabel/1\u003c/code\u003e, and there only after \u003ccode\u003ealabel/1\u003c/code\u003e has itself called \u003ccode\u003eulabel/1\u003c/code\u003e on an ASCII label.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e2. Super-linear decoding.\u003c/strong\u003e \u003ccode\u003epunycode:decode/1\u003c/code\u003e in \u003ccode\u003esrc/punycode.erl\u003c/code\u003e decodes one code point per delta and places it into the output with \u003ccode\u003einsert/4\u003c/code\u003e. \u003ccode\u003einsert/4\u003c/code\u003e walks to the insertion index by rebuilding the head with \u003ccode\u003eHead ++ [C]\u003c/code\u003e on every step and then appends the tail with another \u003ccode\u003e++\u003c/code\u003e. Each insertion therefore costs time quadratic in the insertion index, and the total work grows roughly with the cube of the label length. The reporter measured about an 8x increase in running time per doubling of the label.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e3. Work before rejection.\u003c/strong\u003e The crafted label is not valid punycode and the call eventually exits with an error, but only after the decoder has processed the whole label. The \u003ccode\u003e?MAX\u003c/code\u003e overflow guards in \u003ccode\u003epunycode:decode/1\u003c/code\u003e cover the RFC 3492 integer overflow class and do not bound the running time.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e4. Entry points.\u003c/strong\u003e \u003ccode\u003edecode/1\u003c/code\u003e, \u003ccode\u003edecode/2\u003c/code\u003e, \u003ccode\u003eto_unicode/1\u003c/code\u003e and \u003ccode\u003efrom_ascii/1\u003c/code\u003e reach \u003ccode\u003eulabel/1\u003c/code\u003e in every affected release. From 6.0.0, \u003ccode\u003ealabel/1\u003c/code\u003e calls \u003ccode\u003eulabel/1\u003c/code\u003e on any ASCII label that starts with \u003ccode\u003exn--\u003c/code\u003e before \u003ccode\u003echeck_label_length/1\u003c/code\u003e, so \u003ccode\u003eencode/1\u003c/code\u003e, \u003ccode\u003eencode/2\u003c/code\u003e, \u003ccode\u003eto_ascii/1\u003c/code\u003e and \u003ccode\u003eutf8_to_ascii/1\u003c/code\u003e reach the decoder for such input as well.\u003c/p\u003e"
},
{
"base64": false,
"type": "text/markdown",
"value": "**1. Label dispatch.** `idna:decode/2` in `src/idna.erl` lowercases the domain, splits it into labels and passes each one to `ulabel/1`. For an all-ASCII label that starts with `xn--`, `ulabel/1` strips the prefix and calls `punycode:decode/1` on the remainder. No length check runs before that call. `check_label_length/1`, which rejects labels longer than 63 octets, is only called from `alabel/1`, and there only after `alabel/1` has itself called `ulabel/1` on an ASCII label.\n\n**2. Super-linear decoding.** `punycode:decode/1` in `src/punycode.erl` decodes one code point per delta and places it into the output with `insert/4`. `insert/4` walks to the insertion index by rebuilding the head with `Head ++ [C]` on every step and then appends the tail with another `++`. Each insertion therefore costs time quadratic in the insertion index, and the total work grows roughly with the cube of the label length. The reporter measured about an 8x increase in running time per doubling of the label.\n\n**3. Work before rejection.** The crafted label is not valid punycode and the call eventually exits with an error, but only after the decoder has processed the whole label. The `?MAX` overflow guards in `punycode:decode/1` cover the RFC 3492 integer overflow class and do not bound the running time.\n\n**4. Entry points.** `decode/1`, `decode/2`, `to_unicode/1` and `from_ascii/1` reach `ulabel/1` in every affected release. From 6.0.0, `alabel/1` calls `ulabel/1` on any ASCII label that starts with `xn--` before `check_label_length/1`, so `encode/1`, `encode/2`, `to_ascii/1` and `utf8_to_ascii/1` reach the decoder for such input as well."
}
],
"value": "1. Label dispatch. idna:decode/2 in src/idna.erl lowercases the domain, splits it into labels and passes each one to ulabel/1. For an all-ASCII label that starts with xn--, ulabel/1 strips the prefix and calls punycode:decode/1 on the remainder. No length check runs before that call. check_label_length/1, which rejects labels longer than 63 octets, is only called from alabel/1, and there only after alabel/1 has itself called ulabel/1 on an ASCII label.\n\n2. Super-linear decoding. punycode:decode/1 in src/punycode.erl decodes one code point per delta and places it into the output with insert/4. insert/4 walks to the insertion index by rebuilding the head with Head ++ [C] on every step and then appends the tail with another ++. Each insertion therefore costs time quadratic in the insertion index, and the total work grows roughly with the cube of the label length. The reporter measured about an 8x increase in running time per doubling of the label.\n\n3. Work before rejection. The crafted label is not valid punycode and the call eventually exits with an error, but only after the decoder has processed the whole label. The ?MAX overflow guards in punycode:decode/1 cover the RFC 3492 integer overflow class and do not bound the running time.\n\n4. Entry points. decode/1, decode/2, to_unicode/1 and from_ascii/1 reach ulabel/1 in every affected release. From 6.0.0, alabel/1 calls ulabel/1 on any ASCII label that starts with xn-- before check_label_length/1, so encode/1, encode/2, to_ascii/1 and utf8_to_ascii/1 reach the decoder for such input as well."
}
]
}
},
"cveMetadata": {
"assignerOrgId": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db",
"assignerShortName": "EEF",
"cveId": "CVE-2026-117678",
"datePublished": "2026-11-19T05:36:30.709Z",
"dateReserved": "2026-10-28T15:30:01.783Z",
"dateUpdated": "2026-11-19T14:54:54.820Z",
"state": "PUBLISHED"
},
"dataType": "CVE_RECORD",
"dataVersion": "5.2"
}
CVE-2026-117678 (GCVE-0-2026-117678)
Vulnerability from cvelistv5 – Published: 2026-11-19 05:36 – Updated: 2026-11-19 14:54
VLAI
EPSS
VEX
Title
idna: punycode labels are decoded before the 63-octet length check, so a long xn-- label causes super-linear CPU use
Summary
Inefficient Algorithmic Complexity vulnerability in benoitc idna allows an attacker who controls a hostname passed to the library to exhaust CPU via an over-long xn-- label. idna:ulabel/1 in src/idna.erl hands every ASCII label that starts with xn-- to punycode:decode/1 without applying check_label_length/1, the 63-octet DNS label limit. punycode:decode/1 in src/punycode.erl builds its output with list appends in insert/4, so its cost grows super-linearly with the label length. A label of a few kilobytes keeps a scheduler busy for seconds to minutes before the label is rejected as invalid punycode.
Every decode entry point reaches this path: decode/1, decode/2, to_unicode/1 and from_ascii/1. The encode path reaches it as well, because alabel/1 calls ulabel/1 on an ASCII xn-- label before its own length check, so encode/1, encode/2 and to_ascii/1 are affected for such input.
This issue affects idna: from 0.5.0 before 8.0.0.
Severity
SSVC
Exploitation: none
Automatable: no
Technical Impact: partial
CISA Coordinator · CISA-ADP (v2.0.3)
Decision recorded 2026-11-19 14:54 UTC
CWE
- CWE-407 - Inefficient Algorithmic Complexity
Assigner
References
6 references
| URL | Tags |
|---|---|
| https://github.com/benoitc/erlang-idna/pull/44 | issue-tracking |
| https://cna.erlef.org/cves/CVE-2026-117678.html | relatedthird-party-advisory |
| https://osv.dev/vulnerability/EEF-CVE-2026-117678 | related |
| https://github.com/benoitc/erlang-idna/pull/45 | patch |
| https://github.com/benoitc/erlang-idna/commit/c8c… | related |
| https://github.com/benoitc/erlang-idna/commit/7a4… | patch |
Impacted products
Date Public
2026-10-25 13:59
{
"containers": {
"adp": [
{
"metrics": [
{
"other": {
"content": {
"id": "CVE-2026-117678",
"options": [
{
"Exploitation": "none"
},
{
"Automatable": "no"
},
{
"Technical Impact": "partial"
}
],
"role": "CISA Coordinator",
"timestamp": "2026-11-19T14:54:46.306784Z",
"version": "2.0.3"
},
"type": "ssvc"
}
}
],
"providerMetadata": {
"dateUpdated": "2026-11-19T14:54:54.820Z",
"orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
"shortName": "CISA-ADP"
},
"title": "CISA ADP Vulnrichment"
}
],
"cna": {
"affected": [
{
"collectionURL": "https://repo.hex.pm",
"cpes": [
"cpe:2.3:a:benoitc:idna:*:*:*:*:*:*:*:*"
],
"defaultStatus": "unaffected",
"modules": [
"idna",
"punycode"
],
"packageName": "idna",
"packageURL": "pkg:hex/idna",
"product": "idna",
"programFiles": [
"src/idna.erl",
"src/punycode.erl"
],
"programRoutines": [
{
"name": "idna:ulabel/1"
},
{
"name": "idna:decode/1"
},
{
"name": "idna:decode/2"
},
{
"name": "idna:to_unicode/1"
},
{
"name": "idna:from_ascii/1"
},
{
"name": "idna:alabel/1"
},
{
"name": "idna:encode/1"
},
{
"name": "idna:encode/2"
},
{
"name": "idna:to_ascii/1"
},
{
"name": "punycode:decode/1"
},
{
"name": "punycode:insert/4"
}
],
"repo": "https://github.com/benoitc/erlang-idna",
"vendor": "benoitc",
"versions": [
{
"lessThan": "8.0.0",
"status": "affected",
"version": "0.5.0",
"versionType": "semver"
}
]
},
{
"collectionURL": "https://github.com",
"cpes": [
"cpe:2.3:a:benoitc:idna:*:*:*:*:*:*:*:*"
],
"defaultStatus": "unaffected",
"modules": [
"idna",
"punycode"
],
"packageName": "benoitc/erlang-idna",
"packageURL": "pkg:github/benoitc/erlang-idna",
"product": "idna",
"programFiles": [
"src/idna.erl",
"src/punycode.erl"
],
"programRoutines": [
{
"name": "idna:ulabel/1"
},
{
"name": "idna:decode/1"
},
{
"name": "idna:decode/2"
},
{
"name": "idna:to_unicode/1"
},
{
"name": "idna:from_ascii/1"
},
{
"name": "idna:alabel/1"
},
{
"name": "idna:encode/1"
},
{
"name": "idna:encode/2"
},
{
"name": "idna:to_ascii/1"
},
{
"name": "punycode:decode/1"
},
{
"name": "punycode:insert/4"
}
],
"repo": "https://github.com/benoitc/erlang-idna",
"vendor": "benoitc",
"versions": [
{
"lessThan": "7a465b630eb793556aa7ac282fb73e49251dadd2",
"status": "affected",
"version": "c8caba6653259071f7076fe49320f37402b8b81f",
"versionType": "git"
}
]
}
],
"cpeApplicability": [
{
"nodes": [
{
"cpeMatch": [
{
"criteria": "cpe:2.3:a:benoitc:idna:*:*:*:*:*:*:*:*",
"versionEndExcluding": "8.0.0",
"versionStartIncluding": "0.5.0",
"vulnerable": true
}
],
"negate": false,
"operator": "OR"
}
],
"operator": "AND"
}
],
"credits": [
{
"lang": "en",
"type": "finder",
"value": "Andrew Moore"
},
{
"lang": "en",
"type": "finder",
"value": "Martin Karrer"
},
{
"lang": "en",
"type": "reporter",
"value": "Andrew Moore"
},
{
"lang": "en",
"type": "coordinator",
"value": "Jonatan M\u00e4nnchen / EEF"
},
{
"lang": "en",
"type": "remediation developer",
"value": "Benoit Chesneau"
},
{
"lang": "en",
"type": "remediation developer",
"value": "Martin Karrer"
}
],
"dateAssigned": "2026-10-30T12:03:25.000Z",
"datePublic": "2026-10-25T13:59:07.000Z",
"descriptions": [
{
"lang": "en",
"supportingMedia": [
{
"base64": false,
"type": "text/html",
"value": "\u003cp\u003eInefficient Algorithmic Complexity vulnerability in benoitc idna allows an attacker who controls a hostname passed to the library to exhaust CPU via an over-long \u003ccode\u003exn--\u003c/code\u003e label. \u003ccode\u003eidna:ulabel/1\u003c/code\u003e in \u003ccode\u003esrc/idna.erl\u003c/code\u003e hands every ASCII label that starts with \u003ccode\u003exn--\u003c/code\u003e to \u003ccode\u003epunycode:decode/1\u003c/code\u003e without applying \u003ccode\u003echeck_label_length/1\u003c/code\u003e, the 63-octet DNS label limit. \u003ccode\u003epunycode:decode/1\u003c/code\u003e in \u003ccode\u003esrc/punycode.erl\u003c/code\u003e builds its output with list appends in \u003ccode\u003einsert/4\u003c/code\u003e, so its cost grows super-linearly with the label length. A label of a few kilobytes keeps a scheduler busy for seconds to minutes before the label is rejected as invalid punycode.\u003c/p\u003e\n\u003cp\u003eEvery decode entry point reaches this path: \u003ccode\u003edecode/1\u003c/code\u003e, \u003ccode\u003edecode/2\u003c/code\u003e, \u003ccode\u003eto_unicode/1\u003c/code\u003e and \u003ccode\u003efrom_ascii/1\u003c/code\u003e. The encode path reaches it as well, because \u003ccode\u003ealabel/1\u003c/code\u003e calls \u003ccode\u003eulabel/1\u003c/code\u003e on an ASCII \u003ccode\u003exn--\u003c/code\u003e label before its own length check, so \u003ccode\u003eencode/1\u003c/code\u003e, \u003ccode\u003eencode/2\u003c/code\u003e and \u003ccode\u003eto_ascii/1\u003c/code\u003e are affected for such input.\u003c/p\u003e\n\u003cp\u003eThis issue affects idna: from 0.5.0 before 8.0.0.\u003c/p\u003e"
},
{
"base64": false,
"type": "text/markdown",
"value": "Inefficient Algorithmic Complexity vulnerability in benoitc idna allows an attacker who controls a hostname passed to the library to exhaust CPU via an over-long `xn--` label. `idna:ulabel/1` in `src/idna.erl` hands every ASCII label that starts with `xn--` to `punycode:decode/1` without applying `check_label_length/1`, the 63-octet DNS label limit. `punycode:decode/1` in `src/punycode.erl` builds its output with list appends in `insert/4`, so its cost grows super-linearly with the label length. A label of a few kilobytes keeps a scheduler busy for seconds to minutes before the label is rejected as invalid punycode.\n\nEvery decode entry point reaches this path: `decode/1`, `decode/2`, `to_unicode/1` and `from_ascii/1`. The encode path reaches it as well, because `alabel/1` calls `ulabel/1` on an ASCII `xn--` label before its own length check, so `encode/1`, `encode/2` and `to_ascii/1` are affected for such input.\n\nThis issue affects idna: from 0.5.0 before 8.0.0."
}
],
"value": "Inefficient Algorithmic Complexity vulnerability in benoitc idna allows an attacker who controls a hostname passed to the library to exhaust CPU via an over-long xn-- label. idna:ulabel/1 in src/idna.erl hands every ASCII label that starts with xn-- to punycode:decode/1 without applying check_label_length/1, the 63-octet DNS label limit. punycode:decode/1 in src/punycode.erl builds its output with list appends in insert/4, so its cost grows super-linearly with the label length. A label of a few kilobytes keeps a scheduler busy for seconds to minutes before the label is rejected as invalid punycode.\n\nEvery decode entry point reaches this path: decode/1, decode/2, to_unicode/1 and from_ascii/1. The encode path reaches it as well, because alabel/1 calls ulabel/1 on an ASCII xn-- label before its own length check, so encode/1, encode/2 and to_ascii/1 are affected for such input.\n\nThis issue affects idna: from 0.5.0 before 8.0.0."
}
],
"impacts": [
{
"capecId": "CAPEC-130",
"descriptions": [
{
"lang": "en",
"supportingMedia": [
{
"base64": false,
"type": "text/html",
"value": "\u003cp\u003eAn attacker who can get an application to decode or encode a hostname they control, for example from a user-supplied URL or a redirect \u003ccode\u003eLocation\u003c/code\u003e header, keeps one scheduler busy per call for seconds to hours depending on the label length. Enough concurrent calls exhaust the CPU of the VM.\u003c/p\u003e"
},
{
"base64": false,
"type": "text/markdown",
"value": "An attacker who can get an application to decode or encode a hostname they control, for example from a user-supplied URL or a redirect `Location` header, keeps one scheduler busy per call for seconds to hours depending on the label length. Enough concurrent calls exhaust the CPU of the VM."
}
],
"value": "An attacker who can get an application to decode or encode a hostname they control, for example from a user-supplied URL or a redirect Location header, keeps one scheduler busy per call for seconds to hours depending on the label length. Enough concurrent calls exhaust the CPU of the VM."
}
]
}
],
"metrics": [
{
"cvssV4_0": {
"Automatable": "NOT_DEFINED",
"Recovery": "NOT_DEFINED",
"Safety": "NOT_DEFINED",
"attackComplexity": "LOW",
"attackRequirements": "NONE",
"attackVector": "LOCAL",
"baseScore": 6.9,
"baseSeverity": "MEDIUM",
"privilegesRequired": "NONE",
"providerUrgency": "NOT_DEFINED",
"subAvailabilityImpact": "NONE",
"subConfidentialityImpact": "NONE",
"subIntegrityImpact": "NONE",
"userInteraction": "NONE",
"valueDensity": "NOT_DEFINED",
"vectorString": "CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N",
"version": "4.0",
"vulnAvailabilityImpact": "HIGH",
"vulnConfidentialityImpact": "NONE",
"vulnIntegrityImpact": "NONE",
"vulnerabilityResponseEffort": "NOT_DEFINED"
},
"format": "CVSS",
"scenarios": [
{
"lang": "en",
"value": "GENERAL"
}
]
}
],
"problemTypes": [
{
"descriptions": [
{
"cweId": "CWE-407",
"description": "CWE-407 Inefficient Algorithmic Complexity",
"lang": "en",
"type": "CWE"
}
]
}
],
"providerMetadata": {
"dateUpdated": "2026-11-19T06:59:47.303Z",
"orgId": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db",
"shortName": "EEF"
},
"references": [
{
"name": "Check label length before Punycode and fix the transform\u0027s complexity",
"tags": [
"issue-tracking"
],
"url": "https://github.com/benoitc/erlang-idna/pull/44"
},
{
"name": "EEF CNA record for CVE-2026-117678",
"tags": [
"related",
"third-party-advisory"
],
"url": "https://cna.erlef.org/cves/CVE-2026-117678.html"
},
{
"name": "OSV record EEF-CVE-2026-117678",
"tags": [
"related"
],
"url": "https://osv.dev/vulnerability/EEF-CVE-2026-117678"
},
{
"name": "Reject over-long labels before Punycode and speed up the transform",
"tags": [
"patch"
],
"url": "https://github.com/benoitc/erlang-idna/pull/45"
},
{
"name": "Introducing commit c8caba6 in benoitc/erlang-idna",
"tags": [
"related"
],
"url": "https://github.com/benoitc/erlang-idna/commit/c8caba6653259071f7076fe49320f37402b8b81f"
},
{
"name": "Fix commit 7a465b6 in benoitc/erlang-idna",
"tags": [
"patch"
],
"url": "https://github.com/benoitc/erlang-idna/commit/7a465b630eb793556aa7ac282fb73e49251dadd2"
}
],
"source": {
"discovery": "EXTERNAL"
},
"title": "idna: punycode labels are decoded before the 63-octet length check, so a long xn-- label causes super-linear CPU use",
"workarounds": [
{
"lang": "en",
"supportingMedia": [
{
"base64": false,
"type": "text/html",
"value": "\u003cp\u003eBefore passing a hostname to idna, reject any domain that contains a label longer than 63 octets. The DNS limits labels to that length, so legitimate names pass unchanged, and the decoder never runs on the crafted label. The check must run before every call that reaches \u003ccode\u003eidna:ulabel/1\u003c/code\u003e, including \u003ccode\u003eencode/1\u003c/code\u003e and \u003ccode\u003eto_ascii/1\u003c/code\u003e, because \u003ccode\u003ealabel/1\u003c/code\u003e decodes an ASCII \u003ccode\u003exn--\u003c/code\u003e label before checking its length.\u003c/p\u003e"
},
{
"base64": false,
"type": "text/markdown",
"value": "Before passing a hostname to idna, reject any domain that contains a label longer than 63 octets. The DNS limits labels to that length, so legitimate names pass unchanged, and the decoder never runs on the crafted label. The check must run before every call that reaches `idna:ulabel/1`, including `encode/1` and `to_ascii/1`, because `alabel/1` decodes an ASCII `xn--` label before checking its length."
}
],
"value": "Before passing a hostname to idna, reject any domain that contains a label longer than 63 octets. The DNS limits labels to that length, so legitimate names pass unchanged, and the decoder never runs on the crafted label. The check must run before every call that reaches idna:ulabel/1, including encode/1 and to_ascii/1, because alabel/1 decodes an ASCII xn-- label before checking its length."
}
],
"x_proofOfConcept": [
{
"lang": "en",
"supportingMedia": [
{
"base64": false,
"type": "text/html",
"value": "\u003col\u003e\n\u003cli\u003eBuild an ASCII domain whose label is \u003ccode\u003exn--\u003c/code\u003e followed by several thousand \u003ccode\u003ea\u003c/code\u003e characters and the digits \u003ccode\u003e99\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003eCall \u003ccode\u003eidna:decode/1\u003c/code\u003e on it and measure the call with \u003ccode\u003etimer:tc/1\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003eThe call exits with an invalid punycode error only after the decoder has processed the whole label. The reporter measured on OTP 27: 506 bytes in 72 ms, 1006 bytes in 494 ms, 2006 bytes in 3.3 s and 4006 bytes in 27.2 s, about 8x per doubling.\u003c/li\u003e\n\u003c/ol\u003e"
},
{
"base64": false,
"type": "text/markdown",
"value": "1. Build an ASCII domain whose label is `xn--` followed by several thousand `a` characters and the digits `99`.\n2. Call `idna:decode/1` on it and measure the call with `timer:tc/1`.\n3. The call exits with an invalid punycode error only after the decoder has processed the whole label. The reporter measured on OTP 27: 506 bytes in 72 ms, 1006 bytes in 494 ms, 2006 bytes in 3.3 s and 4006 bytes in 27.2 s, about 8x per doubling."
}
],
"value": "* Build an ASCII domain whose label is xn-- followed by several thousand a characters and the digits 99.\n* Call idna:decode/1 on it and measure the call with timer:tc/1.\n* The call exits with an invalid punycode error only after the decoder has processed the whole label. The reporter measured on OTP 27: 506 bytes in 72 ms, 1006 bytes in 494 ms, 2006 bytes in 3.3 s and 4006 bytes in 27.2 s, about 8x per doubling."
}
],
"x_technicalAnalysis": [
{
"lang": "en",
"supportingMedia": [
{
"base64": false,
"type": "text/html",
"value": "\u003cp\u003e\u003cstrong\u003e1. Label dispatch.\u003c/strong\u003e \u003ccode\u003eidna:decode/2\u003c/code\u003e in \u003ccode\u003esrc/idna.erl\u003c/code\u003e lowercases the domain, splits it into labels and passes each one to \u003ccode\u003eulabel/1\u003c/code\u003e. For an all-ASCII label that starts with \u003ccode\u003exn--\u003c/code\u003e, \u003ccode\u003eulabel/1\u003c/code\u003e strips the prefix and calls \u003ccode\u003epunycode:decode/1\u003c/code\u003e on the remainder. No length check runs before that call. \u003ccode\u003echeck_label_length/1\u003c/code\u003e, which rejects labels longer than 63 octets, is only called from \u003ccode\u003ealabel/1\u003c/code\u003e, and there only after \u003ccode\u003ealabel/1\u003c/code\u003e has itself called \u003ccode\u003eulabel/1\u003c/code\u003e on an ASCII label.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e2. Super-linear decoding.\u003c/strong\u003e \u003ccode\u003epunycode:decode/1\u003c/code\u003e in \u003ccode\u003esrc/punycode.erl\u003c/code\u003e decodes one code point per delta and places it into the output with \u003ccode\u003einsert/4\u003c/code\u003e. \u003ccode\u003einsert/4\u003c/code\u003e walks to the insertion index by rebuilding the head with \u003ccode\u003eHead ++ [C]\u003c/code\u003e on every step and then appends the tail with another \u003ccode\u003e++\u003c/code\u003e. Each insertion therefore costs time quadratic in the insertion index, and the total work grows roughly with the cube of the label length. The reporter measured about an 8x increase in running time per doubling of the label.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e3. Work before rejection.\u003c/strong\u003e The crafted label is not valid punycode and the call eventually exits with an error, but only after the decoder has processed the whole label. The \u003ccode\u003e?MAX\u003c/code\u003e overflow guards in \u003ccode\u003epunycode:decode/1\u003c/code\u003e cover the RFC 3492 integer overflow class and do not bound the running time.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e4. Entry points.\u003c/strong\u003e \u003ccode\u003edecode/1\u003c/code\u003e, \u003ccode\u003edecode/2\u003c/code\u003e, \u003ccode\u003eto_unicode/1\u003c/code\u003e and \u003ccode\u003efrom_ascii/1\u003c/code\u003e reach \u003ccode\u003eulabel/1\u003c/code\u003e in every affected release. From 6.0.0, \u003ccode\u003ealabel/1\u003c/code\u003e calls \u003ccode\u003eulabel/1\u003c/code\u003e on any ASCII label that starts with \u003ccode\u003exn--\u003c/code\u003e before \u003ccode\u003echeck_label_length/1\u003c/code\u003e, so \u003ccode\u003eencode/1\u003c/code\u003e, \u003ccode\u003eencode/2\u003c/code\u003e, \u003ccode\u003eto_ascii/1\u003c/code\u003e and \u003ccode\u003eutf8_to_ascii/1\u003c/code\u003e reach the decoder for such input as well.\u003c/p\u003e"
},
{
"base64": false,
"type": "text/markdown",
"value": "**1. Label dispatch.** `idna:decode/2` in `src/idna.erl` lowercases the domain, splits it into labels and passes each one to `ulabel/1`. For an all-ASCII label that starts with `xn--`, `ulabel/1` strips the prefix and calls `punycode:decode/1` on the remainder. No length check runs before that call. `check_label_length/1`, which rejects labels longer than 63 octets, is only called from `alabel/1`, and there only after `alabel/1` has itself called `ulabel/1` on an ASCII label.\n\n**2. Super-linear decoding.** `punycode:decode/1` in `src/punycode.erl` decodes one code point per delta and places it into the output with `insert/4`. `insert/4` walks to the insertion index by rebuilding the head with `Head ++ [C]` on every step and then appends the tail with another `++`. Each insertion therefore costs time quadratic in the insertion index, and the total work grows roughly with the cube of the label length. The reporter measured about an 8x increase in running time per doubling of the label.\n\n**3. Work before rejection.** The crafted label is not valid punycode and the call eventually exits with an error, but only after the decoder has processed the whole label. The `?MAX` overflow guards in `punycode:decode/1` cover the RFC 3492 integer overflow class and do not bound the running time.\n\n**4. Entry points.** `decode/1`, `decode/2`, `to_unicode/1` and `from_ascii/1` reach `ulabel/1` in every affected release. From 6.0.0, `alabel/1` calls `ulabel/1` on any ASCII label that starts with `xn--` before `check_label_length/1`, so `encode/1`, `encode/2`, `to_ascii/1` and `utf8_to_ascii/1` reach the decoder for such input as well."
}
],
"value": "1. Label dispatch. idna:decode/2 in src/idna.erl lowercases the domain, splits it into labels and passes each one to ulabel/1. For an all-ASCII label that starts with xn--, ulabel/1 strips the prefix and calls punycode:decode/1 on the remainder. No length check runs before that call. check_label_length/1, which rejects labels longer than 63 octets, is only called from alabel/1, and there only after alabel/1 has itself called ulabel/1 on an ASCII label.\n\n2. Super-linear decoding. punycode:decode/1 in src/punycode.erl decodes one code point per delta and places it into the output with insert/4. insert/4 walks to the insertion index by rebuilding the head with Head ++ [C] on every step and then appends the tail with another ++. Each insertion therefore costs time quadratic in the insertion index, and the total work grows roughly with the cube of the label length. The reporter measured about an 8x increase in running time per doubling of the label.\n\n3. Work before rejection. The crafted label is not valid punycode and the call eventually exits with an error, but only after the decoder has processed the whole label. The ?MAX overflow guards in punycode:decode/1 cover the RFC 3492 integer overflow class and do not bound the running time.\n\n4. Entry points. decode/1, decode/2, to_unicode/1 and from_ascii/1 reach ulabel/1 in every affected release. From 6.0.0, alabel/1 calls ulabel/1 on any ASCII label that starts with xn-- before check_label_length/1, so encode/1, encode/2, to_ascii/1 and utf8_to_ascii/1 reach the decoder for such input as well."
}
]
}
},
"cveMetadata": {
"assignerOrgId": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db",
"assignerShortName": "EEF",
"cveId": "CVE-2026-117678",
"datePublished": "2026-11-19T05:36:30.709Z",
"dateReserved": "2026-10-28T15:30:01.783Z",
"dateUpdated": "2026-11-19T14:54:54.820Z",
"state": "PUBLISHED"
},
"dataType": "CVE_RECORD",
"dataVersion": "5.2"
}