Skip to content

cf-serverd: Fixed classic CONTEXT reply including non-admitted classes - #6437

Open
Dhanu-dynamic wants to merge 1 commit into
cfengine:masterfrom
Dhanu-dynamic:classic-context-acl-per-class
Open

Dhanu-dynamic wants to merge 1 commit into
cfengine:masterfrom
Dhanu-dynamic:classic-context-acl-per-class

Conversation

@Dhanu-dynamic

Copy link
Copy Markdown
Contributor
  1. ContextAccessControl() in cf-serverd/server_classic.c answers the classic CONTEXT/SCONTEXT request (sent by remoteclassesmatching()) by checking every persistent class that matches the client's regex against the access rules, but access was declared once for the whole loop and never reset.
  2. So once one class is admitted by a resource_type => "context" rule, every later class matching the regex is returned too, including classes no rule admits. A host allowed via allowlegacyconnects can send CONTEXT .* and read persistent classes it was never granted. The TLS CONTEXT handler already checks each class on its own via acl_CheckRegex().
  3. access is now scoped to each class. The new test in tests/unit/protocol_test.c fails before the change (the unadmitted class is returned) and passes after.

ContextAccessControl() answers the classic CONTEXT/SCONTEXT request
(sent by remoteclassesmatching()) by checking every persistent class
that matches the client's regex against the access rules. The access
flag was declared once for the whole loop and never reset, so after
one class was admitted by a resource_type => "context" rule, every
later matching class was returned as well, including classes that no
rule admits. The TLS CONTEXT handler already checks each class on its
own via acl_CheckRegex().

Changelog: Title
Signed-off-by: Dhanraj E <dhanraj@labs.digiscrypt.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant