Skip to content

refactor: Bump json from 2.19.3 to 2.19.9 - #1942

Merged
mtrezza merged 1 commit into
parse-community:masterfrom
mtrezza:refactor/json-2.19.9
Oct 24, 2026
Merged

mtrezza merged 1 commit into
parse-community:masterfrom
mtrezza:refactor/json-2.19.9

Conversation

@mtrezza

@mtrezza mtrezza commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

Closes #1904

Security update of a development-only, transitive Ruby gem. Resolves Dependabot alert 118, low severity:

json is only part of the Ruby tooling in the Gemfile: jazzy and cgi for the API docs, and xcpretty, rake and plist for building, testing and the release version bump. None of it ships with the SDK. Dependabot reports the alert with runtime scope because the Gemfile does not use groups. In the lock file, json is a transitive dependency (jazzy → cocoapods → cocoapods-core → algoliasearch → json (>= 1.5.1)). jazzy itself also uses it at runtime.

Changes

  • 2.19.4: Fixed parsing of out-of-range floats (very large exponents that lead to either 0.0 or Inf)
  • 2.19.5: The parser now emits at most 5 deprecation warnings per document
  • 2.19.6: Overly large depth generator arguments are handled cleanly; added a missing write barrier in ParserConfig
  • 2.19.7: Fixed more edge cases with out-of-range floats; the string passed to JSON.parse can no longer be mutated during parsing; added missing write barriers in State#dup; further validation of the generator depth config
  • 2.19.8: Fixed a 1-byte buffer overread on EOS errors; invalid types passed as the max_nesting option are now handled, and non-numeric values raise a TypeError (see below)
  • 2.19.9: Fixed a buffer overflow that could lead to a crash when writing JSON directly into an IO with JSON.generate(object, io) (CVE-2026-54696)

2.19.3 was released from a backport branch, 2.19.4 and later from the main branch. The newer releases therefore also contain main-branch changes without changelog entries: embeddable TypedData objects, a GC marking fix for the parser value stack, Ruby 4.1.0dev compatibility, encoding check performance improvements, and TruffleRuby-only fixes. The 2.19.3 fix (unescaped control characters preceded by a backslash) is part of 2.19.9 as well.

json 2.20.x and 2.21.x have been released since, but are not taken here. This PR stays at 2.19.9, the Dependabot target and first patched version, because the lock file cannot be regenerated locally (see Lock file).

Breaking Changes

None

The stricter option checks in 2.19.6–2.19.8 only reject invalid values (non-numeric max_nesting, negative or out-of-range depth). In 2.19.8 (ruby/json@be8d068), the C generator reads max_nesting with NUM2LONG instead of FIX2LONG, so a non-numeric value now raises a TypeError instead of being silently misread. The TruffleRuby generator now raises a TypeError for any non-Integer value.

This affects one parent API path. cocoapods-core 1.16.2 implements Specification#to_json(*a) as JSON.dump(to_hash, *a). When a spec is serialized as part of another object, the generator calls spec.to_json(state), and JSON.dump treats the JSON::State as its limit argument and passes max_nesting: <State>. Up to 2.19.7 this was silently accepted; since 2.19.8 it raises a TypeError. This repository cannot reach that path: Scripts/jazzy.sh runs jazzy --objc without --podspec, the repository has no *.podspec, and jazzy only loads CocoaPods in PodspecDocumenter.create_podspec. So cocoapods, cocoapods-core and algoliasearch are not loaded in docs, CI or release.

The other uses pass default or valid options: algoliasearch (to_json, JSON.parse), jazzy (JSON.parse, to_json, JSON.pretty_generate) and activesupport (JSON.generate with max_nesting: false, which behaves as before).

Code Changes Required

None — the upgrade is a drop-in replacement.

Lock file

The Gemfile.lock change reproduces the diff of #1904: the json spec entry and its CHECKSUMS entry. The lock file is BUNDLED WITH Bundler 4.0.10, which the local Bundler cannot handle, so the lock file was not regenerated. The new checksum was verified against the published gem: sha256=9b9025b7cdddafa38d316eca0b2358488e42d417045c1b90d216a9fefe46b79a matches both the rubygems.org versions API for json 2.19.9 (platform ruby) and the SHA-256 of the downloaded json-2.19.9.gem.

json 2.19.9 requires Ruby >= 2.7, like 2.19.3. ci.yml, release-automated.yml and release-manual-docs.yml install the bundle with ruby/setup-ruby (bundler-cache: true, Ruby 4.0.0 from .ruby-version), which runs bundle install against this lock file. PR CI passes with this lock file, including the docs job, which installs the bundle and runs jazzy.

@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 24, 2026

Copy link
Copy Markdown

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters: 1
  • Gemfile.lock is excluded by !**/*.lock

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

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: 09f4f9ec-52aa-4514-a091-5a189c56b025

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@codecov

codecov Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.73%. Comparing base (dd05d41) to head (af3b99e).
⚠️ Report is 106 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master    #1942       +/-   ##
===========================================
+ Coverage   64.24%   85.73%   +21.48%     
===========================================
  Files         201      282       +81     
  Lines       23233    31241     +8008     
===========================================
+ Hits        14926    26784    +11858     
+ Misses       8307     4457     -3850     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mtrezza
mtrezza merged commit 5a662b1 into parse-community:master Oct 24, 2026
18 checks passed
@mtrezza
mtrezza deleted the refactor/json-2.19.9 branch October 24, 2026 19:56
@parseplatformorg

Copy link
Copy Markdown
Contributor

🎉 This change has been released in version 7.1.0

@parseplatformorg parseplatformorg added the state:released Released as stable version label Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state:released Released as stable version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants