Skip to content

Improper object type validation in mutations leading to unauthorized access

Moderate
NyanKiyoshi published GHSA-xhq8-8c5v-w8ff Oct 3, 2022

Package

Saleor (GHCR)

Affected versions

>= 2.0.0

Patched versions

3.7.17, 3.6.18, 3.5.23, 3.4.24, 3.3.26, 3.2.14, 3.1.24

Description

Impact

Some GraphQL mutations were not properly checking the ID type input which allowed to access database objects that the authenticated user may not be allowed to access.

Affects Saleor >= 2.0.0, breakdown:

  • accountSetDefaultAddress >= 2.6.0 (2b63e12)
  • accountAddressDelete >= 2.9.0 (ad1b899)
  • addressDelete >= 2.6.0 (2b63e12)
  • productVariantBulkCreate >= 2.9.0 (d5fae21)
  • assignNavigation >= 2.0.0 (273867b)

This vulnerability can be used to expose the following information:

  • Estimating database row counts from tables with a sequential primary key
  • Exposing staff user and customer email addresses and full name through the assignNavigation() mutation
Mutation Name Required Privileges Effect
accountSetDefaultAddress Authenticated User Request is rejected with error message:
The address doesn't belong to that user
accountAddressDelete Authenticated User or MANAGE_USERS
  • Crashes with error message for staff user with manage user permission:
    'User' object has no attribute 'user_addresses'
  • Authenticated User: request is rejected with message:
    You need one of the following permissions: MANAGE_USERS, OWNER
addressDelete MANAGE_USERS Crash with error message:
'User' object has no attribute 'user_addresses'
productVariantBulkCreate MANAGE_PRODUCTS Crash with error message:
'User' object has no attribute 'variants'
assignNavigation MANAGE_MENUS or MANAGE_SETTINGS Crash leaking object Python representation, address ID leak the user's full name. Error message:
Cannot assign \"<Address: John Doe>\": \"SiteSettings.top_menu\" must be a \"Menu\" instance.

Patches

Workarounds

None

References

None

For more information

If you have any questions or comments about this advisory:

Severity

Moderate
5.7
/ 10

CVSS base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:N/A:N

CVE ID

CVE-2022-39275

Weaknesses