Skip to content

fix: reject cross-org copy/move destinations instead of misdelivering#301

Merged
kptdobe merged 2 commits into
adobe:mainfrom
benpeter:cross-org-destination-guard
Jul 14, 2026
Merged

fix: reject cross-org copy/move destinations instead of misdelivering#301
kptdobe merged 2 commits into
adobe:mainfrom
benpeter:cross-org-destination-guard

Conversation

@benpeter

Copy link
Copy Markdown
Contributor

The copy and move helpers dropped the destination field's first path segment unconditionally. A destination in a different org (e.g. cross-org paste, adobe/da-live#623) had its org silently discarded and the path re-anchored under the request org: the request returned 204 and created a phantom copy inside the source org — nothing reached the intended org, and the caller got no error.

Since storage pins all keys to the request org, a cross-org destination can never be honored. Both helpers now compare the destination's org segment to the request org and return 400 {"error":"Destination must be in the same org as the source."} on mismatch.

Tests: route-level rejection and mixed-case same-org acceptance; integration coverage for same-org copy, cross-org copy (400, no phantom), and cross-org move (400, source intact).

Relates to adobe/da-live#623, adobe/da-live#34.

The copy and move helpers parsed the destination form field with
split('/').slice(1), silently discarding the destination's org segment
and re-anchoring the path under the request org. A cross-org copy
returned 204 and created a phantom copy inside the source org; nothing
reached the intended destination org (confirmed against production
admin.da.live on 2026-07-10). Under a restrictive source-org ACL the
same request surfaced as a misleading 403.

Compare the destination's org segment to the request org and return an
explicit 400 on mismatch. Both endpoints are documented as operating
within an organization, and 400 is already a documented response code
for both. The underlying feature ask is adobe/da-live#623.

Relates to adobe/da-live#34.
Comment thread src/helpers/copy.js
@kptdobe

kptdobe commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Thanks @benpeter. I'll merge as soon as you addresses my very little comment.

@kptdobe kptdobe merged commit fd7a351 into adobe:main Jul 14, 2026
2 checks passed
adobe-bot pushed a commit that referenced this pull request Jul 14, 2026
## [1.12.3](v1.12.2...v1.12.3) (2026-07-14)

### Bug Fixes

* reject cross-org copy/move destinations instead of misdelivering ([#301](#301)) ([fd7a351](fd7a351))
@adobe-bot

Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 1.12.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants