muqeetkhan20 / JuneSanity

0 stars 0 forks source link

ABAC_Level1 on GET:/api/v1/transfers/{id} #178

Closed muqeetkhan22 closed 3 years ago

muqeetkhan22 commented 3 years ago

Title: ABAC_Level1 Vulnerability on GET:/api/v1/transfers/{id} Project: Sanity 21st June 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://95.217.118.53:8080/api/v1/transfers/2c928084798f5175017a615b1c3f5855 Environment: Master Playbook: ApiV1TransfersIdGetUseraCreateTransfersUsercDisallowAbac Researcher: [apisec Bot] QUICK TIPS Suggestion: Add access-control checks on incoming requests against all data calls. Effort Estimate: 2.0 Hrs Wire Logs: 09:16:38 [D] [ TCUAIAbac] : Endpoint [http://95.217.118.53:8080/api/v1/transfers] 09:16:38 [D] [ TCUAIAbac] : Method [POST] 09:16:38 [D] [ TCUAIAbac] : Authorization [UserA] 09:16:38 [D] [ TCUAIAbac] : Request headers [[Content-Type:"application/json", Accept:"application/json", Authorization=[**********]}] 09:16:38 [D] [ TCUAIAbac] : Request [{ "confirmed" : false, "createdBy" : "", "createdDate" : "", "description" : "IUzyEJW8", "id" : "", "inactive" : false, "location" : "IUzyEJW8", "modifiedBy" : "", "modifiedDate" : "", "transactionType" : "ATM", "version" : "" }] 09:16:38 [D] [ TCUAIAbac] : Status code [200] 09:16:38 [D] [ TCUAIAbac] : 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", Set-Cookie:"SESSION=YzhlMTE3NTktOGQ3YS00YmY0LTkwMjctZDMwNjBiZmYwODQz; Path=/; HttpOnly", Content-Type:"application/json;charset=UTF-8", Transfer-Encoding:"chunked", Date:"Thu, 01 Jul 2021 09:16:38 GMT"]] 09:16:38 [D] [ TCUAIAbac] : Response [{ "requestId" : "None", "requestTime" : "2021-07-01T09:16:38.855+0000", "errors" : false, "messages" : [ ], "data" : { "id" : "2c928084798f5175017a615b1c3f5855", "createdBy" : "2c928084798f51750179936327d90752", "createdDate" : "2021-07-01T09:16:38.847+0000", "modifiedBy" : "2c928084798f51750179936327d90752", "modifiedDate" : "2021-07-01T09:16:38.847+0000", "version" : null, "inactive" : false, "location" : "IUzyEJW8", "description" : "IUzyEJW8", "confirmed" : false, "transactionType" : "ATM" }, "totalPages" : 0, "totalElements" : 0 }] 09:16:38 [D] [ TCUAIAbac] : Response time [332] 09:16:38 [D] [ TCUAIAbac] : Response size [483] 09:16:38 [I] [ TCUAIAbac] : Assertion [@StatusCode == 200 OR @Response.errors != true] resolved-to [200 == 200 OR false != true] result [Passed] 09:16:38 [D] [TCUAIAHeaders] : 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", Set-Cookie:"SESSION=YzhlMTE3NTktOGQ3YS00YmY0LTkwMjctZDMwNjBiZmYwODQz; Path=/; HttpOnly", Content-Type:"application/json;charset=UTF-8", Transfer-Encoding:"chunked", Date:"Thu, 01 Jul 2021 09:16:38 GMT"]] 09:16:38 [D] [TCUAIAHeaders] : 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", Set-Cookie:"SESSION=YzhlMTE3NTktOGQ3YS00YmY0LTkwMjctZDMwNjBiZmYwODQz; Path=/; HttpOnly", Content-Type:"application/json;charset=UTF-8", Transfer-Encoding:"chunked", Date:"Thu, 01 Jul 2021 09:16:38 GMT"]] 09:16:38 [D] [ TCUAIA]] : 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", Set-Cookie:"SESSION=YzhlMTE3NTktOGQ3YS00YmY0LTkwMjctZDMwNjBiZmYwODQz; Path=/; HttpOnly", Content-Type:"application/json;charset=UTF-8", Transfer-Encoding:"chunked", Date:"Thu, 01 Jul 2021 09:16:38 GMT"]] 09:16:38 [D] [ TCUAIA]] : 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", Set-Cookie:"SESSION=YzhlMTE3NTktOGQ3YS00YmY0LTkwMjctZDMwNjBiZmYwODQz; Path=/; HttpOnly", Content-Type:"application/json;charset=UTF-8", Transfer-Encoding:"chunked", Date:"Thu, 01 Jul 2021 09:16:38 GMT"]] 09:16:39 [D] [AVTIGUCTUDAbac] : Endpoint [http://95.217.118.53:8080/api/v1/transfers/2c928084798f5175017a615b1c3f5855] 09:16:39 [D] [AVTIGUCTUDAbac] : Method [GET] 09:16:39 [D] [AVTIGUCTUDAbac] : Authorization [UserC] 09:16:39 [D] [AVTIGUCTUDAbac] : Request headers [[Accept:"application/json", Content-Type:"application/json", Authorization=[**********]}] 09:16:39 [D] [AVTIGUCTUDAbac] : Request [] 09:16:39 [D] [AVTIGUCTUDAbac] : Status code [200] 09:16:39 [D] [AVTIGUCTUDAbac] : 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", Set-Cookie:"SESSION=M2I3OTAyZWYtYWEwZC00M2Y5LWEyOGMtZDQxYmNhYzE0ODQ4; Path=/; HttpOnly", Content-Type:"application/json;charset=UTF-8", Transfer-Encoding:"chunked", Date:"Thu, 01 Jul 2021 09:16:38 GMT"]] 09:16:39 [D] [AVTIGUCTUDAbac] : Response [{ "requestId" : "None", "requestTime" : "2021-07-01T09:16:39.096+0000", "errors" : false, "messages" : [ ], "data" : { "id" : "2c928084798f5175017a615b1c3f5855", "createdBy" : "2c928084798f51750179936327d90752", "createdDate" : "2021-07-01T09:16:38.847+0000", "modifiedBy" : "2c928084798f51750179936327d90752", "modifiedDate" : "2021-07-01T09:16:38.847+0000", "version" : null, "inactive" : false, "location" : "IUzyEJW8", "description" : "IUzyEJW8", "confirmed" : false, "transactionType" : "ATM" }, "totalPages" : 0, "totalElements" : 0 }] 09:16:39 [D] [AVTIGUCTUDAbac] : Response time [230] 09:16:39 [D] [AVTIGUCTUDAbac] : Response size [483] 09:16:39 [E] [AVTIGUCTUDAbac] : Assertion [@StatusCode == 401 OR @StatusCode == 404 OR @Response.errors == true] resolved-to [200 == 401 OR 200 == 404 OR false == true] result [Failed] 09:16:39 [D] [AVTIDTAAbac] : Endpoint [http://95.217.118.53:8080/api/v1/transfers/2c928084798f5175017a615b1c3f5855] 09:16:39 [D] [AVTIDTAAbac] : Method [DELETE] 09:16:39 [D] [AVTIDTAAbac] : Authorization [UserA] 09:16:39 [D] [AVTIDTAAbac] : Request headers [[Content-Type:"application/json", Accept:"application/json", Authorization=[**********]}] 09:16:39 [D] [AVTIDTAAbac] : Request [null] 09:16:39 [D] [AVTIDTAAbac] : Status code [200] 09:16:39 [D] [AVTIDTAAbac] : 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", Set-Cookie:"SESSION=Nzk2MzM4MGItNWRmYi00ZGQ0LWFhMDYtYTYxMjM0MTc0MGJj; Path=/; HttpOnly", Content-Type:"application/json;charset=UTF-8", Transfer-Encoding:"chunked", Date:"Thu, 01 Jul 2021 09:16:38 GMT"]] 09:16:39 [D] [AVTIDTAAbac] : Response [{ "requestId" : "None", "requestTime" : "2021-07-01T09:16:39.425+0000", "errors" : false, "messages" : [ ], "data" : null, "totalPages" : 0, "totalElements" : 0 }] 09:16:39 [D] [AVTIDTAAbac] : Response time [328] 09:16:39 [D] [AVTIDTAAbac] : Response size [139] 09:16:39 [I] [AVTIGUCTUDAbac] : Assertion [@StatusCode == 200] resolved-to [200 == 200] result [Passed] IMPORTANT LINKS Vulnerability Details: https://95.217.198.167/#/app/projects/8a808acb7a2c3455017a2d6ccb164c39/dashboard/8a808ad97a5f835b017a615b1f8469f5/details Project: https://95.217.198.167/#/app/projects/8a808acb7a2c3455017a2d6ccb164c39/allScans Environment: https://95.217.198.167/#/app/projects/8a808acb7a2c3455017a2d6ccb164c39/environments/8a808acb7a2c3455017a2d6ccb1c4c3c/edit Scan Dashboard: https://95.217.198.167/#/app/projects/8a808acb7a2c3455017a2d6ccb164c39/profiles/8a808acb7a2c3455017a2d6ccdc64d3b/runs/8a808ad97a5f835b017a615b0d8869d3 Playbook: https://95.217.198.167/#/app/projects/8a808acb7a2c3455017a2d6ccb164c39/playbooksf/ApiV1TransfersIdGetUseraCreateTransfersUsercDisallowAbac Coverage: https://95.217.198.167/#/app/projects/8a808acb7a2c3455017a2d6ccb164c39/categories Code Sample: https://95.217.198.167/#/app/projects/8a808acb7a2c3455017a2d6ccb164c39/dashboard/8a808ad97a5f835b017a615b1f8469f5/codesamples PS: Please contact support@apisec.ai for apisec access and login issues. --- apisec Bot ---
muqeetkhan22 commented 3 years ago

Message : This issue is manually closed from FX control plane.

Title: ABAC_Level1 Vulnerability on GET:/api/v1/transfers/{id} Project: Sanity 21st June Description:

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://95.217.118.53:8080/api/v1/transfers/2c928084798f5175017a615b1c3f5855 Environment: Master Playbook: ApiV1TransfersIdGetUseraCreateTransfersUsercDisallowAbac Researcher: UserC QUICK TIPS Suggestion: Effort Estimate: null Hrs Wire Logs: IMPORTANT LINKS Vulnerability Details: https://95.217.198.167/#/app/projects/8a808acb7a2c3455017a2d6ccb164c39/dashboard/null/details Project: https://95.217.198.167/#/app/projects/8a808acb7a2c3455017a2d6ccb164c39/allScans Environment: https://95.217.198.167/#/app/projects/8a808acb7a2c3455017a2d6ccb164c39/environments/8a808acb7a2c3455017a2d6ccb1c4c3c/edit Scan Dashboard: https://95.217.198.167/#/app/projects/8a808acb7a2c3455017a2d6ccb164c39/profiles/8a808acb7a2c3455017a2d6ccdc64d3b/runs/8a808ad97a5f835b017a615b0d8869d3 Playbook: https://95.217.198.167/#/app/projects/8a808acb7a2c3455017a2d6ccb164c39/playbooksf/ApiV1TransfersIdGetUseraCreateTransfersUsercDisallowAbac Coverage: https://95.217.198.167/#/app/projects/8a808acb7a2c3455017a2d6ccb164c39/categories Code Sample: https://95.217.198.167/#/app/projects/8a808acb7a2c3455017a2d6ccb164c39/dashboard/null/codesamples PS: Please contact support@apisec.ai for apisec access and login issues. --- apisec Bot ---