Skip to content

fix(app): reject unsafe deepSet path segments - #9295

Open
russellwheatley wants to merge 2 commits into
mainfrom
fix-app-low-deepset-proto-pollution
Open

fix(app): reject unsafe deepSet path segments#9295
russellwheatley wants to merge 2 commits into
mainfrom
fix-app-low-deepset-proto-pollution

Conversation

@russellwheatley

Copy link
Copy Markdown
Member

Rejects __proto__, prototype, and constructor path segments in deepSet before traversal, closing a low-severity prototype-pollution primitive (CWE-1321).

deepSet({}, 'constructor.prototype.polluted', true, false) previously walked the inherited constructor -> prototype chain and wrote onto Object.prototype, so any unrelated object created afterward inherited polluted.

  • Add the guard in packages/app/lib/common/deeps.ts
  • Add regression tests for both the __proto__ and constructor.prototype attack forms

Reported privately through the OSS security inbox. deepSet is currently only reachable internally via MutatableParams, no remotely-controlled call path was identified.

@russellwheatley russellwheatley changed the title fix(app): [LOW] reject unsafe deepSet path segments fix(app): reject unsafe deepSet path segments Sep 4, 2026
@russellwheatley russellwheatley changed the title fix(app): reject unsafe deepSet path segments fix(app): [LOW] reject unsafe deepSet path segments Sep 4, 2026
@russellwheatley
russellwheatley force-pushed the fix-app-low-deepset-proto-pollution branch from 1decfac to 773c012 Compare September 4, 2026 12:42
@codecov

codecov Bot commented Sep 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.79%. Comparing base (afaba0b) to head (ed3159f).
⚠️ Report is 24 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9295      +/-   ##
============================================
+ Coverage     69.45%   69.79%   +0.35%     
- Complexity     2122     2130       +8     
============================================
  Files           443      438       -5     
  Lines         25537    25468      -69     
  Branches       4259     4251       -8     
============================================
+ Hits          17733    17772      +39     
+ Misses         6404     6357      -47     
+ Partials       1400     1339      -61     
Flag Coverage Δ
android-native 65.93% <ø> (+0.18%) ⬆️
e2e-ts-android 54.48% <0.00%> (+0.35%) ⬆️
e2e-ts-ios 53.90% <0.00%> (+0.29%) ⬆️
e2e-ts-macos 49.95% <0.00%> (+0.08%) ⬆️
ios-ruby 100.00% <ø> (ø)
jest 48.39% <100.00%> (+0.68%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 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.

@russellwheatley russellwheatley changed the title fix(app): [LOW] reject unsafe deepSet path segments fix(app): reject unsafe deepSet path segments Sep 8, 2026
@russellwheatley
russellwheatley force-pushed the fix-app-low-deepset-proto-pollution branch from 773c012 to 6cb70d2 Compare September 8, 2026 10:23
Packages cross-import each other's built dist output (e.g. database
imports @react-native-firebase/app/dist/module/common/deeps), which
resolves through the workspace symlink to packages/*/dist/**. Jest's
default coveragePathIgnorePatterns only excludes node_modules/, so it
was instrumenting both that build artifact and the lib/**.ts source it
was compiled from. Any shared file with branches got a second,
all-zero coverage entry alongside the real one, which is what made
codecov/patch misreport fully-tested lines in deepSet's new guard as
partial/miss.
@russellwheatley
russellwheatley marked this pull request as ready for review September 8, 2026 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant