Release note · August 6, 2026
A declaration has an attribute boundary
Signature coverage is only as useful as the declaration that supports it. DocFence 0.62 tightens one small but consequential boundary in its static OPC package-signature audit: a Reference or DigestMethod with undeclared attributes cannot silently receive coverage credit.
Three attributes on the reference; one on the digest method
XMLDSIG Core's ReferenceType declares Id, URI, and Type. Its DigestMethodType declares Algorithm. In the one bounded binding-and-manifest chain that DocFence uses for declared package coverage, 0.62 now applies those direct attribute surfaces:
<ds:Reference Id="idWordPart" URI="/word/document.xml?ContentType=..." Type="...">
<ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
<ds:DigestValue>...</ds:DigestValue>
</ds:Reference>
Id, URI, and Type remain valid on the bounded Reference; an Algorithm remains valid on its direct DigestMethod. An extra attribute is different from optional metadata: it is outside the stored declaration grammar that this coverage audit understands.
Malformed declarations now fail closed at the right level
An unknown attribute on the SignedInfo reference that binds the package object leaves that signature without declared package coverage. An unknown attribute on a manifest reference is retained only as aggregate unsupported evidence; it covers neither a Word part nor a relationship. This preserves the audit's useful distinction between “the coverage chain is unavailable” and “this one candidate reference cannot be credited.”
version: 1
rules:
require_complete_package_signature_coverage: true
no_package_signature_coverage_changes: true
The policy remains deliberately narrow. DocFence does not turn this into general XMLDSIG schema validation: it does not validate method-parameter child markup, base64 lexical content, digest values, signature values, certificates, cryptography, or trust. It does not execute a transform or predict an Office client's effective coverage.
Evidence and use
The 72-test suite includes valid Reference/@Id and Reference/@Type cases, plus unknown Reference and DigestMethod attributes on both the package-object binding and ordinary manifest paths. The public OOXML Signature Security artifacts provide 29 DOCX fixtures: 21 XML signature parts parse successfully, with 222 XMLDSIG references (URI alone 161 times; Type plus URI 61 times) and 243 DigestMethod elements carrying only Algorithm. All captured corpus outcomes, including two expected parser failures, match 0.61 byte-for-byte.
That compatibility result is expected: the new guard rejects only attribute shapes absent from the public corpus. It is still important evidence that the stricter declaration boundary does not reinterpret known signed-document fixtures.
Two independent epoch-fixed builds were byte-identical. SHA-256: wheel 3667fa38e0596ba177805417003dfdeec6fadee408c5eca8f81f3707191cadc5; source distribution a5f0645f614520a5723c37938bf694dc76bfb3ee312ed2b6de68924b0cce67c3.
python -m pip install https://github.com/SybilGambleyyu/docfence/releases/download/v0.62.0/docfence-0.62.0-py3-none-any.whl
docfence check approved.docx candidate.docx --policy docfence.yml --format sarif --output docfence.sarif
The tagged policy reference, threat model, and validation notes define the boundary. A static coverage claim should not grant meaning to declaration markup it does not understand.