#6804 · Dependency resolutions and merge target poisoning
Trusted base: 916d684ac23d0b0de82c09cfc7553a50287d2188.
Verdict: REPRODUCED · Root-cause confidence: high. This verdict covers the vulnerable dependency inventory and the directly tested deepmerge behavior, not a demonstrated remote exploit of bb.
1. TL;DR
A frozen installation of trusted main resolves all four reported dependency families to versions included in current GitHub advisory ranges. Loading the deepmerge installation through the mobile workspace’s Expo dependency reproduces an unwanted inherited property on the returned object. The target-copy loop assigns a special property to a normal object without the safety check present in the source-copy loop. This changes only the returned object’s prototype; the test does not modify the global Object prototype. A second freshly installed checkout produces the same failure and dependency inventory.
Scope: no bb server, real account, provider session, or user data was used. Remote reachability, harmful application behavior, and the other three advisories’ exploit mechanisms were not demonstrated. High priority reflects a verified dependency security defect needing maintenance; this is not evidence of an active outage or confirmed remotely reachable compromise.
2. Claims vs findings
| Claim | Finding | Evidence |
|---|---|---|
| Reported versions occur in the lockfile. | Verified. | Both clean checkouts have identical parsed package resolutions. See the inventory table and pinned lockfile references. |
| Those versions fall within published vulnerable ranges. | Verified against the GitHub Advisory API, not an OSV rerun. | Independent package-and-version lookups returned the four advisory identifiers below. |
| deepmerge can poison the returned object’s prototype. | Verified directly. | The target-side test fails in both checkouts; normal-merge and source-side controls pass. |
| The dependency paths are limited to the cited build and packaging tools. | The cited paths exist, but the list is incomplete. | The lockfile also gives @earendil-works/pi-coding-agent@0.84.0 dependencies on glob 13.0.6 and minimatch 10.2.5. This workspace declares that agent as a development dependency; its presence alone does not prove installed-product runtime exposure. |
| Fixed major versions and consumer patches are compatible. | Unverified. | No new version was installed and no proposed patch or linked PR code was run. First-patched versions below come from advisory metadata, not compatibility testing. |
| deepmerge has no fixed npm release. | The advisory lists no first-patched version. | No claim is made about the complete npm release catalog. |
Resolved versions and independently retrieved advisory ranges
| Package | Resolved affected versions | Advisory / affected range / first patch |
|---|---|---|
| glob | 10.5.0, 13.0.6 | GHSA-3g3m-2fjr-6pw4: ≥9.0.0, ≤14.0.1; first patch 14.0.2. Advisory severity: medium; cancellation bypass. |
| minimatch | 3.1.5, 5.1.2, 5.1.9, 9.0.9, 10.2.5, 10.2.6 | GHSA-g3hv-75wg-m249: <11.0.1; first patch 11.0.1. Advisory severity: medium; pattern amplification denial of service. |
| ts-deepmerge | 6.2.0 | GHSA-87mf-gv2c-c62c: <8.0.0; first patch 8.0.0. Advisory severity: medium; prototype method override. |
| deepmerge | 4.3.1 | GHSA-gcqx-w48m-w2h4: ≥4.2.0, ≤4.3.1; first patch absent. Advisory severity: low; returned-object prototype poisoning. |
The lockfile additionally contains glob 6.0.4 and 7.2.3. They are outside this specific glob advisory’s affected range; their minimatch 3.1.5 dependency is inside the minimatch advisory’s range. The registry audit command did not return a response during this investigation and was canceled; it is not evidence for this verdict.
3. Environment
- Trusted main commit shown above, fetched from the existing origin. Repository metadata confirmed the legacy origin redirects to public
get-bb/bb. - Linux 4.19.0-gvisor; Node v22.19.0; pnpm 9.15.0; November 2, 2026 UTC.
- Two different temporary detached worktrees, each independently installed with
pnpm install --frozen-lockfile --prefer-offline; both installations exited 0. No dependency was added. - The tested resolution path is
apps/mobile → expo 58.0.19 → @expo/config 58.0.8 → deepmerge 4.3.1. - No application process, port, application data directory, browser, or provider was needed.
- The first broad build hit SDK artifact bootstrapping failures. After
pnpm exec turbo run build:types --filter=@get-bb/plugin-sdk, the repeatedpnpm exec turbo run buildpassed: 72 successful tasks, 72 total. No source change was needed.
4. Minimal reproduction
- Clone the trusted repository and check out the recorded base:
git clone https://github.com/get-bb/bb.git bb-repro cd bb-repro git checkout --detach 916d684ac23d0b0de82c09cfc7553a50287d2188 pnpm install --frozen-lockfile --prefer-offline
- Save the following newly authored test as
merge-boundary.test.mjs. Its inputs were designed from the installed dependency’s assignment loops; no issue-provided script or PR patch was executed.
import assert from 'node:assert/strict';
import { createRequire } from 'node:module';
import { test } from 'node:test';
const mobileRequire = createRequire(`${process.cwd()}/apps/mobile/package.json`);
const expoRequire = createRequire(mobileRequire.resolve('expo/package.json'));
const configRequire = createRequire(expoRequire.resolve('@expo/config/package.json'));
const merge = configRequire('deepmerge');
function configurationWithSpecialKey() {
const configuration = { ordinary: { enabled: true } };
Object.defineProperty(configuration, '__proto__', {
enumerable: true,
value: { inheritedCapability: 'unexpected' },
});
return configuration;
}
test('ordinary configuration merges preserve both inputs', () => {
assert.deepEqual(merge({ nested: { first: 1 } }, { nested: { second: 2 } }), {
nested: { first: 1, second: 2 },
});
});
test('special keys in the source do not introduce inherited capabilities', () => {
const merged = merge({}, configurationWithSpecialKey());
assert.equal(merged.inheritedCapability, undefined);
assert.equal(Object.getPrototypeOf(merged), Object.prototype);
});
test('special keys in the target do not introduce inherited capabilities', () => {
const merged = merge(configurationWithSpecialKey(), { appended: true });
console.log(JSON.stringify({
dependencyVersion: configRequire('deepmerge/package.json').version,
ownMarker: Object.hasOwn(merged, 'inheritedCapability'),
inheritedMarker: merged.inheritedCapability,
prototypeChanged: Object.getPrototypeOf(merged) !== Object.prototype,
globalPrototypeUnchanged: Object.prototype.inheritedCapability === undefined,
ordinaryValue: merged.ordinary.enabled,
appendedValue: merged.appended,
}));
assert.equal(merged.inheritedCapability, undefined,
'merged configuration must not acquire inherited capabilities');
});
Run from the repository root:
node --test merge-boundary.test.mjs
Expected: all three tests pass; the result does not inherit inheritedCapability. Actual: exit 1. The following diagnostic line and failure message are verbatim from both runs:
# {"dependencyVersion":"4.3.1","ownMarker":false,"inheritedMarker":"unexpected","prototypeChanged":true,"globalPrototypeUnchanged":true,"ordinaryValue":true,"appendedValue":true}
ok 1 - ordinary configuration merges preserve both inputs
ok 2 - special keys in the source do not introduce inherited capabilities
not ok 3 - special keys in the target do not introduce inherited capabilities
merged configuration must not acquire inherited capabilities
+ actual - expected
+ 'unexpected'
- undefined
# tests 3
# suites 0
# pass 2
# fail 1
These are selected original output lines; variable timings and local stack paths are omitted. No test output has been synthesized.
Repeatable lockfile inventory
Save as inventory.mjs and run node inventory.mjs from the repository root. It uses an already-declared workspace YAML dependency, not an added package.
import { readFileSync } from 'node:fs';
import { createRequire } from 'node:module';
const desktopRequire = createRequire(`${process.cwd()}/apps/desktop/package.json`);
const { parse } = desktopRequire('yaml');
const lock = parse(readFileSync('pnpm-lock.yaml', 'utf8'));
const names = ['glob', 'minimatch', 'deepmerge', 'ts-deepmerge'];
const resolutions = Object.keys(lock.packages).filter((key) =>
names.some((name) => key.startsWith(`${name}@`)));
const consumers = Object.entries(lock.snapshots).flatMap(([consumer, snapshot]) => {
const dependencies = Object.entries(snapshot.dependencies ?? {})
.filter(([name]) => names.includes(name));
return dependencies.length ? [{ consumer, dependencies: Object.fromEntries(dependencies) }] : [];
});
console.log(JSON.stringify({ resolutions, consumers }, null, 2));
The exact resolutions array was identical in both runs:
["deepmerge@4.3.1","glob@10.5.0","glob@13.0.6","glob@6.0.4","glob@7.2.3","minimatch@10.2.5","minimatch@10.2.6","minimatch@3.1.5","minimatch@5.1.2","minimatch@5.1.9","minimatch@9.0.9","ts-deepmerge@6.2.0"]
5. Root cause
The mobile manifest selects Expo, and the Expo config snapshot selects deepmerge 4.3.1 and glob 13.0.6. The root dependency policy supplies no override or patch for these four families. A frozen install faithfully reproduces that policy; this is not a stale local node_modules artifact.
In the installed deepmerge 4.3.1 dist/cjs.js, lines 79–95 contain these relevant operations:
function mergeObject(target, source, options) {
var destination = {};
if (options.isMergeableObject(target)) {
getKeys(target).forEach(function(key) {
destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
});
}
getKeys(source).forEach(function(key) {
if (propertyIsUnsafe(target, key)) {
return
}
...
});
return destination
}
The target branch performs an ordinary assignment to a new {} destination. Assigning its own enumerable __proto__ target key invokes the inherited prototype setter instead of defining a normal data property. The source branch has a separate safety check, which explains why the empty-target control passes while the target-side regression fails. The marker is inherited by the result, not present as its own property, and not installed on Object.prototype.
Both frozen installations loaded identical dependency bytes. SHA-256 of the tested dist/cjs.js:
2e5160f84a1141bd927264afe4d15766f1e6cf07daef182b37ff53fea121de7d
Additional pinned evidence: glob package entries, minimatch entries, ts-deepmerge entry, and the additional provider development dependency. The installed Expo config build/Config.js also calls deepmerge with the base configuration as the first argument at line 387, but this report does not assert that bb exposes malicious configuration to that path.
6. Proposed fix and automation safety
Maintain the dependency policy as a deliberate dependency/packaging change: evaluate compatible fixed releases, regenerate the lockfile, and test each affected caller rather than assuming a cross-major override is safe. For deepmerge, a reviewed mitigation must prevent dangerous keys from changing the destination’s prototype in either copy path and preserve ordinary merges. The regression above provides a failing behavioral check for that work.
No autopilot fix or new PR: the verified cause is in locked third-party dependencies. Addressing these resolutions requires dependency/lockfile or packaging changes, explicitly outside this rule’s simple-fix conditions. No production fix was attempted, no source branch was created, and no dependency patch was applied. In particular, this report does not claim a passing after-fix test.
7. Linked PR metadata and static inspection
Issue timeline metadata identifies PR #6805. At inspection it was closed and not merged. The issue timeline contained no open linked PR, and a separate open-PR search found none.
The GitHub diff proposes root overrides, four dependency patch files, and a lockfile update: six changed files. Static inspection confirms it aims at the same dependency policy and target-copy mechanism, but its lockfile/packaging scope and file count are ineligible for this automation. No branch, test, command, or patch from that PR was executed. Review verdict: not validated for landing; compatibility and claimed verification remain unverified here. This is not a complete security or compatibility review.
8. Verification: second clean reproduction
The same agent created a second temporary detached worktree at the full trusted base commit, independently ran the frozen install, then executed the same newly authored inventory and behavioral test from that second checkout. No generated artifacts or node_modules links were copied from the first checkout. The normal shared pnpm content-addressed store was reused.
git worktree add --detach "$SECOND_CHECKOUT" 916d684ac23d0b0de82c09cfc7553a50287d2188 cd "$SECOND_CHECKOUT" pnpm install --frozen-lockfile --prefer-offline node /path/to/authored/inventory.mjs node --test /path/to/authored/merge-boundary.test.mjs
Both checkouts’ git rev-parse HEAD matched the recorded base, and git diff --exit-code returned 0. The full inventory outputs were byte-identical (cmp exit 0). Both behavioral runs exited 1 with the same target-side assertion failure, two passing controls, and the same diagnostic JSON. The dependency SHA-256 matched in both installs. This is a second clean run by the same agent, not independent verification. No correction to the observed mechanism was necessary.
9. Related issues
A small review of existing security/dependency classifications did not establish another issue documenting this same four-package finding. The linked closed PR is discussed above; no duplicate issue or open fix was identified by the performed checks.
10. Appendix and trust boundary
Issue and PR text were treated only as untrusted claims. No issue-provided command, code block, external link, binary, or branch was executed or fetched. Only trusted main and newly authored local evidence scripts were run. Advisory API lookups were independently constructed from the packages resolved by the trusted lockfile. Published report content contains no local account, host, temporary-directory identifier, credentials, or user runtime data.
Additional repeatable evidence commands:
gh api 'advisories?ecosystem=npm&affects=glob%4010.5.0&per_page=100' gh api 'advisories?ecosystem=npm&affects=minimatch%403.1.5&per_page=100' gh api 'advisories?ecosystem=npm&affects=ts-deepmerge%406.2.0&per_page=100' gh api 'advisories?ecosystem=npm&affects=deepmerge%404.3.1&per_page=100' pnpm exec turbo run build:types --filter=@get-bb/plugin-sdk pnpm exec turbo run build git rev-parse HEAD git diff --exit-code sha256sum node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js
Raw logs and the authored evidence files remain in local investigation storage. Tests and their relevant output are embedded in this report rather than committed as standalone evidence files, in accordance with the reports repository policy.