Skip to content
This repository was archived by the owner on Jun 22, 2024. It is now read-only.

chore(Renovate): ⬆️ Update dependency vite to v5.0.12 [SECURITY] #462

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Jan 20, 2024

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
vite (source) 5.0.11 -> 5.0.12 age adoption passing confidence

GitHub Vulnerability Alerts

CVE-2024-23331

Summary

Vite dev server option server.fs.deny can be bypassed on case-insensitive file systems using case-augmented versions of filenames. Notably this affects servers hosted on Windows.

This bypass is similar to https://nvd.nist.gov/vuln/detail/CVE-2023-34092 -- with surface area reduced to hosts having case-insensitive filesystems.

Patches

Fixed in [email protected], [email protected], [email protected], [email protected]

Details

Since picomatch defaults to case-sensitive glob matching, but the file server doesn't discriminate; a blacklist bypass is possible.

See picomatch usage, where nocase is defaulted to false: https://github.com/vitejs/vite/blob/v5.1.0-beta.1/packages/vite/src/node/server/index.ts#L632

By requesting raw filesystem paths using augmented casing, the matcher derived from config.server.fs.deny fails to block access to sensitive files.

PoC

Setup

  1. Created vanilla Vite project using npm create vite@latest on a Standard Azure hosted Windows 10 instance.
  2. Created dummy secret files, e.g. custom.secret and production.pem
  3. Populated vite.config.js with
export default { server: { fs: { deny: ['.env', '.env.*', '*.{crt,pem}', 'custom.secret'] } } }

Reproduction

  1. curl -s http://20.12.242.81:5173/@​fs//
    • Descriptive error page reveals absolute filesystem path to project root
  2. curl -s http://20.12.242.81:5173/@​fs/C:/Users/darbonzo/Desktop/vite-project/vite.config.js
    • Discoverable configuration file reveals locations of secrets
  3. curl -s http://20.12.242.81:5173/@​fs/C:/Users/darbonzo/Desktop/vite-project/custom.sEcReT
    • Secrets are directly accessible using case-augmented version of filename

Proof
Screenshot 2024-01-19 022736

Impact

Who

  • Users with exposed dev servers on environments with case-insensitive filesystems

What

  • Files protected by server.fs.deny are both discoverable, and accessible

CVE-2024-31207

Summary

Vite dev server option server.fs.deny did not deny requests for patterns with directories. An example of such a pattern is /foo/**/*.

Impact

Only apps setting a custom server.fs.deny that includes a pattern with directories, and explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected.

Patches

Fixed in [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]

Details

server.fs.deny uses picomatch with the config of { matchBase: true }. matchBase only matches the basename of the file, not the path due to a bug (https://github.com/micromatch/picomatch/issues/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).

Release Notes

vitejs/vite (vite)

v5.0.12

Compare Source

Please refer to CHANGELOG.md for details.


Configuration

📅 Schedule: Branch creation - "" in timezone Asia/Taipei, Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot added 📦 package:vitest-config Related to the package - Vitest configuration 🧩 dependencies Related to the dependencies labels Jan 20, 2024
Copy link

changeset-bot bot commented Jan 20, 2024

⚠️ No Changeset found

Latest commit: fed97d9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

codeclimate bot commented Jan 20, 2024

Code Climate has analyzed commit fed97d9 and detected 0 issues on this pull request.

View more on Code Climate.

Copy link
Contributor

github-actions bot commented Jan 20, 2024

Size Change: 0 B

Total Size: 185 kB

ℹ️ View Unchanged
Filename Size
./packages/browserslist/dist/browsers.cjs 175 B
./packages/browserslist/dist/browsers.js 168 B
./packages/browserslist/dist/node.cjs 229 B
./packages/browserslist/dist/node.js 219 B
./packages/constants/dist/main.cjs 275 B
./packages/constants/dist/main.js 241 B
./packages/eslint/dist/index.cjs 3.76 kB
./packages/lint-staged/dist/checks.js 180 B
./packages/lint-staged/dist/chunk-BCQS74IR.js 225 B
./packages/lint-staged/dist/chunk-GVLGZKET.js 225 B
./packages/lint-staged/dist/chunk-GYAFE257.js 268 B
./packages/lint-staged/dist/chunk-I5CYDEBO.js 261 B
./packages/lint-staged/dist/chunk-I636WRXW.js 209 B
./packages/lint-staged/dist/chunk-UXS7MS47.js 251 B
./packages/lint-staged/dist/chunk-XF6WJRIQ.js 426 B
./packages/lint-staged/dist/chunk-ZUNU3G5W.js 322 B
./packages/lint-staged/dist/groups/code-format.js 116 B
./packages/lint-staged/dist/groups/eslint.js 106 B
./packages/lint-staged/dist/groups/markdown.js 111 B
./packages/lint-staged/dist/groups/package-json.js 134 B
./packages/lint-staged/dist/groups/stylesheets.js 117 B
./packages/lint-staged/dist/groups/tests.js 105 B
./packages/lint-staged/dist/groups/typescript.js 114 B
./packages/lint-staged/dist/main.js 437 B
./packages/markdownlint/dist/index.json 304 B
./packages/prettier/dist/index.js 71.8 kB
./packages/prettier/dist/main-ZBOLTEWM.js 9.15 kB
./packages/stylelint/dist/index.cjs 74.5 kB
./packages/stylelint/dist/main-HZOLMS6I.cjs 9.18 kB
./packages/syncpack/dist/index.js 509 B
./packages/tsup/dist/main.js 345 B
./packages/utils/dist/array.cjs 259 B
./packages/utils/dist/array.js 136 B
./packages/utils/dist/chunk-2EUY5ROG.cjs 741 B
./packages/utils/dist/chunk-AXQUIOJB.cjs 686 B
./packages/utils/dist/chunk-DZORIKCW.js 707 B
./packages/utils/dist/chunk-FFLUHYOO.cjs 310 B
./packages/utils/dist/chunk-I5GJA7OJ.js 291 B
./packages/utils/dist/chunk-NNY7KIY2.js 263 B
./packages/utils/dist/chunk-NTYEA6KO.cjs 672 B
./packages/utils/dist/chunk-RHWTXGRV.js 300 B
./packages/utils/dist/chunk-WYH6VPJI.cjs 289 B
./packages/utils/dist/chunk-XPB3OUOB.js 592 B
./packages/utils/dist/chunk-XRDZ2PSF.js 516 B
./packages/utils/dist/chunk-ZXXKV2AL.cjs 324 B
./packages/utils/dist/extensions.cjs 472 B
./packages/utils/dist/extensions.js 271 B
./packages/utils/dist/has-module.cjs 227 B
./packages/utils/dist/has-module.js 125 B
./packages/utils/dist/main.cjs 836 B
./packages/utils/dist/main.js 493 B
./packages/utils/dist/merge-configs.cjs 234 B
./packages/utils/dist/merge-configs.js 131 B
./packages/utils/dist/paths.cjs 300 B
./packages/utils/dist/paths.js 180 B
./packages/utils/dist/scope.cjs 316 B
./packages/utils/dist/scope.js 163 B
./packages/vitest/dist/base.js 128 B
./packages/vitest/dist/chunk-T256VEOW.js 258 B
./packages/vitest/dist/chunk-XZHYECMR.js 207 B
./packages/vitest/dist/main.js 158 B
./packages/vitest/dist/with-coverage.js 148 B

compressed-size-action

@renovate renovate bot force-pushed the renovate/npm-vite-vulnerability branch 9 times, most recently from 03f1f5a to e01c3b0 Compare February 11, 2024 02:45
@renovate renovate bot force-pushed the renovate/npm-vite-vulnerability branch from e01c3b0 to fed97d9 Compare February 11, 2024 02:48
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🧩 dependencies Related to the dependencies 📦 package:vitest-config Related to the package - Vitest configuration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants