jaleelsyed / fx-local

0 stars 0 forks source link

ABAC_Level1 on POST:/api/v1/users/team-sign-up #310

Open jaleelsyed opened 11 months ago

jaleelsyed commented 11 months ago

Title: ABAC_Level1 Vulnerability on POST:/api/v1/users/team-sign-up Project: NB latest API Description: The ABAC exploit allows an attacker to read, modify, delete, add and perform actions on customer/un-authorized data.

Assertion Name: Attribute Based Access Control 1 (ABAC) ( 1 )

Overview: Access Control (or Authorization) is the process of granting or denying specific requests from a user, program, or process. Access control also involves the act of granting and revoking those privileges. Attribute Based Access Control (ABAC) will grant or deny user requests based on arbitrary attributes of the user and arbitrary attributes of the object, and environment conditions that may be globally recognized and more relevant to the policies at hand.

'Attribute-based-access-control 1' identifies top-level/non-dependent resource/data/record vulnerabilities. Looks for private user/account data being illegally read, written, updated, deleted or operated by other users or tenants or accounts.

This scanner requires a private-account/user to create private data/resources e.g. UserA. And it also requires other users who shouldn't have any access to UserA's data like UserB, UserC, & UserD based on your App multi-tenancy model. e.g. UserA can be a user from tenant/org-a and UserB can be a user in tenant-b and UserC can be a user in tenant-c with admin privileges.

APIs tend to expose endpoints that handle object identifiers, creating a wide attack surface Level Access Control issue. Object-level authorization checks should be considered in every function that accesses a data source using input from the user.

Severity: OWASP 2019 API Top 10 ranks ABAC vulnerabilities at Top 1 position and is named Broken Object Level Authorization. ( 2 )

Vulnerability Impact: With flawed or broken ABAC security control policy in place, The following are some of the consequences.

Exploitation: Attackers can exploit API endpoints that are vulnerable to broken object level authorization by manipulating the ID of an object that is sent within the request. This may lead to unauthorized access to sensitive data. This issue is extremely common in API-based applications because the server component usually does not fully track the client’s state, and instead, relies more on parameters like object IDs, that are sent from the client to decide which objects to access.

Remediation: The following techniques may be checked for ensuring RBAC is in place ( 2 ) ( 3 ) ( 4 ).
References:
  1. Enforce Access Controls - https://owasp-top-10-proactive-controls-2018.readthedocs.io/en/latest/c7-enforce-access-controls.html
  2. OWASP 2019 API Top 10 - https://github.com/OWASP/API-Security/raw/master/2019/en/dist/owasp-api-security-top-10.pdf
  3. OWASP Access Control Cheat Sheet - https://cheatsheetseries.owasp.org/cheatsheets/Access_Control_Cheat_Sheet.html
  4. OWASP REST Security Cheat Sheet - https://cheatsheetseries.owasp.org/cheatsheets/REST_Security_Cheat_Sheet.html

Risk: ABAC_Level1 Severity: High API Endpoint: http://netbanking.apisec.ai:8080/api/v1/users/team-sign-up Environment: Master Playbook: ApiV1UsersTeamSignUpPostUseraCreateUsersUsercDisallowAbac Researcher: [apisec Bot]

QUICK TIPS

Suggestion: Add access-control checks on incoming requests against all data calls. Effort Estimate: 4.0 Hrs Wire Logs: 08:16:49 [D] [ UCUAIAbac] : Endpoint [http://netbanking.apisec.ai:8080/api/v1/users/personal-sign-up] 08:16:49 [D] [ UCUAIAbac] : Method [POST] 08:16:49 [D] [ UCUAIAbac] : Authorization [UserA] 08:16:49 [D] [ UCUAIAbac] : Request headers [[Content-Type:"application/json", Accept:"application/json", Authorization:"Bearer "]] 08:16:49 [D] [ UCUAIAbac] : Request [{ "accountNonExpired" : false, "accountNonLocked" : false, "company" : "Frami-Frami", "createdBy" : "", "createdDate" : "", "credentialsNonExpired" : false, "email" : "dillan.kessler@apisec.ai", "enabled" : false, "id" : "", "inactive" : false, "jobTitle" : "Technology Officer", "location" : "0ToPjMCp", "modifiedBy" : "", "modifiedDate" : "", "name" : "0ToPjMCp", "password" : "RxJinuGJDBZ(", "privileges" : [ "0ToPjMCp" ], "username" : "deborah.collins", "version" : "" }] 08:16:49 [D] [ UCUAIAbac] : Status code [200] 08:16:49 [D] [ UCUAIAbac] : Response headers [[X-Content-Type-Options:"nosniff", X-XSS-Protection:"1; mode=block", Cache-Control:"no-cache, no-store, max-age=0, must-revalidate", Pragma:"no-cache", Expires:"0", X-Frame-Options:"DENY", Content-Type:"application/json;charset=UTF-8", Transfer-Encoding:"chunked", Date:"Thu, 23 Nov 2023 08:16:48 GMT"]] 08:16:49 [D] [ UCUAIAbac] : Response [Hidden]. //To view the response set 'showResponse: true' under policies 08:16:49 [D] [ UCUAIAbac] : Response time [460] 08:16:49 [D] [ UCUAIAbac] : Response size [205] 08:16:49 [I] [ UCUAIAbac] : Assertion [@StatusCode == 200 OR @StatusCode == 201 OR @Response.errors != true] resolved-to [200 == 200 OR 200 == 201 OR true != true] result [Passed] 08:16:49 [D] [UCUAIAHeaders] : Headers [[X-Content-Type-Options:"nosniff", X-XSS-Protection:"1; mode=block", Cache-Control:"no-cache, no-store, max-age=0, must-revalidate", Pragma:"no-cache", Expires:"0", X-Frame-Options:"DENY", Content-Type:"application/json;charset=UTF-8", Transfer-Encoding:"chunked", Date:"Thu, 23 Nov 2023 08:16:48 GMT"]] 08:16:49 [D] [UCUAIAHeaders] : Headers [[X-Content-Type-Options:"nosniff", X-XSS-Protection:"1; mode=block", Cache-Control:"no-cache, no-store, max-age=0, must-revalidate", Pragma:"no-cache", Expires:"0", X-Frame-Options:"DENY", Content-Type:"application/json;charset=UTF-8", Transfer-Encoding:"chunked", Date:"Thu, 23 Nov 2023 08:16:48 GMT"]] 08:16:49 [D] [ UCUAIA]] : Headers [[X-Content-Type-Options:"nosniff", X-XSS-Protection:"1; mode=block", Cache-Control:"no-cache, no-store, max-age=0, must-revalidate", Pragma:"no-cache", Expires:"0", X-Frame-Options:"DENY", Content-Type:"application/json;charset=UTF-8", Transfer-Encoding:"chunked", Date:"Thu, 23 Nov 2023 08:16:48 GMT"]] 08:16:49 [D] [ UCUAIA]] : Headers [[X-Content-Type-Options:"nosniff", X-XSS-Protection:"1; mode=block", Cache-Control:"no-cache, no-store, max-age=0, must-revalidate", Pragma:"no-cache", Expires:"0", X-Frame-Options:"DENY", Content-Type:"application/json;charset=UTF-8", Transfer-Encoding:"chunked", Date:"Thu, 23 Nov 2023 08:16:48 GMT"]] 08:16:49 [D] [AVUTSUPUCUUDAbac] : Endpoint [http://netbanking.apisec.ai:8080/api/v1/users/team-sign-up] 08:16:49 [D] [AVUTSUPUCUUDAbac] : Method [POST] 08:16:49 [D] [AVUTSUPUCUUDAbac] : Authorization [UserC] 08:16:49 [D] [AVUTSUPUCUUDAbac] : Request headers [[Accept:"application/json", Content-Type:"application/json", Authorization:"Bearer "]] 08:16:49 [D] [AVUTSUPUCUUDAbac] : Request [{ "accountNonExpired" : false, "accountNonLocked" : false, "company" : "Gerlach and Sons", "createdBy" : "", "createdDate" : "", "credentialsNonExpired" : false, "email" : "zetta.fritsch@apisec.ai", "enabled" : false, "id" : "None", "inactive" : false, "jobTitle" : "District Liaison", "location" : "h3t6OBrb", "modifiedBy" : "", "modifiedDate" : "", "name" : "h3t6OBrb", "password" : "tEKEueiAUPD_", "privileges" : [ "h3t6OBrb" ], "username" : "verla.weissnat", "version" : "" }] 08:16:49 [D] [AVUTSUPUCUUDAbac] : Status code [200] 08:16:49 [D] [AVUTSUPUCUUDAbac] : Response headers [[X-Content-Type-Options:"nosniff", X-XSS-Protection:"1; mode=block", Cache-Control:"no-cache, no-store, max-age=0, must-revalidate", Pragma:"no-cache", Expires:"0", X-Frame-Options:"DENY", Content-Type:"application/json;charset=UTF-8", Transfer-Encoding:"chunked", Date:"Thu, 23 Nov 2023 08:16:48 GMT"]] 08:16:49 [D] [AVUTSUPUCUUDAbac] : Response [Hidden]. //To view the response set 'showResponse: true' under policies 08:16:49 [D] [AVUTSUPUCUUDAbac] : Response time [220] 08:16:49 [D] [AVUTSUPUCUUDAbac] : Response size [193] 08:16:49 [E] [AVUTSUPUCUUDAbac] : Assertion [@StatusCode == 401 OR @StatusCode == 403 OR @StatusCode == 404 OR @Response.errors == true] resolved-to [200 == 401 OR 200 == 403 OR 200 == 404 OR false == true] result [Failed]

IMPORTANT LINKS

Vulnerability Details: https://cloud.apisec.ai/#/app/vulnerabilities/projects/8adc81a88538ca6e01853ab1f1a31dc5/dashboard/8adc869e8bf9db68018bfb40d8af51db/details

Project: https://cloud.apisec.ai/#/app/projects/8adc81a88538ca6e01853ab1f1a31dc5/dashboard

Environment: https://cloud.apisec.ai/#/app/config-environments/projects/8adc81a88538ca6e01853ab1f1a31dc5/environmentList

Scan Dashboard: https://cloud.apisec.ai/#/app/projects/8adc81a88538ca6e01853ab1f1a31dc5/profiles/8adc80b08538cdab01853ab21b0a05a2/runs/8adc83ae8bec072e018bfb351c3b417f

Playbook: https://cloud.apisec.ai/#/app/projects/8adc81a88538ca6e01853ab1f1a31dc5/playbooks/ApiV1UsersTeamSignUpPostUseraCreateUsersUsercDisallowAbac

Coverage: https://cloud.apisec.ai/#/app/config-categories/projects/8adc81a88538ca6e01853ab1f1a31dc5/categories

Code Sample: https://cloud.apisec.ai/#/app/vulnerabilities/projects/8adc81a88538ca6e01853ab1f1a31dc5/dashboard/8adc869e8bf9db68018bfb40d8af51db/codesamples

PS: Please contact support@apisec.ai for apisec access and login issues.

--- apisec Bot ---