Skip to content

fix: Bump moment from 2.30.1 to 2.31.0 - #952

Merged
mtrezza merged 1 commit into
parse-community:masterfrom
mtrezza:fix/moment-2.31.0
Oct 25, 2026
Merged

mtrezza merged 1 commit into
parse-community:masterfrom
mtrezza:fix/moment-2.31.0

Conversation

@mtrezza

@mtrezza mtrezza commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

Closes #943

Bumps the transitive production dependency moment from 2.30.1 to 2.31.0. This fixes a medium-severity advisory. Only package-lock.json changes.

Security

Dependabot alert Advisory Severity Vulnerable Patched Alert state
445 GHSA-4p3w-j4w9-5jqw (CVE-2026-17495): Path traversal in moment.locale() via a crafted non-string locale name Medium (CVSS 5.9) >= 2.29.2, < 2.31.0 2.31.0 Open

This is the only moment alert in the repository, in any state.

moment is a production dependency. npm ls moment --omit=dev shows the only path: parse-server 9.10.7 → winston-daily-rotate-file 5.0.0 → file-stream-rotator 0.6.1 → moment.

Version

2.31.0 is Dependabot's target and the current latest. It satisfies the ^2.29.1 range of file-stream-rotator 0.6.1, so no parent package changes.

2.31.0 is the first moment release since 2.30.1 (December 2023). Its origin checks out:

  • It was published on 2026-09-15 through npm trusted publishing (GitHub Actions OIDC). 2.30.1 was published manually, without provenance.
  • Its SLSA provenance attestation names the moment/moment workflow .github/workflows/release.yml at tag 2.31.0, commit moment/moment@15b45d4. The attested digest equals the integrity value in this lock.
  • The tag 2.31.0 points to that commit ("[pkg] Build 2.31.0", [pkg] Build 2.31.0 moment/moment#6452), and GitHub shows its signature as verified.
  • In the published tarball, these files are byte-identical to the tag: moment.js (the main entry), min/moment-with-locales.js, min/locales.js, locale/uk.js, src/lib/locale/locales.js and src/lib/units/offset.js. package.json differs only by publish normalization: packageManager is removed and repository is written as an object. The package has no preinstall, install, postinstall or prepare script.

Lock file changes

Package Before After
moment 2.30.1 2.31.0

Impact on this project

  • parse-server's WinstonLogger writes parse-server.info and parse-server.err through winston-daily-rotate-file whenever logsFolder is set. The default is ./logs/ (./test_logs/ when TESTING=1). This example sets no logger options, so these transports are active.
  • parse-server passes no datePattern, and its logger options cannot set one. file-stream-rotator therefore always uses the default YYYY-MM-DD.
  • file-stream-rotator 0.6.1 loads moment through its main entry (require('moment')). It calls only these APIs:
    • moment(), moment.utc() and .local()
    • .minutes() and .hour(), as getters and setters
    • .format(date_format)
    • .add(1, 'day'), .subtract(n, 'days').valueOf() and .endOf('day')
  • It never calls moment.locale(), defineLocale() or updateLocale(), and never parses strings. It uses only the built-in en locale, whose definition is byte-identical in both versions.
  • The vulnerable locale lazy-loading path is therefore not reachable from this project. Of the changed code, only format() is reached. Its token regex and cache key changed, but the output for YYYY-MM-DD is unchanged.
  • parse-server 9.10.7 does not use moment itself. This repository's code (cloud/, config.ts, index.ts, spec/) never imports moment or calls locale().
  • Nothing in the dependency tree imports moment/locale/* or moment/min/*. Those paths still exist in 2.31.0, which adds no exports map.

Changes

moment 2.31.0

Security fixes:

Bug fixes:

New features:

  • [feature] Add internal date-default hook for Moment Timezone moment/moment#6451 Add internal date-default hook for Moment Timezone.
    • Parsing now takes the omitted year, month and day from a new internal hook, moment._getDefaultDateParts(), which Moment Timezone can override.
    • When parsing with an array of formats, all candidates now use the same current time, and week-based defaults use that time instead of reading the clock again.

New locales:

Updates to existing locales:

Not in the release notes (found in the commits):

  • Packaging: the tarball is now built from a files allowlist.
    • The only file removed is package.js, the Dojo build profile. It was renamed to dojo.profile.js, and dojoBuild points to it.
    • These are unchanged: main (./moment.js), jsnext:main, typings, typesVersions and engines.node (*). There is still no exports map.
  • Build: the bundles are now built with Rollup 4 instead of 2.17.1. This reorders and renames internal functions in moment.js, but the public API is unchanged.
  • Locales: bm adds a comment, and mk removes a blank line.
  • Repository only: docs, CI, tests, a security policy, a threat model and development tooling. The "Merge commit from fork" adds only the advisory's regression tests.

Breaking Changes

None

Code Changes Required

None — the upgrade is a drop-in replacement.

Summary by CodeRabbit

  • Chores
    • Updated the recorded version of an underlying date-and-time library. No user-facing changes are noted.

@parse-github-assistant

Copy link
Copy Markdown

🚀 Thanks for opening this pull request! We appreciate your effort in improving the project. Please let us know once your pull request is ready for review.

Tip

  • Keep pull requests small. Large PRs will be rejected. Break complex features into smaller, incremental PRs.
  • Use Test Driven Development. Write failing tests before implementing functionality. Ensure tests pass.
  • Group code into logical blocks. Add a short comment before each block to explain its purpose.
  • We offer conceptual guidance. Coding is up to you. PRs must be merge-ready for human review.
  • Our review focuses on concept, not quality. PRs with code issues will be rejected. Use an AI agent.
  • Human review time is precious. Avoid review ping-pong. Inspect and test your AI-generated code.

Note

Please respond to review comments from AI agents just like you would to comments from a human reviewer. Let the reviewer resolve their own comments, unless they have reviewed and accepted your commit, or agreed with your explanation for why the feedback was incorrect.

Caution

Pull requests must be written using an AI agent with human supervision. Pull requests written entirely by a human will likely be rejected, because of lower code quality, higher review effort and the higher risk of introducing bugs. Please note that AI review comments on this pull request alone do not satisfy this requirement. Our CI and AI review are safeguards, not development tools. If many issues are flagged, rethink your development approach. Invest more effort in planning and design rather than using review cycles to fix low-quality code.

@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 03b380eb-8770-4612-8c0c-77adc1f8ccca
Commits

Reviewing files that changed from the base of the PR and between 3f95687 and 5e77308.

Files selected for processing: 1
  • package-lock.json

Included review availability: This review used your included allowance. Your plan provides up to 5 included reviews per hour; 2 remain after this review.

Walkthrough

The lockfile updates both Moment entries from version 2.30.1 to 2.31.0. It records the updated tarball URLs and integrity hashes.

Changes: Moment dependency update

Layer / File(s) Summary
Update Moment lockfile records
package-lock.json
The dependency entry and installed package entry now reference Moment 2.31.0, with updated tarball URLs and integrity hashes. The installed package entry records the MIT license.

Priority: Normal

Estimated code review effort: 1 (Trivial) | ~4 minutes

Possibly related PRs

Merge Risk: Minimal · up to 5e773

The dependency update is consistent and presents no actionable merge-blocking risk.

Pre-merge checks: Passed 7
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title begins with the allowed prefix fix: and uses a capitalized first word. It accurately describes the moment dependency update from 2.30.1 to 2.31.0.
Linked Issues check Passed The active linked issue is #943. The lockfile changes both moment records from 2.30.1 to 2.31.0 and update the resolved tarball and integrity value. This installs the release that contains CVE-2026-…
Out of Scope Changes check Passed The diff changes only package-lock.json. It updates the requested moment package records and adds the corresponding npm-generated license metadata. No unrelated source, dependency, or configurat…
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Security Check Passed The pull request changes only package-lock.json. It replaces the transitive production dependency moment 2.30.1 with 2.31.0 in both lockfile sections, using the matching npm tarball URL and integrity …
Engage In Review Feedback Passed PASS. The current review produced zero actionable findings, and no CodeRabbit review threads were returned. Therefore, no review feedback required engagement, implementation, or reviewer retraction.
Full details: Linked Issues check

Explanation

The active linked issue is #943. The lockfile changes both moment records from 2.30.1 to 2.31.0 and update the resolved tarball and integrity value. This installs the release that contains CVE-2026-17495 and the listed release fixes, locales, and date-default hook. No project code change is required for this dependency upgrade. Closed issue #6376 supplies historical context only.

Full details: Out of Scope Changes check

Explanation

The diff changes only package-lock.json. It updates the requested moment package records and adds the corresponding npm-generated license metadata. No unrelated source, dependency, or configuration change is present.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

Full details: Security Check

Explanation

The pull request changes only package-lock.json. It replaces the transitive production dependency moment 2.30.1 with 2.31.0 in both lockfile sections, using the matching npm tarball URL and integrity hash. No source code, scripts, dependency ranges, or new packages are introduced. The change removes the vulnerable moment version rather than adding a security-sensitive code pattern.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@mtrezza
mtrezza merged commit 6e042b4 into parse-community:master Oct 25, 2026
4 checks passed
@mtrezza
mtrezza deleted the fix/moment-2.31.0 branch October 25, 2026 08:26
parseplatformorg pushed a commit that referenced this pull request Oct 25, 2026
# [3.1.0](3.0.0...3.1.0) (2026-10-25)

### Bug Fixes

* Bump ip-address from 10.1.0 to 10.7.4 and parse-server from 9.10.0 to 9.10.7 ([#946](#946)) ([62c53da](62c53da))
* Bump moment from 2.30.1 to 2.31.0 ([#952](#952)) ([6e042b4](6e042b4))
* Bump parse-server from 9.2.0 to 9.6.1 ([#819](#819)) ([85afc1f](85afc1f))
* Bump websocket-driver from 0.7.4 to 0.7.5 ([#912](#912)) ([70f7a44](70f7a44))
* Security upgrade brace-expansion from 5.0.5 to 5.0.7 ([#923](#923)) ([888e594](888e594))
* Security upgrade jws ([#749](#749)) ([198e1c9](198e1c9))

### Features

* Add TypeScript support ([#595](#595)) ([c9b119a](c9b119a))
* Upgrade to parse-server 9.2.0 ([#788](#788)) ([eef10d5](eef10d5))
@parseplatformorg

Copy link
Copy Markdown

🎉 This change has been released in version 3.1.0

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.

2 participants