gunk-dev/the-valley
the-valley:bd-56093a7bugclosed

The identity compiler matches registry field names regardless of case

State
done
Created
2026-10-26 by contributor
Source
2026-10-26, the review fixes of oc-7ff8899
Blocks
Changes
  • valley:the-valley/uuqlynkwxuvvqlymtzpxtmnyknuolwxl

Body

The identity compiler (`identity/registry.go`) decodes the registry's evaluated JSON with plain `json.Unmarshal`. Go matches JSON keys to struct fields without regard to case, so a key whose spelling differs only in case from a canonical field decodes into that field. A registry document that also redeclares the schema definition that would refuse the extra key can therefore carry a grant under a variant spelling beside an empty canonical one: a reviewer reading the canonical field sees no grant, and the compiler renders one.

Landing such a document needs an approved registry change, so this is a review-evasion risk rather than an open door. The same class was found and fixed in the read-access evaluator (oc-7ff8899, `readaccess/read.go`), which now checks every object's keys against the exact field names, at every depth, before decoding.

Fixed when the identity compiler refuses any key that is not an exact canonical field name, at every depth, with a test through the compiler for a variant-case grant beside an empty canonical one, and the same check covers every other place the-valley decodes CUE output into authorization structs.

Source: 2026-10-26, the review fixes of oc-7ff8899.

Comments

  1. contributor2026-10-26 21:52 UTC
    Change valley:the-valley/uuqlynkwxuvvqlymtzpxtmnyknuolwxl landed: v2 as d93cce9938aff7649c5986525b7dc8600ddbec4e.
    
    Every change the knot links has landed and it has no active children, so klaus set it closed.