Nested Object Path Review
Check every identifier in a nested path, because servers often authorize the first segment and forget the rest
Use when: routes look like accounts, accounts, orders, orders, items where several objects appear in one path
Avoid when: paths address a single object with no nesting, where one check covers the whole request
Procedure
- Enumerate nested routes and list each identifier position separately, numbering them left to right.
- Test combinations where each position alternates between your two test accounts while others stay constant.
- Determine which position the server actually validates by observing which swaps cause a refusal.
- Check whether a parent from your account with a child from another account is accepted, which is the classic nesting gap.
- Verify that list and create operations under a parent enforce ownership of the parent itself.
- Record per-position results so the fix can point at the exact missing check.
Signals
- Swapping the first identifier is refused while swapping the third is accepted, showing partial validation.
- A child object from another account loads when placed under your parent identifier.
- Creating a child under a parent you do not own succeeds, which is a write-side nesting failure.
- Validation depends on ordering, so reordering the same identifiers changes the outcome.
Patterns
1. Path positions
/accounts/{A1}/orders/{B2}/items/{C3}
pos1=account pos2=order pos3=item
swap pos2 only -> 200 -> position 2 not checked
2. Combination set
parent=own + child=peer -> must refuse
parent=peer + child=own -> must refuse
parent=own + child=own -> must succeed
3. Result row
route=/accounts/{}/orders/{} positions_tested=2 gaps=[pos2] outcome=refused-when-parent-foreign
Pitfalls
- Testing only the first identifier and assuming the whole path is covered by one check.
- Using objects from another user's account instead of a second account you own.
- Missing create and delete operations under nested parents, which are separate code paths from reads.
Done when
- Every identifier position has been independently swapped and tested with your own two accounts.
- Parent and child ownership are verified in all four combinations, with per-position results recorded.