mike-works / sql-fundamentals

Mike North's SQL Fundamentals and Professional SQL Courses
https://frontendmasters.com/courses/sql-fundamentals/
BSD 3-Clause "New" or "Revised" License
169 stars 108 forks source link

fix(deps): update dependency moment to v2.29.4 [security] #390

Open renovate[bot] opened 3 months ago

renovate[bot] commented 3 months ago

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
moment (source) 2.29.2 -> 2.29.4 age adoption passing confidence

GitHub Vulnerability Alerts

CVE-2022-24785

Impact

This vulnerability impacts npm (server) users of moment.js, especially if user provided locale string, eg fr is directly used to switch moment locale.

Patches

This problem is patched in 2.29.2, and the patch can be applied to all affected versions (from 1.0.1 up until 2.29.1, inclusive).

Workarounds

Sanitize user-provided locale name before passing it to moment.js.

References

Are there any links users can visit to find out more?

For more information

If you have any questions or comments about this advisory:

CVE-2022-31129

Impact

Patches

The problem is patched in 2.29.4, the patch can be applied to all affected versions with minimal tweaking.

Workarounds

In general, given the proliferation of ReDoS attacks, it makes sense to limit the length of the user input to something sane, like 200 characters or less. I haven't seen legitimate cases of date-time strings longer than that, so all moment users who do pass a user-originating string to constructor are encouraged to apply such a rudimentary filter, that would help with this but also most future ReDoS vulnerabilities.

References

There is an excellent writeup of the issue here: https://github.com/moment/moment/pull/6015#issuecomment-1152961973=

Details

The issue is rooted in the code that removes legacy comments (stuff inside parenthesis) from strings during rfc2822 parsing. moment("(".repeat(500000)) will take a few minutes to process, which is unacceptable.


Release Notes

moment/moment (moment) ### [`v2.29.4`](https://redirect.github.com/moment/moment/blob/HEAD/CHANGELOG.md#2294) [Compare Source](https://redirect.github.com/moment/moment/compare/2.29.3...2.29.4) - Release Jul 6, 2022 - [#​6015](https://redirect.github.com/moment/moment/pull/6015) \[bugfix] Fix ReDoS in preprocessRFC2822 regex ### [`v2.29.3`](https://redirect.github.com/moment/moment/blob/HEAD/CHANGELOG.md#2293-Full-changelog) [Compare Source](https://redirect.github.com/moment/moment/compare/2.29.2...2.29.3) - Release Apr 17, 2022 - [#​5995](https://redirect.github.com/moment/moment/pull/5995) \[bugfix] Remove const usage - [#​5990](https://redirect.github.com/moment/moment/pull/5990) misc: fix advisory link

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.



This PR was generated by Mend Renovate. View the repository job log.

renovate[bot] commented 3 months ago

⚠️ 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:

The artifact failure details are included below:

File name: yarn.lock
[07:09:30.107] INFO (60): Installing tool node@9.11.2...
[07:18:07.954] ERROR (60): download failed
    run: 3
    err: {
      "type": "ReadError",
      "message": "The server aborted pending request: The server aborted pending request",
      "stack":
          ReadError: The server aborted pending request
              at IncomingMessage.<anonymous> (/snapshot/dist/containerbase-cli.js:38025:25)
              at Object.onceWrapper (node:events:632:28)
              at IncomingMessage.emit (node:events:530:35)
              at IncomingMessage.emit (node:domain:488:12)
              at IncomingMessage._destroy (node:_http_incoming:224:10)
              at _destroy (node:internal/streams/destroy:121:10)
              at IncomingMessage.destroy (node:internal/streams/destroy:83:5)
              at TLSSocket.socketCloseListener (node:_http_client:455:11)
              at TLSSocket.emit (node:events:530:35)
              at TLSSocket.emit (node:domain:488:12)
          caused by: 
      "code": "ECONNRESET",
      "timings": {
        "start": 1722928528734,
        "socket": 1722928528734,
        "lookup": 1722928528739,
        "connect": 1722928528742,
        "secureConnect": 1722928528745,
        "upload": 1722928528745,
        "response": 1722928529342,
        "error": 1722928687954,
        "abort": 1722928687954,
        "phases": {
          "wait": 0,
          "dns": 5,
          "tcp": 3,
          "tls": 3,
          "request": 0,
          "firstByte": 597,
          "total": 159220
        }
      },
      "name": "ReadError",
      "options": {
        "agent": {},
        "decompress": true,
        "timeout": {},
        "prefixUrl": "",
        "ignoreInvalidCookies": false,
        "context": {},
        "hooks": {
          "init": [],
          "beforeRequest": [],
          "beforeError": [],
          "beforeRedirect": [],
          "beforeRetry": [],
          "afterResponse": []
        },
        "followRedirect": true,
        "maxRedirects": 10,
        "throwHttpErrors": true,
        "username": "",
        "password": "",
        "http2": false,
        "allowGetBody": false,
        "headers": {
          "user-agent": "containerbase/11.6.6 node/20.11.1 (https://github.com/containerbase)",
          "accept-encoding": "gzip, deflate, br"
        },
        "methodRewriting": false,
        "retry": {
          "limit": 2,
          "methods": [
            "GET",
            "PUT",
            "HEAD",
            "DELETE",
            "OPTIONS",
            "TRACE"
          ],
          "statusCodes": [
            408,
            413,
            429,
            500,
            502,
            503,
            504,
            521,
            522,
            524
          ],
          "errorCodes": [
            "ETIMEDOUT",
            "ECONNRESET",
            "EADDRINUSE",
            "ECONNREFUSED",
            "EPIPE",
            "ENOTFOUND",
            "ENETUNREACH",
            "EAI_AGAIN"
          ],
          "backoffLimit": null,
          "noise": 100
        },
        "method": "GET",
        "cacheOptions": {},
        "https": {},
        "resolveBodyOnly": false,
        "isStream": true,
        "responseType": "text",
        "url": "https://nodejs.org/dist/v9.11.2/node-v9.11.2-linux-x64.tar.xz",
        "pagination": {
          "countLimit": null,
          "backoff": 0,
          "requestLimit": 10000,
          "stackAllItems": false
        },
        "setHost": true,
        "enableUnixSockets": false
      }
    }
[07:18:07.977] ERROR (60): download failed
[07:18:07.978] FATAL (60): Install tool node failed in 8m 37.8s.