Page MenuHomePhabricator

Investigate newer esbuild (for vite et al) in Codex
Closed, ResolvedPublicSecurity

Description

The version of vite in Codex 2.0.0 (and generally below) requires an older version of esbuild; other libraries appear to do so as well.

This is a request for investigation of an update to a newer version of vite (and possibly other libraries, too) that gets esbuild up to a version addressing https://github.com/advisories/GHSA-67mh-4wv8-2f99 . That advisory's POC shows a browser console based make run-dev problem. Depending on the manner in which someone is using make run-dev this may be less or more of a problem. This does prove to work if using the browser console as shown in the POC. However, generally, CORS will block real webpage-executed requests (i.e., those not originating from someone copy-pasting intentionally, or at the prompting of a bad actor, code into a browser console). For example, the following stuffed into a real internet hosted webpage...

(function() {
    const aDiv = document.createElement('div');
    aDiv.textContent = 'Hi';
    aDiv.addEventListener('click', function() {
        fetch('https://127.0.0.1:1234/some_path', {headers: {"Accept": "application/json"}}).then(r => r.text()).then(content => console.log(content));
    });
    document.body.appendChild(aDiv);
})();

is likely to yield the following when clicking on the "Hi" <div>.

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://127.0.0.1:1234/some_path. (Reason: CORS request did not succeed). Status code: (null).

This blocking isn't necessarily reflective of merely making a request toward a 127.0.0.1 endpoint.

Nevertheless, there's a potential problem here. This is a request for folks more fluent in Codex to have a look at what might be viable here (be that within the Codex repo, upstream, or some combination).

Related Objects

Event Timeline

dr0ptp4kt renamed this task from Investigate newer esbuild for @vitejs/plugin-vue to Investigate newer esbuild (for @vitejs/plugin-vue et al).Jun 2 2025, 8:56 PM
dr0ptp4kt added a project: Codex.
dr0ptp4kt renamed this task from Investigate newer esbuild (for @vitejs/plugin-vue et al) to Investigate newer esbuild (for @vitejs/plugin-vue et al) in Codex.Jun 2 2025, 8:58 PM
dr0ptp4kt renamed this task from Investigate newer esbuild (for @vitejs/plugin-vue et al) in Codex to Investigate newer esbuild (for vite) in Codex.Jun 2 2025, 9:11 PM
dr0ptp4kt updated the task description. (Show Details)
dr0ptp4kt renamed this task from Investigate newer esbuild (for vite) in Codex to Investigate newer esbuild (for vite et al) in Codex.Jun 3 2025, 9:06 PM
Catrope triaged this task as High priority.Jun 23 2025, 5:01 PM
Catrope moved this task from Backlog to Ready for Design/Dev on the Codex board.

https://gerrit.wikimedia.org/r/c/design/codex/+/1168280 upgrades Codex to Vite 7.0.4, which uses esbuild 25.0.6. The advisory was addressed in esbuild 25.0.0.

Change #1168280 merged by jenkins-bot:

[design/codex@main] build: Upgrade Vite to v7.0.4, bump Node requirement to v20.19.0 & upgrade dependencies

https://gerrit.wikimedia.org/r/1168280

sbassett changed Author Affiliation from N/A to WMF Product.
sbassett removed a project: Design-System-Team.
sbassett changed the visibility from "Custom Policy" to "Public (No Login Required)".
sbassett changed the edit policy from "Custom Policy" to "All Users".
sbassett changed Risk Rating from N/A to Medium.
sbassett moved this task from In Progress to Our Part Is Done on the Security-Team board.

This issue has been fixed via the public gerrit patch and is not implicated for any security releases.

Change #1178961 had a related patch set uploaded (by LorenMora; author: LorenMora):

[mediawiki/core@master] Update Codex from v2.2.1 to v2.3.0

https://gerrit.wikimedia.org/r/1178961

Test wiki created on Patch demo by LMora-WMF using patch(es) linked to this task:
https://52ad408a3b.catalyst.wmcloud.org/w/

Change #1178961 merged by jenkins-bot:

[mediawiki/core@master] Update Codex from v2.2.1 to v2.3.0

https://gerrit.wikimedia.org/r/1178961

Change #1180982 had a related patch set uploaded (by LorenMora; author: LorenMora):

[mediawiki/core@master] Update Codex from v2.2.1 to v2.3.1

https://gerrit.wikimedia.org/r/1180982

Test wiki created on Patch demo by LMora-WMF using patch(es) linked to this task:
https://590db65713.catalyst.wmcloud.org/w/

Change #1180982 merged by jenkins-bot:

[mediawiki/core@master] Update Codex from v2.2.1 to v2.3.1

https://gerrit.wikimedia.org/r/1180982

Test wiki on Patch demo by LMora-WMF using patch(es) linked to this task was deleted:

https://590db65713.catalyst.wmcloud.org/w/

Test wiki on Patch demo by LMora-WMF using patch(es) linked to this task was deleted:

https://52ad408a3b.catalyst.wmcloud.org/w/