A signature can travel perfectly and still arrive meaning something else
Canonicalization is the quiet art of deciding, byte by byte, what a document actually says—so that two machines can hash the same thing and agree. It is also, unavoidably, the art of deciding what a document is allowed to forget. In March 2004, three engineers published a specification that made that second job explicit, then handed the bill to everyone who had assumed the first job was the whole story.
Their document was RFC 3741, Exclusive XML Canonicalization. Its promise was modest and genuinely useful: a signed XML fragment should survive being lifted out of one message envelope and dropped into another. Its warning was the part people skipped past. The signature would still verify. The meaning might not.
Two decades on, as signed assertions, verifiable credentials and machine-to-machine trust chains multiply, that distinction has stopped being a footnote for XML specialists. It is the difference between proving that bytes did not change and proving that they still say what the sender meant.
What RFC 3741 actually fixed: the wrapper was rewriting the payload
Picture the ordinary plumbing of the Web-services era. A protocol signs a small XML element buried inside a large message. A gateway strips the outer wrapper. Another service drops that same element into a fresh envelope. Nothing inside the signed element has been touched—and yet the signature fails.
The culprit was inclusive Canonical XML. Ancestor namespace declarations and selected xml: attributes could enter the canonical byte stream even when the signed element never used them, so a change to the wrapper silently changed the digest input. The payload had been held hostage by its packaging.
RFC 3741 cut that cord. It defined Exclusive XML Canonicalization as a serialization method for an XPath node-set: rather than importing most inherited namespace context, it renders a namespace binding only where the subset visibly uses that prefix in an element or attribute name. An optional InclusiveNamespaces PrefixList lets a designer name prefixes that must be treated inclusively anyway. The W3C Recommendation had landed in July 2002, drafted by John Boyer, Donald E. Eastlake 3rd and Joseph Reagle; the RFC followed in March 2004 to give the algorithm a stable, citable home.
The goal was composability: signed subdocuments should survive extraction and re-insertion without dragging every unrelated wrapper into their canonical form. That is a boundary decision, not a guarantee of context-free meaning—and RFC 3741 says so itself, in its own limitations and security discussion. It is a different question from RFC 3075's (what does XML Signature actually cover?) and from RFC 3076's (how do you canonicalize a node-set after parsing?). RFC 3741 asks what context to keep when the selected subset moves.
The visible-use rule: elegant, and narrower than it looks
The algorithm's test follows XML names. If an element uses prefix n1, or an attribute name uses n1, then the binding for n1 matters to rendering that element. An inherited prefix that appears in no such name can be dropped. In practice this strips a great deal of noise: a SOAP or protocol wrapper may declare a pile of namespaces the wrapper needs and the extracted payload does not, and exclusive canonicalization will produce identical canonical bytes for that payload in both envelopes.
But application meaning can hang on information that never surfaces as a QName in the selected node-set. An attribute value might hold an XPath expression whose prefix bindings matter. An application may read a string such as xsi:type="xsd:decimal" as a QName even though XPath sees only a string. Under Exclusive XML Canonicalization the xsd binding can be omitted—no element or attribute name visibly uses it, and it is absent from the inclusive prefix list—so a receiving application in a new envelope may interpret the value differently.
The standard names three ways to manage that dependency: make the prefix use visible in the XML structure, guarantee the same binding in every interpretation context, or list the prefix in InclusiveNamespaces PrefixList. Each is a contract choice, not a default. The prefix list is not a magic detector for hidden QName semantics; the designer must already know which values carry namespace-sensitive meaning. That is the unglamorous part of the job, and it is the part that gets skipped.
What exclusive canonicalization deliberately leaves behind
Exclusive canonicalization also refuses, on purpose, to copy ancestor xml:lang, xml:space or xml:base values into an orphaned subset. Those attributes shape language selection, whitespace handling and the resolution of relative references—small words with large consequences. RFC 3741 requires applications either to place a needed value on a node inside the subset or to ensure an equivalent value exists in every context where the subset will be interpreted.
The specification's own target-context example is the sharpest warning in the document. A fragment's canonical octets can remain byte-identical when it is moved beneath a new default namespace declaration. Yet the destination application may associate the unprefixed element with a different namespace and therefore treat it as a different kind of object altogether. The signature verifies, because the selected octets never changed. The interpretation changes, because the destination context did.
RFC 3741 does not legislate how namespace declarations are extracted, inserted or repaired, and it does not decide whether a receiving application should authorize the operation. The protocol has to carry the relevant context and define what a consumer does with the resulting node. Cryptographic integrity is one segment of that path, not the whole road.
Why this matters now: digital identity, credentials and the trust gap
The Web-services boom that produced RFC 3741 has faded, but its problem has not. Signed XML still carries SAML assertions, federation metadata, e-invoicing envelopes and a long tail of government and financial messaging. Every one of those flows assumes that a verified signature means the receiver is looking at the object the sender signed.
That assumption is a category error, and it is the same error that recurs wherever a record-keeper mistakes its ledger for a throne. A signature is a bookkeeper's stamp: it attests that the bytes did not change hands. It says nothing about whether the reader resolves those bytes into the same element, the same language, the same base URI, the same type. Integrity is a property of octets. Meaning is a property of context. Conflating them is how a perfectly valid signature ends up authorizing the wrong object.
A smaller signature boundary creates a larger integration duty
Exclusive canonicalization made a trade: it removed accidental dependence on wrapper context and, in exchange, imposed an explicit obligation to inventory semantic dependencies. For anyone forwarding signed fragments, the review question is therefore double. Does the signature verify? And do the fragment's namespace bindings, xml: attributes, QName-valued fields and relative references still mean the same thing at the destination?
When those facts stay implicit, signature stability wears the costume of semantic stability, and the two properties quietly part ways. This is a specification-level risk model, not evidence of a specific exploit or a named implementation failure. RFC 3741 is Informational: it establishes the algorithm's purpose and its limits, not how widely any particular stack deployed it or whether some service mishandled it.
The lasting lesson is narrow, portable and stubbornly easy to forget. Removing context from signed bytes buys portability. Only the application can say which omitted context still governs interpretation—and only the protocol designer can decide to check it rather than hope.
Sources
Member Briefing
Read the full trend briefing
Members read the full briefing with the source notes behind every finding.
Strategic Circle
A daily briefing in your language, built from changes we have verified.
Join for USD 20/monthCancel anytime.
Members also get the full research library, a daily briefing on the networks they follow and the private forum.






