[exim/exim] [Bug]: ARC signature verification fails if one signed header name is a prefix of another (Issue #3222)
scottm via Exim-dev <[email protected]> Thu, 30 Apr 2026 16:30:02 +0100
| Newsgroups | gmane.mail.exim.devel |
|---|---|
| Message-ID | <exim/exim/issues/[email protected]> |
What is the problem environment ?
---------------------------------
exim 4.99.1, built from source
What happened?
--------------
When a message contains an ARC-Message-Signature that signs two different headers, where one header name is a prefix of the other (e.g. List-Unsubscribe and List-Unsubscribe-Post), ARC verification fails. The added Authentication-Results header includes a line like:
arc=fail (i=1)(AMS sig nonverify) header.s=arc_test arc.oldest-pass=0 smtp.remote-ip=192.168.1.1
I've attached a message that demonstrates the issue, and a log snippet from runnint exim -bh 192.168.1.1 -d-all+acl. The most relevant part is:
ARC: AMS header data for verification:
date:Wed,{SP}29{SP}Apr{SP}2026{SP}11:26:54{SP}+0000{CR}{LF}
from:<[email protected]>{CR}{LF}
subject:ARC{SP}test{CR}{LF}
list-unsubscribe-post:test1{CR}{LF}
arc-message-signature:i=1;{SP}a=rsa-sha256;{SP}c=relaxed/relaxed;{SP}d=scott.dev.mailchannels.net;{SP}s=arc_test;{SP}t=1777560
There you can see that list-unsubsribe-post is present, but not list-unsubscribe.
I think the problem in src/miscmods/arc.c:688
if ( !r->used
&& strncasecmp(CCS (s = r->h->text), CCS hn, Ustrlen(hn)) == 0
)
The strncasecmp() only compares bytes in the header name itself, and does not look for the ':' separator.
(Note that the ARC-Seal on the attached message doesn't validate for some reason, but that's not the issue I'm reporting - I'm only talking about the ARC-Message-Signature)
Relevant log output
-------------------
DEBUGGING ACTIVATED FROM WITHIN CONFIG.
DEBUG: Tag = ".arc-1wITH1-0000000HFjm-2G2e" opts = "-all+acl"
uid = 118 gid = 123 euid = 118 egid = 123
warn: condition test succeeded in ACL acl_check_data
processing ACL acl_check_data "warn" ( /usr/exim/configure 644 )
check verify = arc/none:fail:pass
ARC: collecting arc sets
ARC: found AS: ARC-Seal: i = 1 ; cv = none ; a = rsa-sha256 ; d = scott.dev.mailchannels.net ;
s = arc_test ; t = 1777560525 ;
b = tbWSfMHdHDpIZmCIcHL2+9dk4QBmKj4l5ILL3QKdLZyX/Y1tBbncMdIG7EbUypHJTMkGm
95OcL8JK+T/4NDFeWgHfeOPyMMb7NWBALnKNXAZGTYOIxNf1jqVYjy4DJcV2jWAx9AP4xvN
9eSA7cqnwTRy2LhQ729edEFtse3qJE8zT1hOFpaY6IV58rDbTeTpT7CLaN7mVI/rN/Ckpgh
3Z4O3X1ICowLkqbDeZcnR9SPH2ug/QTv+uVBT5UzQICX6/7IA+xeyM3sy0sXGuUW1W8R4z6
99ka325NarNNd5VIR2Bi11nv8IvvfH3aK02fEhb4S7Ee+OZIKARQDeq9e44oltc7R9FqcDx
Y7uOC366yjgBnf+UyH2yGVIrEkLrRr0zf1ODOSPbM1LOtlDPKl8f2B/Z8dGg7W+59PssEJO
JGSUO3iCiEWQYNc/di6ec92NG/NxzEcr1EsnqOHAzakXWCv6jHevNHQq/zAm8mDCC2NnvmH
eMUrrYIk7p47XVdqr
ARC: new instance 1
ARC: found AMS: ARC-Message-Signature: i = 1 ; a = rsa-sha256 ; c = relaxed/relaxed ;
d = scott.dev.mailchannels.net ; s = arc_test ; t = 1777560525 ; h = date : from
: subject : list-unsubscribe : from ;
bh = vO7vIp734XqVFbB5O2BS8jDlZ2towS7RD8+BvjCT11k = ;
b = sylqPPmnt9EMgOXEQ2MdYFYT06TSiVBfj/GvVzhVaJHdkKyBEtYrLkgvE3CD4UJPjA7bO
JPOy5Fm1vu0UEIt3ysOkKiAZ1QpIN7/VtOXEYkDeZR4sJrzvM8F/pCKFjTfLoavmQ0mRrG+
b+XmiSS9StCWYOr90rY0k9CEDORdcuwzkB7c/nLJLaTKcWUKBk3sK0e4KqKQYY05mEcP4t+
Naw5rgwsrHypkOTm9QyokT+aDXLNDe+pNjIkyxSW+etdGrAWC76AQ1u4WCzymsaOrhQrYBj
txFCnDBsjBCTpynS3RlCJ6df7H72VYpA8uUnCMZnVs4i4ijR893HhyMaHIfuI3Ctb6tgRPe
BAdu3PmO5MPhr0OTK/B43YdWGO+Bbvh5cBdVL9f9pVRy5fw/ZCKRzvQdoGrqaAEHn21XABp
Eaf7hhR8FCkJiKT64QPcub5bsFPesRgPkc6iob/ZXHqT0+mXYysjVuVZnuOVjPtWD+3d3wP
rBRFUuGLDROLemaqt
ARC: existing instance 1
ARC: found AAR: ARC-Authentication-Results: i = 1 ; scott.dev.mailchannels.net ; spf = pass ;
dkim = pass
ARC: existing instance 1
ARC i = 1 AMS Body bytes hashed: 14
Body sha256 computed: bceeef229ef7e17a9515b0793b6052f230e5676b68c12ed10fcf81be3093d759
ARC i = 1 AMS Body hash compared OK
ARC: AMS header data for verification:
date:Wed, { SP } 29 { SP } Apr { SP } 2026 { SP } 11:26:54 { SP } +0000 { CR }{ LF }
from:<[email protected]> { CR }{ LF }
subject:ARC { SP } test { CR }{ LF }
list-unsubscribe-post:test1 { CR }{ LF }
arc-message-signature:i = 1 ; { SP } a = rsa-sha256 ; { SP } c = relaxed/relaxed ; { SP } d = scott.dev.mailchannels.net ; { SP } s = arc_test ; { SP } t = 1777560525 ; { SP } h = date { SP } : { SP } from { SP } : { SP } subject { SP } : { SP } list-unsubscribe { SP } : { SP } from ; { SP } bh = vO7vIp734XqVFbB5O2BS8jDlZ2towS7RD8+BvjCT11k = ; { SP } b =
ARC: header hash: ca7d134606f555c49bba5ba3da783a8321b33b16415af7e43b6a5c66986a9467
v = DKIM1
k = rsa
p = MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAySsN3nfS+T9LYC1MRLyRzs5Ui7QNZQ7l85872QPlO1HzfqKtgR1nPePqubEom/B+pw1Va4K+kkAs3VSdU4MRjmqukYWf+ZEmxuDNg4vbpcVmv8gu5D5SCRkhot33JrrbTB6jY2xai0SWAncpDJcRX4MqvWsvuXLHDuo1at5OgwzboFG/JAcHS6F02ZMMiLiKW62fBKLPe09xS3tIPtpuOQQ+mudcNh5KPeTIYbClZXD7hZLaxgMk5+E/G2fr1wnTKpnqGUcknyDjdYclWwEveMgvhmEqkXPy1DnUOpKamruQ98vAXaxQf6vp27STtj2L+1Aojqo3vszZ1+5rRQ+UArGDaswHyC+A7VrEPoMbaTY5UDj1bIIeKHtTq2cjoiEshzKUczkxxMNWa52rUYS4X0d5nhea5CuqfgQJSO4icNTNLIftaNbprY+wrs3gWqQ+C3o8xctqnlzungv3b/bpDzxamgqAyhbuK3nwcd8kA+GJtZc++Da2btVbQj89DUjvAgMBAAE =
ARC i = 1 AMS verify error:02000068:rsa routines::bad signature
ARC verify result fail ( AMS sig nonverify )
warn: condition test succeeded in ACL acl_check_data
processing ACL acl_check_data "warn" ( /usr/exim/configure 647 )
ARC: authres 'arc=fail (i=1)(AMS sig nonverify) header.s=arc_test arc.oldest-pass=0 smtp.remote-ip=192.168.1.1'
DKIM: no authres
check add_header = :at_start: ${ authresults {mx.test.local } }
= :at_start:Authentication-Results: mx.test.local ;
iprev = pass ( ip-192-168-1-1.us-west-2.compute.internal ) smtp.remote-ip = 192.168.1.1 ;
arc = fail ( i = 1 )( AMS sig nonverify ) header.s = arc_test arc.oldest-pass = 0 smtp.remote-ip = 192.168.1.1
---
View it on Exim Forgejo ( https://code.exim.org/exim/exim/issues/3222 ) or reply to this email directly.