0

I am using Symfony2 and its ACL security component in my project. I want to use the ACL information in the frontend framework for show/hide elements.

Would it be a terrible idea security wise to attach formated ACL information for current user on current object?

Lets say the user has permission to VIEW and EDIT object, so the JSON data would look like this:

{
  "id": 1,
  "name": "Product",
  "_permissions": ["VIEW", "EDIT"]
}

What security holes this solution can potentially cause?

andrius.k
  • 799
  • 1
  • 10
  • 26

1 Answers1

0

I don't think there is a security problem. You will agree that it can not be a problem to have the id and type of the object in your data :-). So the only thing we should take a look at are the VIEW and EDIT attributes. These values are not a secret. They are part of the Symfony documentation. So it's only about the information if you have these permissions for that object.

If you return that JSON together with your data I think, the VIEW attribute is actually no additional information as it would not be returned if you would not have the VIEW permission. So the only information you provide here is if the user can edit that object.

If you think about it you will agree that you would provide the same information if you would on server side decide based on permissions if you add an edit link for that object to a html page or not.

So if you do an isGranted("EDIT", $product) to decide if you return that EDIT as part of your JSON I can not see any security hole there.

Hongbin Wang
  • 1,186
  • 2
  • 14
  • 34
Carsten Ulrich
  • 179
  • 1
  • 4