Disclosed vulnerabilities
Fixed: Sep 27, 2023
CVE-2023-46498 Published: Sep 25, 2023

Broken Function Level Authorization in @evershop/evershop

9.1 Critical Severity authorization broken function GraphQL js level npm
Mário Teixeira Reported by Checkmarx Zero

Summary

A Broken Function Level Authorization vulnerability in the “route.json” file of the NPM’s package @evershop/evershop prior to 1.0.0-rc.8 allows unauthenticated attackers to delete customer accounts through a publicly accessible GraphQL endpoint. Attackers can chain this with another vulnerability found in the GraphQL schema, first by querying the schema to identify the “Customer” object and get the relevant “uuid” of a user. Then the attackers are able to send a DELETE request to the unprotected endpoint, resulting in the successful deletion of the user account. This was fixed by closing public access to the endpoint so it requires users to be authenticated with ‘admin’ credentials in order to request it.

Product

This vulnerability affects NPM’s package @evershop/evershop in versions prior to 1.0.0-rc.8.

Impact

An unauthenticated user can send a DELETE request to the endpoint and successfully delete every account on an EverShop instance

Steps to reproduce

  1. Install the @evershop/evershop package dependency for any version prior to 1.0.0-rc.8
  2. Run the EverShop Web Application on localhost
  3. Make a POST request to GraphQL API with the following query to learn about all the objects present in the database, and the respective fields:
    {"query": "{__schema{types{name,fields{name,args{name,description,type{name,kind,ofType{name, kind}}}}}}}"}
  4. After locating the “Customer” object, Make a POST request to GraphQL API with the following query to retrieve “deleteAPI” field:
    {"query": 
    "query { customers(filters:[]) { currentFilters { operation } total items { customerId uuid email fullName deleteApi} }}"}
  5. Use the “deleteAPI” field that contains the specific endpoint to delete a given user by sending DELETE request

Expected result:

The user will be deleted from the Evershop system.

Remediation

A fix was released in commit 69f7f89, which involved restricting public access to the endpoint. Users are required to be authenticated with ‘admin’ credentials in order to request it.

Credit

This issue was discovered and reported by Checkmarx SCA Security Analyst Mário Teixeira.

Resources

  1. Pull Request
  2. Commit

Stay connected and never miss a research update!