Skip to content

CMDB cross-check limits: keys of ~996+ chars, match-scope keys, root-only channels #60

Open

Description

@djbclark

Limits of the CMDB cross-check in bundle common tendcf_cmdb (policy/tendcf_services.cf, #42), found by the round-3 adversary review. None changes what actuates today. Each should either be bounded in policy or documented in the header's "not a sandbox" paragraph:

  1. I1: per-key problem classes are dropped for identifier keys of about 996 or more characters. EvalContextClassPutTagsSet (eval_context.c) skips class names of 1024 or more characters, and the loader accepts an lval up to CF_MAXVARSIZE (1024). For such a key, _partial_K, _differs_K and _uncomparable_K never fire. The aggregate missing/unlisted classes still do. Fix: bound keys in the key grep ([A-Za-z0-9_]{1,64}), or accept only the two keys the policy reads.
  2. I2: a CMDB key in the match scope (e.g. match.0) goes to ctx->match_variables, which variablesmatching() does not walk, so _foreign_var cannot see it. The file-side _badkey catches it outside a file-swap race.
  3. I4: root-only channels the check does not model: cf-agent -N tendcf_cmdb_refused / -D interlock_ok_<id>, persistent classes (source=persistent), and other policy files that write data:variables.* or define interlock_ok_*. Name -N and persistent classes in the header explicitly.

Source: https://github.com/djbclark/core/tree/b8abf28408b1b54e285d372a9bc5f2d850c960ad (the pinned fork).

🤖 Generated with Claude Code

Activity

  1. djbclark commented on Nov 14, 2026

    @djbclark
    CollaboratorAuthor

    Round-4 adversary review at 5a2228d (#42 adds tendcf_cmdb_json_same_<k> and tendcf_cmdb_problem_noverdict_<k>) adds two points to this issue:

    1. I1 extended. The per-key class prefixes now differ in length, so each class is dropped from a different key length L upward:

      1. uncomparable: L >= 991.
      2. noverdict: L >= 994.
      3. differs and partial: L >= 996.
      4. json_same: L >= 1002.

      For L of 994 or 995, a no-verdict comparison of the key has no class at all. The aggregate classes still fire, and nothing changes in what actuates. Bounding the key grep to [A-Za-z0-9_]{1,64}, or accepting only the two keys the policy reads, fixes every case.

    2. I4 extended. cf-agent -D tendcf_cmdb_json_same_<k>, or a persistent class of that name from another policy, keeps noverdict_<k> unset. It needs root, and it is weaker than -N tendcf_cmdb_refused. List it with the other root-only channels.

    The adversary also noted that the header's claim "a split file would still fail closed" was not traced through loading.c. Re-test it if the file is ever split.

    🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions