Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Secuirty Issue with GetRolesByUser function (DNN 4.3.3/3.3.3)Secuirty Issue with GetRolesByUser function (DNN 4.3.3/3.3.3)
Previous
 
Next
New Post
7/22/2006 10:43 PM
 
Just wondering if anyone has noticed that the function GetRolesByUser from the namespace DotNetNuke.Security.Roles.RoleController returns all the available system roles when UserID = -1 (Anonymous User)

For example:

calling GetRolesByUser(UserId, PortalId)

return array of roles Administrators,Registered Users,Subscribers

where UserId = -1 and PortalId = 0

in this case I only have 3 roles in the system.

In 3.2.2 the same function call caused an exception, however with 4.3.3 it returns all the roles available in the portal. 

This is certainly a security concerm for any existing modules that used this function. 






Enterprise Forms for DotNetNuke

Version Control, Forms and Workflow Suite

 
New Post
7/23/2006 12:30 AM
 

Actually, this is not a security issue at all.  The list of roles is readily available from a simple database query.  Given the current architecture, there is no way to prevent a module that wants this information from obtaining it.  This is more a concern since it is a change in the behavior of the API which might break modules which were designed to take advantage of the previous exception.

EDIT:  After re-reading the original post.  This is certainly something we will want to fix.   I will raise this with the security team.


Joe Brinkman
DNN Corp.
 
New Post
7/23/2006 12:56 AM
 
Thanks Joe.

I should have emphasize on the fact that calling this function for an Anonymous User essentially gives you the same security roles as an Administrator of the portal.



Enterprise Forms for DotNetNuke

Version Control, Forms and Workflow Suite

 
New Post
7/24/2006 1:05 PM
 
I'll admit there is a behaviour change here.

However, from a core security perspective, there are no security implications as the core security method PortalSecurity.IsInRoles(roles) requires an authenticated user, and checks explicitly the roles of that authenticated user.

The only possibility for security issues to appear in 4.3.3 (that are not there in earlier versions) is if a module developer uses their own security checks (based on the results of the GetRolesByUser method) rather than the core methods - PortalSecurity.IsInRoles(roles).

Hope this clarifies things.

Charles Nurse
Chief Architect
Evoq Content Team Lead,
DNN Corp.

Want to contribute to the Platform project? - See here
MVP (ASP.NET) and
ASPInsiders Member
View my profile on LinkedIn
 
New Post
7/24/2006 8:40 PM
 
It is clear that this is not a core security issue, however from a wider perspective this is an issue for a module developer using the GetRolesByUser method on the assumption that it will return the correct roles whether the user is authenticated or unauthenticate.   Correct me if I'm wrong,  there is no pre-condition that the GetRolesByUser method will only return correct list of portal roles for authenticated users.

From a module developer point of view,
GetRolesByUser and PortalSecurity.IsInRoles are core methods as they are available publicly availabe for use by any module. 

Unless the
GetRolesByUser method is made deprecated or documented somehow, chances are module developers will see and use the method like any other core API.





Enterprise Forms for DotNetNuke

Version Control, Forms and Workflow Suite

 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Secuirty Issue with GetRolesByUser function (DNN 4.3.3/3.3.3)Secuirty Issue with GetRolesByUser function (DNN 4.3.3/3.3.3)


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out