Skip to content

fix: Bump body-parser from 2.3.0 to 2.4.0 - #960

Merged
mtrezza merged 1 commit into
parse-community:masterfrom
mtrezza:fix/body-parser-2.4.0
Oct 27, 2026
Merged

mtrezza merged 1 commit into
parse-community:masterfrom
mtrezza:fix/body-parser-2.4.0

Conversation

@mtrezza

@mtrezza mtrezza commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Closes #949

Issue

Addresses Dependabot alert 470 (high): GHSA-27r3-jxmh-p828 / CVE-2026-111181, "body-parser vulnerable to Denial of Service via trailing bytes after a compressed request body". Vulnerable >= 2.0.0, < 2.4.0; patched in 2.4.0.

body-parser is a transitive production dependency (npm ls body-parser --omit=dev): [email protected] → body-parser, and [email protected] → @apollo/[email protected] → body-parser (deduped). The lock has a single hoisted copy, so this update covers both parents.

Reachability in this app

index.ts mounts server.app at /parse and adds no body parser of its own. [email protected] mounts three body-parser parsers on server.app. Express 5's express.json, express.urlencoded and express.raw are body-parser's parsers.

  1. express.json({ type: req => !req.is('multipart/form-data'), limit: maxUploadSize }) in lib/ParseServer.js handles every request body that is not multipart/form-data.
  2. express.urlencoded({ extended: false }) in lib/ParseServer.js is mounted on /, in front of the pages router.
  3. express.raw({ type: () => true, limit }) in lib/Routers/FilesRouter.js handles file uploads (POST /files/:filename).

All three read compressed bodies through body-parser's shared read path, and all three run before Parse Server checks the application ID or any key. A test harness replicated these three mounts. With [email protected], a gzip-encoded body followed by extra bytes terminated the Node.js process through each of them. With 2.4.0, the process stayed up in every case.

Changes

Lock file

Changed entries:

  • body-parser 2.3.0 → 2.4.0
  • body-parser/node_modules/content-type 2.0.0 → 2.1.0, because [email protected] requires content-type@^2.1.0. Version 2.1.0 adds two opt-in parse() options, comma and start (Parse up to comma jshttp/content-type#72). body-parser calls contentType.parse(header) without options and only reads the charset parameter, so the new options stay off. Running 20,035 Content-Type headers through that exact call gave identical results with 2.0.0 and 2.1.0. The top-level [email protected] (used by express and @apollo/server) and the copy under type-is are unchanged.

[email protected] and [email protected] were already in the lock. The qs changes only affect extended URL-encoded parsing, and Parse Server uses extended: false.

This lock was generated with npm update body-parser --package-lock-only on the current master (d7753a5), instead of reusing the lock from #949. Dependabot's lock (+20/−152) also removes the entries for gcp-metadata (with its nested gaxios and node-fetch) and socks, which are optional peer dependencies of mongodb, and for smart-buffer, a dependency of socks. That removal is unrelated to this update. This lock changes only the two entries above.

Breaking Changes

None

Code Changes Required

None. The upgrade is a lock-file-only drop-in replacement.

Summary by CodeRabbit

  • Chores
    • Updated the app’s underlying request parsing components to newer versions.

@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 27, 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: c7918cc5-3502-4271-a1e6-f304e10f4da3
Commits

Reviewing files that changed from the base of the PR and between d7753a5 and 22b1566.

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 body-parser from 2.3.0 to 2.4.0. It also updates the dependency requirements and the nested content-type resolution.

Changes: Dependency update

Layer / File(s) Summary
Update body-parser resolutions
package-lock.json
The lockfile records body-parser 2.4.0, updates its content-type, iconv-lite, and qs requirements, and resolves nested content-type to 2.1.0.

Priority: Normal

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

Possibly related PRs

Merge Risk: Minimal · up to 22b15

This dependency-only update is ready to merge with normal checks.

Pre-merge checks: Passed 6
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title begins with the required fix: prefix and uses a capitalized first letter in the description. It accurately describes the body-parser dependency update.
Linked Issues check Passed Issue #949 requires body-parser 2.4.0 and its release fixes. The whole-PR lockfile diff updates both lockfile representations from 2.3.0 to 2.4.0 and records the required nested content-type 2.1.0…
Out of Scope Changes check Passed The whole-PR diff changes only package-lock.json. It updates body-parser and the nested content-type entry, plus the dependency ranges required by body-parser 2.4.0. These changes directly sup…
Security Check Passed PASS. The pull request changes only package-lock.json. It replaces body-parser 2.3.0 with 2.4.0 and updates its nested content-type dependency to 2.1.0, with matching integrity values in both lockfile…
Engage In Review Feedback Passed PASS: The supplied review metadata reports zero actionable findings and no CodeRabbit review threads. Therefore, no review feedback required engagement, implementation, or reviewer agreement.
Full details: Linked Issues check

Explanation

Issue #949 requires body-parser 2.4.0 and its release fixes. The whole-PR lockfile diff updates both lockfile representations from 2.3.0 to 2.4.0 and records the required nested content-type 2.1.0 dependency. The installed package therefore includes the CVE-2026-111181 fix and the 2.4.0 parser behavior, including conditional zstd support. The issue does not require application code changes or a repository test addition.

Full details: Out of Scope Changes check

Explanation

The whole-PR diff changes only package-lock.json. It updates body-parser and the nested content-type entry, plus the dependency ranges required by body-parser 2.4.0. These changes directly support issue #949. No unrelated source, configuration, or dependency changes are present.

Full details: Security Check

Explanation

PASS. The pull request changes only package-lock.json. It replaces body-parser 2.3.0 with 2.4.0 and updates its nested content-type dependency to 2.1.0, with matching integrity values in both lockfile representations. No application code or executable lifecycle configuration changed, and the diff introduces no security-vulnerable 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 8d76e46 into parse-community:master Oct 27, 2026
4 checks passed
@mtrezza
mtrezza deleted the fix/body-parser-2.4.0 branch October 27, 2026 01:20
parseplatformorg pushed a commit that referenced this pull request Oct 27, 2026
## [3.1.3](3.1.2...3.1.3) (2026-10-27)

### Bug Fixes

* Bump body-parser from 2.3.0 to 2.4.0 ([#960](#960)) ([8d76e46](8d76e46))
@parseplatformorg

Copy link
Copy Markdown

🎉 This change has been released in version 3.1.3

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