Summary

  • RFC 9596 registers the protected COSE typ parameter so an application can tell the type of the complete COSE object apart from the content type of its payload.
  • The COSE library hands typ to the application and never interprets it. A matching label becomes security evidence only when the application binds it to mutually exclusive validation, key and authorization rules.

Two green checks, and the control plane gets to work. The signature verifies. The protected header says exactly what the object claims to be. Somewhere downstream a handler is chosen, a queue fills, a state changes — and nobody asks the one question that matters: who said this label was allowed to mean anything?

RFC 9596 answers a narrower question than it looks. It adds typ, header label 16, so an application that can receive several flavours of COSE object can tell them apart. Then it deliberately stops. The generic COSE library is not appointed judge of what the label means. It passes the value through; the application decides which values it expects, which are missing, which are wrong, and which must be thrown back.

The gap is a few bytes wide and an entire authority structure deep. A protected declaration can name a class of object. It cannot hand that class permission to act.

The complete object and its payload wear different labels

COSE already had a content type header. RFC 9052 defines it as the type of the data sitting in the payload or ciphertext field. RFC 9596 adds a different sentence entirely: typ declares the type of the complete COSE object.

The distinction earns its keep the moment one envelope can carry another. A signed security event wraps a structured payload. A token turns up inside a larger message. A relying application accepts several signed object families whose payloads are all CBOR. Saying “the payload is application/cbor” tells you nothing about whether the outer object is an authorization request, an attestation result, a receipt or a status ping.

RFC 9596 reuses the content-type value syntax — an unsigned integer from the CoAP Content-Formats registry, or a text media type with optional parameters. Shared syntax, separate meaning. One field classifies the complete COSE object; the other classifies what it carries inside.

So an evidence system should keep both exact received values and both locations. Normalise them into a single media label and you have destroyed the only record of whether the sender typed the envelope, the payload, or both. A later investigation then reconstructs a security decision that no component ever made.

Protection makes the declaration tamper-evident, not self-enforcing

RFC 9596 forbids typ in unprotected headers. In any COSE construction that authenticates the protected-header bucket, editing the type value breaks verification. An intermediary can no longer rewrite the declared object class and keep the signature.

Integrity, though, is not interpretation. The RFC says implementations ignore typ except to pass it up to the application, and that all processing is application-specific. A library will happily return “signature valid” alongside a protected type value while knowing nothing about whether the endpoint accepts that type, whether the profile demands the parameter, or which claims must follow it.

That is the operational fault line. A protected field proves the field travelled inside the authenticated structure. It does not prove the field is true. A signer can faithfully sign a false label, an obsolete alias, a type meant for a different endpoint, or the right type wrapped around the wrong payload.

The application supplies the missing rules. RFC 9596 says an application using explicit typing should reject an unexpected value, and should reject absence when a type is expected. Those two rejection paths are the security mechanism. Rendering typ in a decoded-object viewer is not adoption; it is decoration.

Explicit typing closes one confusion path, not every substitution path

RFC 9596 imports the explicit-typing argument from RFC 8725, the JWT best-current-practices document. That guidance describes how one token kind gets mistaken for another and recommends distinct typ values for new uses. Then it adds the harder clause: validation rules for different token kinds must be mutually exclusive.

Which is why a type allow list cannot stand alone. Give an endpoint two accepted COSE object types, route both through the same claims parser, trust the same keys with no purpose restriction, apply the same audience defaults — and the labels differ while the acceptance surface stays shared. An object of one class can satisfy enough generic checks to reach an action built for the other.

A branch worth the name binds the type to its whole contract: allowed structure, required protected fields, payload content type, required claims, issuer, audience, key purpose, freshness, replay handling, endpoint, permitted operation. A wrong type must fail before shared business logic smears the distinction away. A missing type must not quietly inherit a default when the profile asked for explicit typing.

RFC 8725 also warns that explicit typing may not separate you from older token kinds whose validators ignore typ altogether. That warning transfers to COSE without losing a beat. Labelling the sender does not upgrade a single receiver. Migration evidence needs the receive-side rule version, not a count of freshly labelled objects.

Registries coordinate names; they do not decide trust

IANA records typ as COSE header label 16 and points value interpretation at the CoAP Content-Formats and Media Types registries. That buys a shared namespace and a compact representation. It does not turn every registered media type into an accepted application object.

A registry answers whether a number or a name has an assigned meaning. It cannot answer whether this endpoint enabled the type, whether this signer may use it, whether the chosen media-type parameters are permitted, or whether the payload conforms. Registration is a coordination fact. Acceptance stays local.

This is Minimum Initial Specification doing real work: the common layer fixes a protected place for the declaration and an interoperable value syntax, and the future decision stays with the application profile and the deployed validator. Voluntary adoption becomes observable only when receivers enforce distinct rules and reject the wrong branch.

The trouble starts when a central inventory gets promoted from “known type” to “trusted type.” A platform team may keep a global catalogue for discovery; every use still needs endpoint-specific policy. Otherwise one newly registered type quietly expands the authority of every generic consumer that mistakes catalogue membership for permission.

A clean evidence chain keeps the green checks apart

For every received object, keep: a digest of the received bytes; the COSE structure kind; the protected-header bytes; the exact typ value and its representation; the exact payload content type; endpoint and operation; the expected type set; the validator-policy version; the cryptographic result; key identifier and authorized purpose; payload parse result; required-claim result; issuer and audience checks; replay and freshness result; the authorization decision; the dispatched handler; and the observed effect.

None of that is redundant logging. Each line settles a different argument. A valid signature establishes a bounded cryptographic relation. A matching typ establishes that the declared object class was the one expected in that context. A successful parse establishes syntax. Profile validation establishes the required semantics. Key policy establishes that the signer was entitled to this class of object. Local authorization establishes that the operation may proceed now. The application result establishes what actually happened.

Do not ask the COSE library to speak for the final action. Do not ask the media-type registry to speak for a key. Do not ask a valid signature to repair a missing audience. Each component should issue only the receipt it can actually observe.

That is reality layers in miniature. Symbolic power accumulates the moment a compact label appears to settle everything downstream. Running-code primacy reverses the order: the label proposes a branch, deployed validation proves the branch was enforced, and the resulting action remains a later fact.

Sources