Bind extension config file hashes in the manifest projection#79
Merged
Conversation
Three auxiliary files drive integrity-significant rendered output —
academic/numbering.json supplies cross-reference numbers, and
semantic/bibliography.json and semantic/glossary.json supply rendered
citations and definitions — yet the manifest referenced each by path only,
with no hash. They were therefore in neither the document hash nor the
signed manifest projection: a repackager could renumber, re-cite, or
redefine a frozen or signed document, silently changing what it displays,
while every signature still verified and the document id was unchanged.
Declare these references as {path, hash} objects and bind their hashes
through the manifest projection. The binding is generic: the projector
collects every {path, hash} reference declared in an extension config slot
— keyed on the shape, not on a field name — into a sorted, deduplicated
configFiles set, so a manifest-covering signature now attests each file's
content and a newly defined hashed config file is covered without changing
the projector. Advisory configuration that is not a file reference is left
unbound. A document-ID-only verifier, or a document with no manifest-
covering signature, still sees these files unauthenticated.
The academic and semantic config schemas now require the {path, hash}
shape; the manifest-projection normative definition (security §9.7/§9.8),
the integrity-status disclosures, and the example manifests are updated to
match, and the example loader verifies each declared config-file hash
against the file's bytes. No example document id moves — config slots are
outside the document id — and both signed manifest projections are
unchanged, since neither declares a config file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
academic/numbering.json(cross-reference numbers),semantic/bibliography.jsonandsemantic/glossary.json(rendered citations/definitions) — yet the manifest referenced each by path only, with no hash. They were in neither the document hash nor the signed manifest projection, so a repackager could renumber, re-cite, or redefine a frozen/signed document while every signature still verified and the document id was unchanged.{path, hash}objects and bind their hashes through the manifest projection. The binding is generic: the projector collects every{path, hash}reference declared in an extension config slot — keyed on the shape, not on a field name — into a sorted, deduplicatedconfigFilesset, so a manifest-covering signature now attests each file's content and a newly defined hashed config file is covered without changing the projector. Advisory configuration that is not a file reference is left unbound.Re-freeze
configFilesis omitted (never emitted empty).Test plan
npm test(now also verifies config-file declared hashes against the real files),npm run test:canonicalize.config-file-references(expected JCS + sha256 independently derived) + a conflicting-hash error vector;check:manifest-projectiongreen and both signed projections unmoved.check:manifest-extension-configrequires{path,hash}(bare-string and missing-hash rejection vectors).validate:examplesexit 1.npm ci(verified by exit code);npx tsc --noEmitclean;npm audit0 high.