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 wrangler to v2.20.2 [security] #1235

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

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Aug 3, 2023

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
wrangler (source) 2.13.0 -> 2.20.2 age adoption passing confidence

GitHub Vulnerability Alerts

CVE-2023-3348

Impact

The Wrangler command line tool (<[email protected] or <[email protected]) was affected by a directory traversal vulnerability when running a local development server for Pages (wrangler pages dev command). This vulnerability enabled an attacker in the same network as the victim to connect to the local development server and access the victim's files present outside of the directory for the development server.

Patches

Wrangler2: Upgrade to v2.20.1 or higher.
Wrangler3: Upgrade to v3.1.1 or higher.

References

Workers SDK on Github
Wrangler docs
CVE-2023-3348

CVE-2023-7080

Impact

The V8 inspector intentionally allows arbitrary code execution within the Workers sandbox for debugging. wrangler dev would previously start an inspector server listening on all network interfaces. This would allow an attacker on the local network to connect to the inspector and run arbitrary code. Additionally, the inspector server did not validate Origin/Host headers, granting an attacker that can trick any user on the local network into opening a malicious website the ability to run code. If wrangler dev --remote was being used, an attacker could access production resources if they were bound to the worker.

Patches

This issue was fixed in [email protected] and [email protected]. Whilst wrangler dev's inspector server listens on local interfaces by default as of [email protected], an SSRF vulnerability in miniflare allowed access from the local network until [email protected]. [email protected] and [email protected] introduced validation for the Origin/Host headers.

Workarounds

Unfortunately, Wrangler doesn't provide any configuration for which host that inspector server should listen on. Please upgrade to at least [email protected], and configure Wrangler to listen on local interfaces instead with wrangler dev --ip 127.0.0.1 to prevent SSRF. This removes the local network as an attack vector, but does not prevent an attack from visiting a malicious website.

References


Release Notes

cloudflare/workers-sdk (wrangler)

v2.20.2

Compare Source

Patch Changes
  • #​4609 c228c912 Thanks @​mrbbot! - fix: pin workerd to 1.20230404.0

  • #​4587 49a46960 Thanks @​mrbbot! - Change dev registry and inspector server to listen on 127.0.0.1 instead of all interfaces

  • #​4587 49a46960 Thanks @​mrbbot! - fix: validate Host and Orgin headers where appropriate

    Host and Origin headers are now checked when connecting to the inspector proxy. If these don't match what's expected, the request will fail.

v2.20.1

Compare Source

Patch Changes

v2.20.0

Compare Source

Minor Changes
  • #​3095 133c0423 Thanks @​zebp! - feat: add support for placement in wrangler config

    Allows a placement object in the wrangler config with a mode of off or smart to configure Smart placement. Enabling Smart Placement can be done in your wrangler.toml like:

    [placement]
    mode = "smart"
  • #​3140 5fd080c8 Thanks @​penalosa! - feat: Support sourcemaps in DevTools

    Intercept requests from DevTools in Wrangler to inject sourcemaps and enable folders in the Sources Panel of DevTools. When errors are thrown in your Worker, DevTools should now show your source file in the Sources panel, rather than Wrangler's bundled output.

Patch Changes

v2.19.0

Compare Source

Minor Changes

v2.18.0

Compare Source

Minor Changes
  • #​3098 8818f551 Thanks @​mrbbot! - fix: improve Workers Sites asset upload reliability

    • Wrangler no longer buffers all assets into memory before uploading. This should prevent out-of-memory errors when publishing sites with many large files.
    • Wrangler now limits the number of in-flight asset upload requests to 5, fixing the Too many bulk operations already in progress error.
    • Wrangler now correctly logs upload progress. Previously, the reported percentage was per upload request group, not across all assets.
    • Wrangler no longer logs all assets to the console by default. Instead, it will just log the first 100. The rest can be shown by setting the WRANGLER_LOG=debug environment variable. A splash of colour has also been added.

v2.17.0

Compare Source

Minor Changes
  • #​3004 6d5000a7 Thanks @​rozenmd! - feat: teach wrangler docs to use algolia search index

    This PR lets you search Cloudflare's entire docs via wrangler docs [search term here].

    By default, if the search fails to find what you're looking for, you'll get an error like this:

    ✘ [ERROR] Could not find docs for: <search term goes here>. Please try again with another search term.
    

    If you provide the --yes or -y flag, wrangler will open the docs to https://developers.cloudflare.com/workers/wrangler/commands/, even if the search fails.

v2.16.0

Compare Source

Minor Changes
  • #​3058 1bd50f56 Thanks @​mrbbot! - chore: upgrade miniflare@3 to 3.0.0-next.13

    Notably, this adds native support for Windows to wrangler dev --experimental-local, logging for incoming requests, and support for a bunch of newer R2 features.

Patch Changes
  • #​3058 1bd50f56 Thanks @​mrbbot! - fix: disable persistence without --persist in --experimental-local

    This ensures --experimental-local doesn't persist data on the file-system, unless the --persist flag is set.
    Data is still always persisted between reloads.

  • #​3055 5f48c405 Thanks @​rozenmd! - fix: Teach D1 commands to read auth configuration from wrangler.toml

    This PR fixes a bug in how D1 handles a user's accounts. We've updated the D1 commands to read from config (typically via wrangler.toml) before trying to run commands. This means if an account_id is defined in config, we'll use that instead of erroring out when there are multiple accounts to pick from.

    Fixes #​3046

  • #​3058 1bd50f56 Thanks @​mrbbot! - fix: disable route validation when using --experimental-local

    This ensures wrangler dev --experimental-local doesn't require a login or an internet connection if a route is configured.

v2.15.1

Compare Source

Patch Changes

v2.15.0

Compare Source

Minor Changes
  • #​2769 0a779904 Thanks @​penalosa! - feature: Support modules with --no-bundle

    When the --no-bundle flag is set, Wrangler now has support for uploading additional modules alongside the entrypoint. This will allow modules to be imported at runtime on Cloudflare's Edge. This respects Wrangler's module rules configuration, which means that only imports of non-JS modules will trigger an upload by default. For instance, the following code will now work with --no-bundle (assuming the example.wasm file exists at the correct path):

    // index.js
    import wasm from './example.wasm'
    
    export default {
      async fetch() {
        await WebAssembly.instantiate(wasm, ...)
        ...
      }
    }

    For JS modules, it's necessary to specify an additional module rule (or rules) in your wrangler.toml to configure your modules as ES modules or Common JS modules. For instance, to upload additional JavaScript files as ES modules, add the following module rule to your wrangler.toml, which tells Wrangler that all **/*.js files are ES modules.

    rules = [
      { type = "ESModule", globs = ["**/*.js"]},
    ]

    If you have Common JS modules, you'd configure Wrangler with a CommonJS rule (the following rule tells Wrangler that all .cjs files are Common JS modules):

    rules = [
      { type = "CommonJS", globs = ["**/*.cjs"]},
    ]

    In most projects, adding a single rule will be sufficient. However, for advanced usecases where you're mixing ES modules and Common JS modules, you'll need to use multiple rule definitions. For instance, the following set of rules will match all .mjs files as ES modules, all .cjs files as Common JS modules, and the nested/say-hello.js file as Common JS.

    rules = [
      { type = "CommonJS", globs = ["nested/say-hello.js", "**/*.cjs"]},
      { type = "ESModule", globs = ["**/*.mjs"]}
    ]

    If multiple rules overlap, Wrangler will log a warning about the duplicate rules, and will discard additional rules that matches a module. For example, the following rule configuration classifies dep.js as both a Common JS module and an ES module:

    rules = [
      { type = "CommonJS", globs = ["dep.js"]},
      { type = "ESModule", globs = ["dep.js"]}
    ]

    Wrangler will treat dep.js as a Common JS module, since that was the first rule that matched, and will log the following warning:

    ▲ [WARNING] Ignoring duplicate module: dep.js (esm)
    

    This also adds a new configuration option to wrangler.toml: base_dir. Defaulting to the directory of your Worker's main entrypoint, this tells Wrangler where your additional modules are located, and determines the module paths against which your module rule globs are matched.

    For instance, given the following directory structure:

    - wrangler.toml
    - src/
      - index.html
      - vendor/
        - dependency.js
      - js/
        - index.js
    

    If your wrangler.toml had main = "src/js/index.js", you would need to set base_dir = "src" in order to be able to import src/vendor/dependency.js and src/index.html from src/js/index.js.

Patch Changes
  • #​2957 084b2c58 Thanks @​esimons! - fix: Respect querystring params when calling .fetch on a worker instantiated with unstable_dev

    Previously, querystring params would be stripped, causing issues for test cases that depended on them. For example, given the following worker script:

    export default {
    	fetch(req) {
    		const url = new URL(req.url);
    		const name = url.searchParams.get("name");
    		return new Response("Hello, " + name);
    	},
    };

    would fail the following test case:

    const worker = await unstable_dev("script.js");
    const res = await worker.fetch("http://worker?name=Walshy");
    const text = await res.text();
    // Following fails, as returned text is 'Hello, null'
    expect(text).toBe("Hello, Walshy");
  • #​2840 e311bbbf Thanks @​mrbbot! - fix: make WRANGLER_LOG case-insensitive, warn on unexpected values, and fallback to log if invalid

    Previously, levels set via the WRANGLER_LOG environment-variable were case-sensitive.
    If an unexpected level was set, Wrangler would fallback to none, hiding all logs.
    The fallback has now been switched to log, and lenient case-insensitive matching is used when setting the level.

  • #​2735 3f7a75cc Thanks @​JacobMGEvans! - Fix: Generate Remote URL
    Previous URL was pointing to the old cloudflare/templates repo,
    updated the URL to point to templates in the workers-sdk monorepo.

v2.14.0

Compare Source

Minor Changes
  • #​2914 9af1a640 Thanks @​edevil! - feat: add support for send email bindings

    Support send email bindings in order to send emails from a worker. There
    are three types of bindings:

    • Unrestricted: can send email to any verified destination address.
    • Restricted: can only send email to the supplied destination address (which
      does not need to be specified when sending the email but also needs to be a
      verified destination address).
    • Allowlist: can only send email to the supplied list of verified destination
      addresses.
Patch Changes
  • #​2931 5f6c4c0c Thanks @​Skye-31! - Fix: Pages Dev incorrectly allowing people to turn off local mode

    Local mode is not currently supported in Pages Dev, and errors when people attempt to use it. Previously, wrangler hid the "toggle local mode" button when using Pages dev, but this got broken somewhere along the line.


Configuration

📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

Rebasing: Whenever PR is behind base branch, 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 was generated by Mend Renovate. View the repository job log.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Aug 3, 2023

Deploying daim with  Cloudflare Pages  Cloudflare Pages

Latest commit: 12e6b52
Status: ✅  Deploy successful!
Preview URL: https://67b82e77.daim.pages.dev
Branch Preview URL: https://renovate-npm-wrangler-vulner.daim.pages.dev

View logs

@renovate renovate bot added the dependencies label Aug 3, 2023
@vercel
Copy link

vercel bot commented Aug 3, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
daim ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 28, 2024 4:59am

@renovate renovate bot changed the title chore(deps): update dependency wrangler to v3 [security] chore(deps): update dependency wrangler to v3 [security] - autoclosed Aug 28, 2023
@renovate renovate bot closed this Aug 28, 2023
@renovate renovate bot deleted the renovate/npm-wrangler-vulnerability branch August 28, 2023 17:31
@renovate renovate bot changed the title chore(deps): update dependency wrangler to v3 [security] - autoclosed chore(deps): update dependency wrangler to v3 [security] Aug 28, 2023
@renovate renovate bot reopened this Aug 28, 2023
@renovate renovate bot restored the renovate/npm-wrangler-vulnerability branch August 28, 2023 22:15
@renovate renovate bot force-pushed the renovate/npm-wrangler-vulnerability branch from 5f58125 to e5c3791 Compare August 28, 2023 22:16
@renovate renovate bot changed the title chore(deps): update dependency wrangler to v3 [security] chore(deps): update dependency wrangler to v2.20.1 [security] Aug 31, 2023
@renovate renovate bot force-pushed the renovate/npm-wrangler-vulnerability branch from e5c3791 to 332017e Compare August 31, 2023 17:00
@renovate renovate bot force-pushed the renovate/npm-wrangler-vulnerability branch from 332017e to b127468 Compare December 7, 2023 07:41
@renovate renovate bot force-pushed the renovate/npm-wrangler-vulnerability branch from b127468 to f78d971 Compare December 7, 2023 11:13
@renovate renovate bot force-pushed the renovate/npm-wrangler-vulnerability branch from f78d971 to 6d98cd8 Compare December 7, 2023 13:39
@renovate renovate bot force-pushed the renovate/npm-wrangler-vulnerability branch from 6d98cd8 to 6e958c1 Compare December 9, 2023 05:21
@renovate renovate bot force-pushed the renovate/npm-wrangler-vulnerability branch from 6e958c1 to 03d279f Compare December 11, 2023 07:40
@renovate renovate bot force-pushed the renovate/npm-wrangler-vulnerability branch from 03d279f to 91b391b Compare December 13, 2023 03:51
@renovate renovate bot force-pushed the renovate/npm-wrangler-vulnerability branch from 91b391b to 52682c6 Compare January 3, 2024 22:51
@renovate renovate bot changed the title chore(deps): update dependency wrangler to v2.20.1 [security] chore(deps): update dependency wrangler to v2.20.2 [security] Jan 3, 2024
@renovate renovate bot force-pushed the renovate/npm-wrangler-vulnerability branch from 52682c6 to d8da2b4 Compare January 16, 2024 00:53
@renovate renovate bot force-pushed the renovate/npm-wrangler-vulnerability branch from d8da2b4 to e788b15 Compare January 23, 2024 00:15
@renovate renovate bot force-pushed the renovate/npm-wrangler-vulnerability branch from e788b15 to 550fb41 Compare January 23, 2024 01:00
@renovate renovate bot force-pushed the renovate/npm-wrangler-vulnerability branch from 550fb41 to 36d9f67 Compare January 23, 2024 05:06
@renovate renovate bot force-pushed the renovate/npm-wrangler-vulnerability branch from 36d9f67 to 836689e Compare January 25, 2024 01:24
@renovate renovate bot changed the title chore(deps): update dependency wrangler to v2.20.2 [security] chore(deps): update dependency wrangler to v2.20.2 [security] - autoclosed Feb 24, 2024
@renovate renovate bot closed this Feb 24, 2024
@renovate renovate bot deleted the renovate/npm-wrangler-vulnerability branch February 24, 2024 01:42
@renovate renovate bot changed the title chore(deps): update dependency wrangler to v2.20.2 [security] - autoclosed chore(deps): update dependency wrangler to v2.20.2 [security] Feb 24, 2024
@renovate renovate bot reopened this Feb 24, 2024
@renovate renovate bot restored the renovate/npm-wrangler-vulnerability branch February 24, 2024 05:32
@renovate renovate bot force-pushed the renovate/npm-wrangler-vulnerability branch from 836689e to 7b8ef91 Compare February 24, 2024 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants