fix(deps): resolve all Dependabot security alerts#226
Conversation
Update resolutions/overrides to fix vulnerabilities: - undici: CRLF injection, memory consumption, request smuggling - tar: symlink/hardlink path traversal - fast-xml-parser: stack overflow, entity expansion DoS - minimatch: ReDoS via GLOBSTAR and extglobs - flatted: unbounded recursion DoS Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1621c70 to
14cd145
Compare
Greptile SummaryThis PR resolves 18 open Dependabot security alerts by adding Yarn Key observations:
Confidence Score: 3/5
|
| Filename | Overview |
|---|---|
| package.json | Adds Yarn resolutions for flatted, minimatch, fast-xml-parser, undici, and updates tar; the semver ranges are intentionally broad (e.g. >=3.1.3 resolves to 10.2.4) to force patched versions across the workspace. |
| test-projects/expo-purchasely-test/package.json | Adds npm overrides for security packages, but undici is pinned to >=6.24.0 (resolves to 7.24.4 today) while the root uses >=7.24.0; this inconsistency is a future risk and the Node.js engine requirement has silently jumped to >=20.18.1. |
| test-projects/rn-purchasely-test/package.json | Adds npm overrides for fast-xml-parser, flatted, and minimatch; undici and tar correctly omitted because neither package is present in this project's dependency tree. |
| yarn.lock | Lock file correctly reflects all security bumps: undici 7.12.0→7.24.4, tar 7.5.9→7.5.11, fast-xml-parser 4.5.3→5.5.6, minimatch 3.1.2→10.2.4, flatted 3.3.3→3.4.1; old minimatch v3/v5/v8/v9 entries are removed in favour of the single >=3.1.3 resolution. |
| test-projects/expo-purchasely-test/package-lock.json | Lock file confirms all overrides took effect; undici resolved to 7.24.4 despite the >=6.24.0 constraint, and tar resolved to 7.5.11. |
| test-projects/rn-purchasely-test/package-lock.json | Lock file confirms fast-xml-parser was bumped from 4.5.3 to 5.5.6 (major jump) via the override; minimatch and flatted overrides also applied correctly. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Dependabot Security Alerts] --> B{Package Manager}
B -->|Yarn workspace root| C[package.json resolutions]
B -->|npm expo project| D[expo-purchasely-test/package.json overrides]
B -->|npm RN project| E[rn-purchasely-test/package.json overrides]
C --> C1[undici >=7.24.0 → 7.24.4]
C --> C2[tar >=7.5.10 → 7.5.11]
C --> C3[fast-xml-parser >=4.5.4 → 5.5.6]
C --> C4[minimatch >=3.1.3 → 10.2.4]
C --> C5[flatted >=3.3.4 → 3.4.1]
D --> D1[undici >=6.24.0 → 7.24.4 ⚠️ inconsistent lower bound]
D --> D2[tar >=7.5.10 → 7.5.11]
D --> D3[fast-xml-parser >=4.5.4 → 5.5.6]
D --> D4[minimatch >=3.1.3 → 10.2.4]
D --> D5[flatted >=3.3.4 → 3.4.1]
E --> E1[fast-xml-parser >=4.5.4 → 5.5.6]
E --> E2[minimatch >=3.1.3 → 10.2.4]
E --> E3[flatted >=3.3.4 → 3.4.1]
E --> E4[lodash >=4.17.23 pre-existing]
E -.->|undici not in dep tree| X[⚪ no override needed]
E -.->|tar not in dep tree| X
Prompt To Fix All With AI
This is a comment left during a code review.
Path: test-projects/expo-purchasely-test/package.json
Line: 32
Comment:
**Undici version constraint is inconsistent with root and allows v6 resolution**
The constraint `>=6.24.0` technically satisfies any version at or above 6.24.0, including 7.x (and that is what resolves today — 7.24.4). However:
1. It is weaker than the root's `>=7.24.0` resolution. If npm ever adds a new 6.x candidate to its registry before the resolver cache is refreshed, a future `npm install` could theoretically settle on a 6.x release that still contains the patched vulnerabilities only partially.
2. The undici changelog introduces a new engine floor with v7: the resolved `undici@7.24.4` requires **Node.js `>=20.18.1`**, up from the previous `>=18.17`. Any CI or developer environment running Node 18/19 will now fail when installing this project, with no mention of the engine bump in the PR.
Consider aligning with the root constraint:
```suggestion
"undici": ">=7.24.0"
```
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: package.json
Line: 35-36
Comment:
**Semver lower bounds allow resolution to arbitrary future major versions**
Both of these constraints resolve today to major-version jumps far beyond what the lower bound implies:
- `"fast-xml-parser": ">=4.5.4"` → resolves to **5.5.6** (v4 → v5 major bump; transitive deps in `rn-purchasely-test` declare `^4.4.1` which is semver-incompatible with v5).
- `"minimatch": ">=3.1.3"` → resolves to **10.2.4** (v3 → v10, a seven-major-version jump).
While the tests pass today, these open-ended ranges mean a future `yarn install` could silently advance to v6 of `fast-xml-parser` or v11+ of `minimatch`, potentially introducing runtime breakage with no diff-visible change. The same pattern exists in both test-project `package.json` files.
Consider pinning to the actual minimum compatible major version that was validated:
```suggestion
"minimatch": ">=10.2.4",
"fast-xml-parser": ">=5.0.0",
```
How can I resolve this? If you propose a fix, please make it concise.Last reviewed commit: 14cd145
| "flatted": ">=3.3.4", | ||
| "minimatch": ">=3.1.3", | ||
| "tar": ">=7.5.10", | ||
| "undici": ">=6.24.0" |
There was a problem hiding this comment.
Undici version constraint is inconsistent with root and allows v6 resolution
The constraint >=6.24.0 technically satisfies any version at or above 6.24.0, including 7.x (and that is what resolves today — 7.24.4). However:
- It is weaker than the root's
>=7.24.0resolution. If npm ever adds a new 6.x candidate to its registry before the resolver cache is refreshed, a futurenpm installcould theoretically settle on a 6.x release that still contains the patched vulnerabilities only partially. - The undici changelog introduces a new engine floor with v7: the resolved
undici@7.24.4requires Node.js>=20.18.1, up from the previous>=18.17. Any CI or developer environment running Node 18/19 will now fail when installing this project, with no mention of the engine bump in the PR.
Consider aligning with the root constraint:
| "undici": ">=6.24.0" | |
| "undici": ">=7.24.0" |
Prompt To Fix With AI
This is a comment left during a code review.
Path: test-projects/expo-purchasely-test/package.json
Line: 32
Comment:
**Undici version constraint is inconsistent with root and allows v6 resolution**
The constraint `>=6.24.0` technically satisfies any version at or above 6.24.0, including 7.x (and that is what resolves today — 7.24.4). However:
1. It is weaker than the root's `>=7.24.0` resolution. If npm ever adds a new 6.x candidate to its registry before the resolver cache is refreshed, a future `npm install` could theoretically settle on a 6.x release that still contains the patched vulnerabilities only partially.
2. The undici changelog introduces a new engine floor with v7: the resolved `undici@7.24.4` requires **Node.js `>=20.18.1`**, up from the previous `>=18.17`. Any CI or developer environment running Node 18/19 will now fail when installing this project, with no mention of the engine bump in the PR.
Consider aligning with the root constraint:
```suggestion
"undici": ">=7.24.0"
```
How can I resolve this? If you propose a fix, please make it concise.| "minimatch": ">=3.1.3", | ||
| "fast-xml-parser": ">=4.5.4", |
There was a problem hiding this comment.
Semver lower bounds allow resolution to arbitrary future major versions
Both of these constraints resolve today to major-version jumps far beyond what the lower bound implies:
"fast-xml-parser": ">=4.5.4"→ resolves to 5.5.6 (v4 → v5 major bump; transitive deps inrn-purchasely-testdeclare^4.4.1which is semver-incompatible with v5)."minimatch": ">=3.1.3"→ resolves to 10.2.4 (v3 → v10, a seven-major-version jump).
While the tests pass today, these open-ended ranges mean a future yarn install could silently advance to v6 of fast-xml-parser or v11+ of minimatch, potentially introducing runtime breakage with no diff-visible change. The same pattern exists in both test-project package.json files.
Consider pinning to the actual minimum compatible major version that was validated:
| "minimatch": ">=3.1.3", | |
| "fast-xml-parser": ">=4.5.4", | |
| "minimatch": ">=10.2.4", | |
| "fast-xml-parser": ">=5.0.0", |
Prompt To Fix With AI
This is a comment left during a code review.
Path: package.json
Line: 35-36
Comment:
**Semver lower bounds allow resolution to arbitrary future major versions**
Both of these constraints resolve today to major-version jumps far beyond what the lower bound implies:
- `"fast-xml-parser": ">=4.5.4"` → resolves to **5.5.6** (v4 → v5 major bump; transitive deps in `rn-purchasely-test` declare `^4.4.1` which is semver-incompatible with v5).
- `"minimatch": ">=3.1.3"` → resolves to **10.2.4** (v3 → v10, a seven-major-version jump).
While the tests pass today, these open-ended ranges mean a future `yarn install` could silently advance to v6 of `fast-xml-parser` or v11+ of `minimatch`, potentially introducing runtime breakage with no diff-visible change. The same pattern exists in both test-project `package.json` files.
Consider pinning to the actual minimum compatible major version that was validated:
```suggestion
"minimatch": ">=10.2.4",
"fast-xml-parser": ">=5.0.0",
```
How can I resolve this? If you propose a fix, please make it concise.
Summary
Test plan
yarn test— 139 tests passnpm auditon expo-purchasely-test — 0 vulnerabilitiesnpm auditon rn-purchasely-test — 0 vulnerabilities🤖 Generated with Claude Code