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

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
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