Skip to content

Fix Coveo atomic lib CORS issue. Loads atomic module from EDS [ do NOT MREGE] - #2799

Open
Sivaramvt wants to merge 1 commit into
mainfrom
atomic-cors-issue
Open

Fix Coveo atomic lib CORS issue. Loads atomic module from EDS [ do NOT MREGE]#2799
Sivaramvt wants to merge 1 commit into
mainfrom
atomic-cors-issue

Conversation

@Sivaramvt

@Sivaramvt Sivaramvt commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Please provide the Jira Issue your PR is for.

Jira ID:

Test URLs:

AI Review Notes

@aem-code-sync

aem-code-sync Bot commented Jul 22, 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

@aem-code-sync

aem-code-sync Bot commented Jul 22, 2026

Copy link
Copy Markdown
Page Scores Audits Google
📱 / Quota exceeded. Please wait a while and try again. PSI
🖥️ / PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI
📱 /en/browse?martech=off PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI
🖥️ /en/browse?martech=off PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI
📱 /en/browse/analytics?martech=off Timeout Exceeded PSI
🖥️ /en/browse/analytics?martech=off PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI
📱 /en/certification-home?martech=off Unable to process request. Please wait a while and try again. PSI
🖥️ /en/certification-home?martech=off Unable to process request. Please wait a while and try again. PSI
📱 /en/docs?martech=off PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI
🖥️ /en/docs?martech=off PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI
📱 /en/docs/analytics?martech=off PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI
🖥️ /en/docs/analytics?martech=off PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI
📱 /en/docs/analytics/analyze/admin-overview/analytics-overview?martech=off PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI
🖥️ /en/docs/analytics/analyze/admin-overview/analytics-overview?martech=off PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI
📱 /en/events?martech=off PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI
🖥️ /en/events?martech=off PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI
📱 /en/perspectives?martech=off PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI
🖥️ /en/perspectives?martech=off Unable to process request. Please wait a while and try again. PSI
📱 /en/perspectives/drive-success-with-executive-summary-dashboards?martech=off Unable to process request. Please wait a while and try again. PSI
🖥️ /en/perspectives/drive-success-with-executive-summary-dashboards?martech=off PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI
📱 /en/playlists?martech=off Unable to process request. Please wait a while and try again. PSI
🖥️ /en/playlists?martech=off Lighthouse returned error: Something went wrong. PSI
📱 /en/playlists/acrobat-sign-perform-advanced-tasks-administrators?martech=off PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI
🖥️ /en/playlists/acrobat-sign-perform-advanced-tasks-administrators?martech=off Unable to process request. Please wait a while and try again. PSI
📱 /en/search?martech=off PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI
🖥️ /en/search?martech=off PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

Comment on lines +125 to +134
const externalTexts = await mapLimited([...externals], 10, async (path) => {
const text = await fetchText(CDN_HOST + path);
if (!text) return null;
const dest = join(dir, path); // path starts with /headless or /bueno
ensureDir(dirname(dest));
await fs.writeFile(dest, text);
// headless variants pull in bueno via the same absolute scheme — capture those too.
[...text.matchAll(externalRe)].forEach((m) => externals.add(m[1]));
return path;
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Path traversal in headless/bueno mirroring (low severity, build-time only).

externalRe captures the URL path with [^"]*, which permits ../ sequences, and dest = join(dir, path) (line 128) has no containment check. If a fetched chunk ever referenced (or an attacker-controlled/MITM'd response injected) something like "/headless/v3.13.0/../../../../etc/foo.esm.js", path.join would happily resolve outside dir and write there.

Today this only matters if Coveo's CDN itself is compromised, which is a fairly high bar and would already let an attacker ship arbitrary JS into the vendored bundle — so this isn't exploitable by an untrusted third party in the site's normal request path. Still, since this writes files based on unvalidated remote content, it'd be worth a cheap defense-in-depth check, e.g.:

const dest = join(dir, path);
if (!dest.startsWith(`${dir}${sep}`)) throw new Error(`Refusing to write outside vendor dir: ${path}`);

Not blocking given the build-time/trusted-CDN context, but flagging since it's easy to harden.

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

Labels

Development

Successfully merging this pull request may close these issues.

1 participant