# Risk map — yarnpkg/berry

> Canonical page: https://codevetter.com/unpack/berry/risk-map

# Risk map — yarnpkg/berry

Scanned commit e4e423a1eb117b5129f20ac626a03eb7a97aedff (2026-09-24). Generated by codevetter codevetter 1.15.0 on 2026-10-02.

Source inspection; upstream code and tests were not executed.

These are security-sensitive source observations and one explicitly labeled review hypothesis, not confirmed vulnerabilities. The main boundaries involve dynamic code, inherited environments, authenticated network requests, archive integrity, and filesystem mutation. Persistence ordering and a documented symlink uncertainty also warrant care when changing critical flows.
- Dynamic plugin loading executes dynamicRequire(pluginPath) and factory(pluginRequire); builtin modules remain available. Missing HTTP-sourced plugins are downloaded and written locally, with checksum enforcement conditional on a configured checksum. — [packages/yarnpkg-core/sources/Configuration.ts#L1311-1340](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/Configuration.ts#L1311-L1340) [packages/yarnpkg-core/sources/Configuration.ts#L1360-1401](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/Configuration.ts#L1360-L1401)
- Package lifecycle scripts can execute preinstall/install/postinstall or synthesized node-gyp rebuild; soft links, built metadata, enableScripts, and architecture gate these builds, while explicit run executes selected scripts through the shell. — [packages/plugin-pnp/sources/jsInstallUtils.ts#L15-41](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/plugin-pnp/sources/jsInstallUtils.ts#L15-L41) [packages/yarnpkg-core/sources/scriptUtils.ts#L458-476](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/scriptUtils.ts#L458-L476)
- Configuration reads a home RC file and configured environment files outside the immediate project boundary; makeScriptEnv copies the resulting environment into subprocess environments and prepends temporary wrappers to PATH. — [packages/yarnpkg-core/sources/Configuration.ts#L1183-1193](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/Configuration.ts#L1183-L1193) [packages/yarnpkg-core/sources/Configuration.ts#L1257-1273](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/Configuration.ts#L1257-L1273) [packages/yarnpkg-core/sources/scriptUtils.ts#L108-147](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/scriptUtils.ts#L108-L147)
- Network policy is configurable: unsafe HTTP requires a hostname whitelist, enableNetwork can block requests, enableStrictSsl controls certificate rejection, and optional CA/certificate/key paths are read. npm authentication may supply hook headers, bearer tokens, Basic credentials, or OIDC tokens. — [packages/yarnpkg-core/sources/httpUtils.ts#L231-239](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/httpUtils.ts#L231-L239) [packages/yarnpkg-core/sources/httpUtils.ts#L255-279](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/httpUtils.ts#L255-L279) [packages/plugin-npm/sources/npmHttpUtils.ts#L445-477](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/plugin-npm/sources/npmHttpUtils.ts#L445-L477)
- Archive mismatch handling depends on checksumBehavior: ignore preserves the expected hash, update accepts the actual hash, reset rejects the cached entry, and throw errors; check-cache overrides mismatch handling to throw, while linking requests skipIntegrityCheck. — [packages/yarnpkg-core/sources/Cache.ts#L270-321](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/Cache.ts#L270-L321) [packages/yarnpkg-core/sources/Project.ts#L1208-1216](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/Project.ts#L1208-L1216)
- Installation persists manifests/lockfile before linking and saves state before post-install validation; PnP finalization can remove detected node_modules or obsolete loader/unplugged artifacts, so failures can follow filesystem changes. — [packages/yarnpkg-core/sources/Project.ts#L1878-1907](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/Project.ts#L1878-L1907) [packages/plugin-pnp/sources/PnpLinker.ts#L242-246](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/plugin-pnp/sources/PnpLinker.ts#L242-L246) [packages/plugin-pnp/sources/PnpLinker.ts#L315-323](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/plugin-pnp/sources/PnpLinker.ts#L315-L323)
- initializeWorkspaceEnvironment realpaths package.json to choose default cwd; its source comment explicitly says tests for that behavior are absent and the historical symlink use case is uncertain. This is a documented local coverage concern. — [packages/yarnpkg-core/sources/scriptUtils.ts#L492-512](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/scriptUtils.ts#L492-L512)
- Review hypothesis: Smart merge crosses a consequential artifact trust boundary because pull_request_target checks out the PR head to generate a patch, then a separate job applies that artifact and pushes using a bot token. Exploitability was not assessed. (inferred) — [.github/workflows/pr-smart-merge.yml#L1-3](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/.github/workflows/pr-smart-merge.yml#L1-L3) [.github/workflows/pr-smart-merge.yml#L25-40](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/.github/workflows/pr-smart-merge.yml#L25-L40) [.github/workflows/pr-smart-merge.yml#L83-126](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/.github/workflows/pr-smart-merge.yml#L83-L126)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
