[Security] Bump esbuild, laravel-vite-plugin and vite
Bumps esbuild to 0.25.2 and updates ancestor dependencies esbuild, laravel-vite-plugin and vite. These dependencies need to be updated together.
Updates esbuild
from 0.20.2 to 0.25.2 This update includes a security fix.
Vulnerabilities fixed
esbuild enables any website to send any requests to the development server and read the response
Summary
esbuild allows any websites to send any request to the development server and read the response due to default CORS settings.
Details
esbuild sets
Access-Control-Allow-Origin: *
header to all requests, including the SSE connection, which allows any websites to send any request to the development server and read the response.https://github.com/evanw/esbuild/blob/df815ac27b84f8b34374c9182a93c94718f8a630/pkg/api/serve_other.go#L121
https://github.com/evanw/esbuild/blob/df815ac27b84f8b34374c9182a93c94718f8a630/pkg/api/serve_other.go#L363Attack scenario:
- The attacker serves a malicious web page (
http://malicious.example.com
).- The user accesses the malicious web page.
- The attacker sends a
fetch('http://127.0.0.1:8000/main.js')
request by JS in that malicious web page. This request is normally blocked by same-origin policy, but that's not the case for the reasons above.- The attacker gets the content of
http://127.0.0.1:8000/main.js
.In this scenario, I assumed that the attacker knows the URL of the bundle output file name. But the attacker can also get that information by
... (truncated)
Patched versions: 0.25.0
Affected versions: <= 0.24.2
Release notes
Sourced from esbuild's releases.
v0.25.2
Support flags in regular expressions for the API (#4121)
The JavaScript plugin API for esbuild takes JavaScript regular expression objects for the
filter
option. Internally these are translated into Go regular expressions. However, this translation previously ignored theflags
property of the regular expression. With this release, esbuild will now translate JavaScript regular expression flags into Go regular expression flags. Specifically the JavaScript regular expression/\.[jt]sx?$/i
is turned into the Go regular expression`(?i)\.[jt]sx?$`
internally inside of esbuild's API. This should make it possible to use JavaScript regular expressions with thei
flag. Note that JavaScript and Go don't support all of the same regular expression features, so this mapping is only approximate.Fix node-specific annotations for string literal export names (#4100)
When node instantiates a CommonJS module, it scans the AST to look for names to expose via ESM named exports. This is a heuristic that looks for certain patterns such as
exports.NAME = ...
ormodule.exports = { ... }
. This behavior is used by esbuild to "annotate" CommonJS code that was converted from ESM with the original ESM export names. For example, when converting the fileexport let foo, bar
from ESM to CommonJS, esbuild appends this to the end of the file:// Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { bar, foo });
However, this feature previously didn't work correctly for export names that are not valid identifiers, which can be constructed using string literal export names. The generated code contained a syntax error. That problem is fixed in this release:
// Original code let foo export { foo as "foo!" } // Old output (with --format=cjs --platform=node) ... 0 && (module.exports = { "foo!" }); // New output (with --format=cjs --platform=node) ... 0 && (module.exports = { "foo!": null });
Basic support for index source maps (#3439, #4109)
The source map specification has an optional mode called index source maps that makes it easier for tools to create an aggregate JavaScript file by concatenating many smaller JavaScript files with source maps, and then generate an aggregate source map by simply providing the original source maps along with some offset information. My understanding is that this is rarely used in practice. I'm only aware of two uses of it in the wild: ClojureScript and Turbopack.
This release provides basic support for indexed source maps. However, the implementation has not been tested on a real app (just on very simple test input). If you are using index source maps in a real app, please try this out and report back if anything isn't working for you.
Note that this is also not a complete implementation. For example, index source maps technically allows nesting source maps to an arbitrary depth, while esbuild's implementation in this release only supports a single level of nesting. It's unclear whether supporting more than one level of nesting is important or not given the lack of available test cases.
This feature was contributed by
@clyfish
.v0.25.1
... (truncated)
Changelog
Sourced from esbuild's changelog.
Changelog: 2024
This changelog documents all esbuild versions published in the year 2024 (versions 0.19.12 through 0.24.2).
0.24.2
Fix regression with
--define
andimport.meta
(#4010, #4012, #4013)The previous change in version 0.24.1 to use a more expression-like parser for
define
values to allow quoted property names introduced a regression that removed the ability to use--define:import.meta=...
. Even thoughimport
is normally a keyword that can't be used as an identifier, ES modules special-case theimport.meta
expression to behave like an identifier anyway. This change fixes the regression.This fix was contributed by
@sapphi-red
.0.24.1
Allow
es2024
as a target intsconfig.json
(#4004)TypeScript recently added
es2024
as a compilation target, so esbuild now supports this in thetarget
field oftsconfig.json
files, such as in the following configuration file:{ "compilerOptions": { "target": "ES2024" } }
As a reminder, the only thing that esbuild uses this field for is determining whether or not to use legacy TypeScript behavior for class fields. You can read more in the documentation.
This fix was contributed by
@billyjanitsch
.Allow automatic semicolon insertion after
get
/set
This change fixes a grammar bug in the parser that incorrectly treated the following code as a syntax error:
class Foo { get *x() {} set *y() {} }
The above code will be considered valid starting with this release. This change to esbuild follows a similar change to TypeScript which will allow this syntax starting with TypeScript 5.7.
Allow quoted property names in
--define
and--pure
(#4008)The
define
andpure
API options now accept identifier expressions containing quoted property names. Previously all identifiers in the identifier expression had to be bare identifiers. This change now makes--define
and--pure
consistent with--global-name
, which already supported quoted property names. For example, the following is now possible:
... (truncated)
Commits
-
4475787
publish 0.25.2 to npm -
8f56771
fix #4121: map js regexp flags to go regexp flags -
36b458d
follow-up to #4109 -
8b8437c
feat: support index source map (#4109) -
75286c1
unit test for absolute windows paths in source map -
bcc77fb
fix #4100: invalid identifiers in node annotation -
37cb6a2
fix a warning fromnpm publish
-
6bfc1c1
publish 0.25.1 to npm -
f9b3952
fix #4078: prepend namespaces to source map paths -
ccf3dd7
add "contributed by" in changelog - Additional commits viewable in compare view
Updates laravel-vite-plugin
from 1.0.2 to 1.2.0
Release notes
Sourced from laravel-vite-plugin's releases.
v1.2.0
- [1.x] Fix Invalid URL issue with Vite 6.0.9 by
@batinmustu
in laravel/vite-plugin#317- [1.x] Add default CORS origins by
@timacdonald
in laravel/vite-plugin#318v1.1.1
- [1.1] Fix dependency issue with Vite 5 by
@jessarcher
in laravel/vite-plugin#313v1.1.0
- Upgrade to Vite 6 by
@timacdonald
in laravel/vite-plugin#310v1.0.6
- Replace dead link in Security Policy by
@Jubeki
in laravel/vite-plugin#300- Look for certificates in valet linux config directory by
@jameshulse
in laravel/vite-plugin#307v1.0.5
- TypeScript: define entrypoints using object by
@tylerlwsmith
in laravel/vite-plugin#298v1.0.4
- Include base in hotFile without modifying server.origin replacement by
@danielztolnai
in laravel/vite-plugin#296v1.0.3
- Append base to hot file by
@timacdonald
in laravel/vite-plugin#290- Support Laravel Herd for windows by
@mozex
in laravel/vite-plugin#293
Changelog
Sourced from laravel-vite-plugin's changelog.
v1.2.0 - 2025-01-21
- [1.x] Fix Invalid URL issue with Vite 6.0.9 by
@batinmustu
in laravel/vite-plugin#317- [1.x] Add default CORS origins by
@timacdonald
in laravel/vite-plugin#318v1.1.1 - 2024-12-03
- [1.1] Fix dependency issue with Vite 5 by
@jessarcher
in laravel/vite-plugin#313v1.1.0 - 2024-12-02
- Upgrade to Vite 6 by
@timacdonald
in laravel/vite-plugin#310v1.0.6 - 2024-11-12
- Replace dead link in Security Policy by
@Jubeki
in laravel/vite-plugin#300- Look for certificates in valet linux config directory by
@jameshulse
in laravel/vite-plugin#307v1.0.5 - 2024-07-09
- TypeScript: define entrypoints using object by
@tylerlwsmith
in laravel/vite-plugin#298v1.0.4 - 2024-05-17
- Include base in hotFile without modifying server.origin replacement by
@danielztolnai
in laravel/vite-plugin#296v1.0.3 - 2024-05-16
- Append base to hot file by
@timacdonald
in laravel/vite-plugin#290- Support Laravel Herd for windows by
@mozex
in laravel/vite-plugin#293
Commits
-
0201f3f
1.2.0 -
b3a3abf
[1.x] Add default CORS origins (#318) -
1501f5c
[1.x] Fix Invalid URL issue with Vite 6.0.9 (#317) -
e57a940
Update CHANGELOG -
b91e205
1.1.1 -
6515574
Fix dependency issue with Vite 5 (#313) -
44edafa
Update CHANGELOG -
aacee1d
1.1.0 -
492c068
Upgrade to Vite 6 (#310) -
81beac4
Update CHANGELOG - Additional commits viewable in compare view
Updates vite
from 5.2.11 to 6.2.6
Release notes
Sourced from vite's releases.
create-vite@6.2.1
Please refer to CHANGELOG.md for details.
create-vite@6.2.0
Please refer to CHANGELOG.md for details.
create-vite@6.1.1
Please refer to CHANGELOG.md for details.
create-vite@6.1.0
Please refer to CHANGELOG.md for details.
create-vite@6.0.1
Please refer to CHANGELOG.md for details.
create-vite@6.0.0
Please refer to CHANGELOG.md for details.
create-vite@5.5.5
Please refer to CHANGELOG.md for details.
create-vite@5.5.4
Please refer to CHANGELOG.md for details.
create-vite@5.5.3
Please refer to CHANGELOG.md for details.
create-vite@5.5.2
Please refer to CHANGELOG.md for details.
create-vite@5.5.1
Please refer to CHANGELOG.md for details.
create-vite@5.5.0
Please refer to CHANGELOG.md for details.
Changelog
Sourced from vite's changelog.
6.2.6 (2025-04-10)
6.2.5 (2025-04-03)
6.2.4 (2025-03-31)
6.2.3 (2025-03-24)
6.2.2 (2025-03-14)
- fix: await client buildStart on top level buildStart (#19624) (b31faab), closes #19624
- fix(css): inline css correctly for double quote use strict (#19590) (d0aa833), closes #19590
- fix(deps): update all non-major dependencies (#19613) (363d691), closes #19613
- fix(indexHtml): ensure correct URL when querying module graph (#19601) (dc5395a), closes #19601
- fix(preview): use preview https config, not server (#19633) (98b3160), closes #19633
- fix(ssr): use optional chaining to prevent "undefined is not an object" happening in `ssrRewriteStac (4309755), closes #19612
- feat: show friendly error for malformed
base
(#19616) (2476391), closes #19616- feat(worker): show asset filename conflict warning (#19591) (367d968), closes #19591
- chore: extend commit hash correctly when ambigious with a non-commit object (#19600) (89a6287), closes #19600
6.2.1 (2025-03-07)
- refactor: remove
isBuild
check from preAliasPlugin (#19587) (c9e086d), closes #19587- refactor: restore endsWith usage (#19554) (6113a96), closes #19554
- refactor: use
applyToEnvironment
in internal plugins (#19588) (f678442), closes #19588- fix(css): stabilize css module hashes with lightningcss in dev mode (#19481) (92125b4), closes #19481
- fix(deps): update all non-major dependencies (#19555) (f612e0f), closes #19555
- fix(reporter): fix incorrect bundle size calculation with non-ASCII characters (#19561) (437c0ed), closes #19561
- fix(sourcemap): combine sourcemaps with multiple sources without matched source (#18971) (e3f6ae1), closes #18971
- fix(ssr): named export should overwrite export all (#19534) (2fd2fc1), closes #19534
- feat: add
*?url&no-inline
type and warning for.json?inline
/.json?no-inline
(#19566) (c0d3667), closes #19566- test: add glob import test case (#19516) (aa1d807), closes #19516
... (truncated)
Commits
-
d3dbf25
release: v6.2.6 -
3bb0883
fix: reject requests with#
in request-target (#19830) -
c176acf
release: v6.2.5 -
fdb196e
fix: backport #19782, fs check with svg and relative paths -
037f801
release: v6.2.4 -
7a4faba
fix: fs check in transform middleware (#19761) -
16869d7
release: v6.2.3 -
f234b57
fix: fs raw query with query separators (#19702) -
b12911e
release: v6.2.2 -
98b3160
fix(preview): use preview https config, not server (#19633) - Additional commits viewable in compare view