Re: [exim/exim] [Bug]: ${utf8_domain_to_alabel:} doe not validate result (Issue #3226)
Viktor Dukhovni via Exim-dev <[email protected]> Fri, 15 May 2026 01:33:05 +1000
| Newsgroups | gmane.mail.exim.devel |
|---|---|
| Message-ID | <[email protected]> |
On Thu, May 14, 2026 at 03:20:50PM +0100, jgh via Exim-dev wrote:
> What is the problem environment ?
> ---------------------------------
>
> commit hash 1b3209b
>
> What happened?
> --------------
>
> Fed with \xe2 \x80 \80 (which is a space-class thing) it returns a space.
> This is unfortunate in a domain, and not legitimate per IDNA2008
Indeed "enquad" (U+2000 <https://www.compart.com/en/unicode/U+2000>) is
a disallowed code point. So a robust U-label to A-label encoder should
reject a U-label with that code point as disallowed.
I've just put together a fresh IDNA2008 implementation in Haskell,
this reports:
1. Valid domain with some Greek letters in its second label:
l0.xn--l1--x-f9dhi.l2 ([LDH,ULABEL,LDH])
2. Invalid domain with an "enquad" in its second label:
ErrLabelInvalid (IdnaLoc {idnaLabelIndex = 1, idnaByteOffset = -1}) (DisallowedCodepoint 8192)
[ The specific byte offset is difficult to report in U-labels that may
be subject to NFC-normalisation, and possible additional mappings. ]
--
Viktor. 🇺🇦 Слава Україні!
module Main (main) where
import qualified Data.ByteString as B
import qualified Data.Text as T
import qualified Data.Text.Encoding as T
import qualified Data.Text.IO as T
import Text.IDNA2008
main :: IO ()
main = do
cvt okdom
cvt baddom
where
okdom = T.pack "l0.l1-αβγ-x.l2"
baddom = T.pack "l0.l1-" <> enquad <> T.pack "-x.l2"
where
enquad = T.decodeUtf8 $ B.pack [0xe2, 0x80, 0x80]
cvt name = case parseDomain idnLabelForms name of
Right (dom, inf) -> do
T.putStr $ domainToAscii dom
putStr " (" >> putStr (show inf) >> putStrLn ")"
Left err -> print err
--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-dev.lists.exim.org/
## unsubscribe (doesn't require an account):
## [email protected]
## Exim details at https://www.exim.org/
## Please use the Wiki with this list - https://code.exim.org/exim/wiki/wiki