WICG / WICG/webpackage

Spec makes it difficult to distinguish signed and unsigned parameters

Open
#434 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
1.3k
Forks
125
PR merge metrics
No merged PRs in 30d

Description

The Signature header makes use of Structured Headers to encapsulate a number of parameters.

However, the structural layout of the specification makes it difficult to easily determine what parameters are signed and unsigned. Through a careful reading, it would appear that only cert-url is unsigned.

This came up when trying to evaluate the proposal in #397 to understand the assurance level of different fields, at different points within the algorithm. For example, the current algorithm for validating a signature would appear to be making use of a signed field before the signature has actually been verified.

A few thoughts come to mind to help simplify this:

  • In the discussion of the parameters that participate in the signature, clearly indicate whether each parameter is covered by the 'sig' or not.
  • In the discussion of validation algorithms, either
    1. Ensure that signature validation is consistently performed before any accesses to unvalidated data
    2. Use descriptive labels to indicate the level of assurance that each field as. For example, unverified-validityUrl becomes signed-validityUrl after the signature has been checked, while integrity becomes unverified-integrity, transitions to signed-integrity after signature validation, and becomes verified-integrity after the (certificate and revocation) checks.

The idea here is to try to encapsulate, in the spec, the state machine that each of these variables goes through, so that it's clear whether we're operating on 'untrusted' (not yet signature checked / certificate checked) data or after. While an implementation may simply use the same variable throughout the implementation, the annotations help highlight the assurance. This also helps for future spec changes, because any reordering of sequences would cascade into re-evaluating the labels for any variables.

Or this might all be a terrible idea, but it was definitely hard to read and reason about the algorithm without knowing clearly whether the variables were signed and when/if they'd been validated.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read the Signature header section in draft-yasskin-http-origin-signed-responses.md and the validation algorithm around loading.bs#L775. Trace which parameters are signed, unsigned, and accessed before verification, then choose and document a consistent assurance model. Done means the specification makes parameter coverage and validation state unambiguous.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.