|
| 1 | +--- |
| 2 | +layout: advisory |
| 3 | +title: 'GHSA-87fh-rc96-6fr6 (spree_api): Unauthenticated Spree Commerce users can |
| 4 | + access all guest addresses' |
| 5 | +comments: false |
| 6 | +categories: |
| 7 | +- spree_api |
| 8 | +advisory: |
| 9 | + gem: spree_api |
| 10 | + ghsa: 87fh-rc96-6fr6 |
| 11 | + url: https://github.com/spree/spree/security/advisories/GHSA-87fh-rc96-6fr6 |
| 12 | + title: Unauthenticated Spree Commerce users can access all guest addresses |
| 13 | + date: 2026-02-05 |
| 14 | + description: | |
| 15 | + ### Summary |
| 16 | +
|
| 17 | + A critical IDOR vulnerability exists in Spree Commerce's guest |
| 18 | + checkout flow that allows any guest user to bind arbitrary guest |
| 19 | + addresses to their order by manipulating address ID parameters. |
| 20 | + This enables unauthorized access to other guests' personally |
| 21 | + identifiable information (PII) including names, addresses and |
| 22 | + phone numbers. The vulnerability bypasses existing ownership |
| 23 | + validation checks and affects all guest checkout transactions. |
| 24 | +
|
| 25 | + ### Impact |
| 26 | +
|
| 27 | + This issue may lead to disclosure of PII of guest users (including |
| 28 | + names, addresses and phone numbers). |
| 29 | +
|
| 30 | + ### Unauthenticated users can access all guest addresses (`GHSL-2026-027`) |
| 31 | +
|
| 32 | + The vulnerability stems from incomplete authorization validation |
| 33 | + in Spree's checkout address assignment logic. While nested address |
| 34 | + attributes (`bill_address_attributes[id]` and |
| 35 | + `ship_address_attributes[id]`) are properly validated through |
| 36 | + `validate_address_ownership`, plain ID parameters (`bill_address_id` |
| 37 | + and `ship_address_id`) bypass this check entirely. Since Spree's |
| 38 | + address IDs are sequential numbers, an attacker might get all |
| 39 | + guest addresses by simply enumerating over them. |
| 40 | +
|
| 41 | + ### Affected Code Components |
| 42 | +
|
| 43 | + 1. **Permitted Attributes** ([`core/lib/spree/permitted_attributes.rb:92–96`](https://github.com/spree/spree/blob/1341623f2ae92685cdbe232885bf5808fc8f9ca8/core/lib/spree/permitted_attributes.rb#L92-L96)) |
| 44 | + - Allows `bill_address_id` and `ship_address_id` as permitted |
| 45 | + parameters without validation |
| 46 | +
|
| 47 | + 2. **Checkout Update** ([`core/app/models/spree/order/checkout.rb:241–254`](https://github.com/spree/spree/blob/1341623f2ae92685cdbe232885bf5808fc8f9ca8/core/app/models/spree/order/checkout.rb#L241-L254)) |
| 48 | + - Applies permitted parameters directly to the Order model |
| 49 | + via `update_from_params` |
| 50 | +
|
| 51 | + 3. **Incomplete Ownership Validation** ([`core/app/services/spree/checkout/update.rb:33–48`](https://github.com/spree/spree/blob/1341623f2ae92685cdbe232885bf5808fc8f9ca8/core/app/services/spree/checkout/update.rb#L33-L48)) |
| 52 | + - `validate_address_ownership` only validates nested attributes structure |
| 53 | + - Does NOT validate plain `bill_address_id`/`ship_address_id` fields |
| 54 | +
|
| 55 | + 4. **Vulnerable Assignment Logic** ([`core/app/models/spree/order/address_book.rb:16–23, 31–38`](https://github.com/spree/spree/blob/1341623f2ae92685cdbe232885bf5808fc8f9ca8/core/app/models/spree/order/address_book.rb#L16-L38)) |
| 56 | + * [`bill_address_id=` setter](https://github.com/spree/spree/blob/1341623f2ae92685cdbe232885bf5808fc8f9ca8/core/app/models/spree/order/address_book.rb#L16-L24) |
| 57 | + * [`ship_address_id=` setter](https://github.com/spree/spree/blob/1341623f2ae92685cdbe232885bf5808fc8f9ca8/core/app/models/spree/order/address_book.rb#L31-L39) |
| 58 | +
|
| 59 | + Both setters check that: `address.user_id == order.user_id`. For |
| 60 | + guest orders: nil == nil → TRUE ✓ (bypass!) |
| 61 | +
|
| 62 | + #### Impact |
| 63 | +
|
| 64 | + This issue may lead to disclosure of PII of guest users (including |
| 65 | + names, addresses and phone numbers). |
| 66 | +
|
| 67 | + #### CWEs |
| 68 | +
|
| 69 | + - CWE-639: Authorization Bypass Through User-Controlled Key |
| 70 | + - CWE-284: Improper Access Control |
| 71 | +
|
| 72 | + ### Credit |
| 73 | +
|
| 74 | + This issue was discovered with the [GitHub Security Lab Taskflow |
| 75 | + Agent](https://github.com/GitHubSecurityLab/seclab-taskflow-agent) |
| 76 | + and manually verified by GHSL team members |
| 77 | + [@p- (Peter Stöckli)](https://github.com/p-) and |
| 78 | + [@m-y-mo (Man Yue Mo)](https://github.com/m-y-mo). |
| 79 | +
|
| 80 | + ### Disclosure Policy |
| 81 | +
|
| 82 | + This report is subject to a 90-day disclosure deadline, as |
| 83 | + described in more detail in our [coordinated disclosure policy](https://securitylab.github.com/advisories#policy). |
| 84 | + patched_versions: |
| 85 | + - "~> 4.10.3" |
| 86 | + - "~> 5.0.8" |
| 87 | + - "~> 5.1.10" |
| 88 | + - "~> 5.2.7" |
| 89 | + - ">= 5.3.2" |
| 90 | + related: |
| 91 | + url: |
| 92 | + - https://github.com/spree/spree/security/advisories/GHSA-87fh-rc96-6fr6 |
| 93 | + - https://github.com/spree/spree/commit/15619618e43b367617ec8d2d4aafc5e54fa7b734 |
| 94 | + - https://github.com/spree/spree/commit/29282d1565ba4f7bc2bbc47d550e2c0c6d0ae59f |
| 95 | + - https://github.com/spree/spree/commit/6650f96356faa0d16c05bcb516f1ffd5641741b8 |
| 96 | + - https://github.com/spree/spree/commit/902d301ac83fd2047db1b9a3a99545162860f748 |
| 97 | + - https://github.com/spree/spree/commit/ff7cfcfcfe0c40c60d03317e1d0ee361c6a6b054 |
| 98 | + - https://github.com/spree/spree/blob/1341623f2ae92685cdbe232885bf5808fc8f9ca8/core/app/models/spree/order/address_book.rb#L16-L38 |
| 99 | + - https://github.com/spree/spree/blob/1341623f2ae92685cdbe232885bf5808fc8f9ca8/core/app/models/spree/order/checkout.rb#L241-L254 |
| 100 | + - https://github.com/spree/spree/blob/1341623f2ae92685cdbe232885bf5808fc8f9ca8/core/app/services/spree/checkout/update.rb#L33-L48 |
| 101 | + - https://github.com/spree/spree/blob/1341623f2ae92685cdbe232885bf5808fc8f9ca8/core/lib/spree/permitted_attributes.rb#L92-L96 |
| 102 | + - https://github.com/advisories/GHSA-87fh-rc96-6fr6 |
| 103 | + notes: "- CVE-2026-25758 in GHSA Advisory.\n" |
| 104 | +--- |
0 commit comments