Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

we should validate server ACLs against a schema to stop people uploading mangled ones and locking themselves out #5469

Open
ara4n opened this issue Jun 16, 2019 · 5 comments
Labels
T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements. z-p2 (Deprecated Label)

Comments

@ara4n
Copy link
Member

ara4n commented Jun 16, 2019

No description provided.

@richvdh
Copy link
Member

richvdh commented Jun 18, 2019

The problem with this is that there's not much to validate. As per the spec, all the fields are optional.

Of course, a server could reject attempts to set an ACL which would lock itself out. But that's different from validating against a schema.

(Incidentally, event validation in general is the topic of MSC1646, which has stalled somewhat)

@richvdh richvdh closed this as completed Jun 18, 2019
@richvdh richvdh reopened this Jun 18, 2019
@turt2live
Copy link
Member

in this case the user doubly-nested their ACL:

{
  "content": {
     "content": {
        "allow": ["*"]
     }
  }
}

@richvdh
Copy link
Member

richvdh commented Jun 18, 2019

yup, so it was valid, but missing the allow field.

(in general, I feel like we missed a few tricks when we specced m.room.server_acl. The fact that subdomains aren't included implicitly is probably more annoying than the fact the default value for allow is <empty> rather than *.)

@turt2live
Copy link
Member

we could probably do some simple sanity validation on the event for the common cases: If the object is empty or has at least one of the spec fields, allow it. Would prevent accidental setting of ACLs with nested content (content is not a valid field, the object is non-empty, and there are no other fields from the spec in the object) and similar accidents. Empty objects and objects with at least one of the fields would be valid enough to send through though.

@neilisfragile neilisfragile added enhancement z-p2 (Deprecated Label) labels Jun 20, 2019
@richvdh
Copy link
Member

richvdh commented Jul 14, 2020

I feel like just checking that you're not banning yourself (as per #4042) would cover 95% of the problem here.

@DMRobertson DMRobertson added T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements. and removed z-enhancement labels Aug 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements. z-p2 (Deprecated Label)
Projects
None yet
Development

No branches or pull requests

5 participants