Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update dependency vite to v5.0.13 [security] #565

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

Conversation

plural-renovate[bot]
Copy link
Contributor

@plural-renovate plural-renovate bot commented Jan 19, 2024

This PR contains the following updates:

Package Type Update Change
vite (source) devDependencies patch 5.0.10 -> 5.0.13

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.13

Compare Source

Please refer to CHANGELOG.md for details.

v5.0.12

Compare Source

Please refer to CHANGELOG.md for details.

v5.0.11

Compare Source


Configuration

📅 Schedule: Branch creation - "" (UTC), 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 Renovate Bot.

@plural-renovate plural-renovate bot requested a review from a team as a code owner January 19, 2024 22:19
@plural-renovate plural-renovate bot force-pushed the renovate/npm-vite-vulnerability branch 3 times, most recently from 86060f4 to aa147c4 Compare January 26, 2024 01:33
@plural-renovate plural-renovate bot force-pushed the renovate/npm-vite-vulnerability branch 3 times, most recently from 96c2371 to 7305fca Compare February 6, 2024 19:35
@plural-renovate plural-renovate bot force-pushed the renovate/npm-vite-vulnerability branch from 7305fca to cc979e1 Compare February 14, 2024 19:01
@plural-renovate plural-renovate bot force-pushed the renovate/npm-vite-vulnerability branch from cc979e1 to 68aeeb2 Compare March 8, 2024 14:32
@plural-renovate
Copy link
Contributor Author

plural-renovate bot commented Mar 8, 2024

⚠ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: yarn.lock
/usr/local/bin/yarn: line 4: .: filename argument required
.: usage: . filename [arguments]
/opt/containerbase/tools/corepack/0.28.2/node_modules/corepack/dist/lib/corepack.cjs:23025
  const isURL = URL.canParse(range);
                    ^

TypeError: URL.canParse is not a function
    at parseSpec (/opt/containerbase/tools/corepack/0.28.2/node_modules/corepack/dist/lib/corepack.cjs:23025:21)
    at loadSpec (/opt/containerbase/tools/corepack/0.28.2/node_modules/corepack/dist/lib/corepack.cjs:23088:11)
    at async Engine.findProjectSpec (/opt/containerbase/tools/corepack/0.28.2/node_modules/corepack/dist/lib/corepack.cjs:23262:22)
    at async Engine.executePackageManagerRequest (/opt/containerbase/tools/corepack/0.28.2/node_modules/corepack/dist/lib/corepack.cjs:23314:24)
    at async Object.runMain (/opt/containerbase/tools/corepack/0.28.2/node_modules/corepack/dist/lib/corepack.cjs:24007:5)

Node.js v18.16.0

@plural-renovate plural-renovate bot force-pushed the renovate/npm-vite-vulnerability branch 3 times, most recently from 32351f9 to 8d86543 Compare March 15, 2024 20:08
@plural-renovate plural-renovate bot force-pushed the renovate/npm-vite-vulnerability branch 2 times, most recently from 4fb6434 to ef44c84 Compare April 3, 2024 22:31
@plural-renovate plural-renovate bot changed the title chore(deps): update dependency vite to v5.0.12 [security] chore(deps): update dependency vite to v5.0.13 [security] Apr 3, 2024
@plural-renovate plural-renovate bot force-pushed the renovate/npm-vite-vulnerability branch 3 times, most recently from 6e8e3cf to 9281fed Compare April 11, 2024 12:45
@plural-renovate plural-renovate bot force-pushed the renovate/npm-vite-vulnerability branch 2 times, most recently from 844ace8 to 377e1b6 Compare April 25, 2024 03:04
@plural-renovate plural-renovate bot force-pushed the renovate/npm-vite-vulnerability branch 3 times, most recently from 607d113 to b2d1f0a Compare May 1, 2024 03:58
@plural-renovate plural-renovate bot force-pushed the renovate/npm-vite-vulnerability branch from b2d1f0a to fcf65e6 Compare May 6, 2024 20:03
@plural-renovate plural-renovate bot force-pushed the renovate/npm-vite-vulnerability branch 4 times, most recently from b1e1322 to f53ee9a Compare May 17, 2024 18:23
@plural-renovate plural-renovate bot force-pushed the renovate/npm-vite-vulnerability branch from f53ee9a to 332a1d0 Compare May 24, 2024 18:02
@plural-renovate plural-renovate bot force-pushed the renovate/npm-vite-vulnerability branch 3 times, most recently from 5dffffc to 052be22 Compare May 29, 2024 08:59
@plural-renovate plural-renovate bot force-pushed the renovate/npm-vite-vulnerability branch 7 times, most recently from 58f6ddb to aa45435 Compare June 10, 2024 16:28
@plural-renovate plural-renovate bot force-pushed the renovate/npm-vite-vulnerability branch 5 times, most recently from 92baec6 to 26936cc Compare June 18, 2024 19:40
@plural-renovate plural-renovate bot force-pushed the renovate/npm-vite-vulnerability branch 7 times, most recently from c9b4771 to ea1460d Compare June 28, 2024 16:34
@plural-renovate plural-renovate bot force-pushed the renovate/npm-vite-vulnerability branch from ea1460d to aadbd15 Compare July 5, 2024 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants