Fix CI Snyk vulnerabilities in liquidjs and fast-xml-parser#3686
Fix CI Snyk vulnerabilities in liquidjs and fast-xml-parser#3686
Conversation
…l-parser resolution - Update liquidjs from ^10.8.4 to ^10.25.0 in packages/actions-shared - Update liquidjs from ^10.8.4 to ^10.25.0 in packages/destination-actions - Update liquidjs from ^10.21.0 to ^10.25.0 in root package.json - Add fast-xml-parser resolution to 5.5.9 for AWS SDK transitive dependency Fixes: - SNYK-JS-LIQUIDJS-15443434: Directory Traversal (High Severity) - SNYK-JS-FASTXMLPARSER-15307668: XML Entity Expansion (High Severity) - SNYK-JS-FASTXMLPARSER-15324289: Incorrect Regular Expression (High Severity) - SNYK-JS-FASTXMLPARSER-15677840: XML Entity Expansion (High Severity) - SNYK-JS-FASTXMLPARSER-15699647: Improper Validation (High Severity)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3686 +/- ##
=======================================
Coverage 81.11% 81.11%
=======================================
Files 1656 1656
Lines 32120 32120
Branches 7102 7062 -40
=======================================
Hits 26055 26055
- Misses 5092 5109 +17
+ Partials 973 956 -17 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
mdkhan-tw
left a comment
There was a problem hiding this comment.
Can we try exhaustive testing? We had a sev because of liquidjs parsing error
Yes... This yet to be tested on staging... MME-e2e tests added for liquid js code: https://github.com/segmentio/mme-e2e/pull/476 |
There was a problem hiding this comment.
Pull request overview
This PR addresses Snyk-reported high-severity vulnerabilities by upgrading liquidjs across the workspace and forcing a safe fast-xml-parser version via Yarn resolutions.
Changes:
- Bumped
liquidjsto^10.25.0in the root and relevant workspace packages. - Added a Yarn
resolutionsoverride to pinfast-xml-parserto5.5.9. - Updated
yarn.lockto reflect the new resolved dependency graph.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
yarn.lock |
Updates lockfile entries for liquidjs and forces fast-xml-parser to resolve to 5.5.9 (plus new transitive deps). |
package.json |
Adds fast-xml-parser resolution and bumps root liquidjs dependency. |
packages/destination-actions/package.json |
Bumps liquidjs dependency to ^10.25.0. |
packages/actions-shared/package.json |
Bumps liquidjs dependency to ^10.25.0. |
| "dependencies": { | ||
| "chance": "^1.1.8", | ||
| "liquidjs": "^10.21.0", | ||
| "liquidjs": "^10.25.0", | ||
| "xml-js": "^1.6.11" |
There was a problem hiding this comment.
@segment/actions-core imports liquidjs (e.g., packages/core/src/mapping-kit/liquid-directive.ts) but packages/core/package.json does not declare it as a dependency. Relying on the workspace root dependency can break consumers that install @segment/actions-core standalone (missing module at runtime). Consider adding liquidjs to packages/core/package.json dependencies (and optionally removing the root-level dependency if it’s only needed for local workspace usage).
- Update liquidjs from ^10.25.0 to ^10.25.3 (fixes SNYK-JS-LIQUIDJS-15953364 - Symlink Following) - Update lodash from ^4.17.21/^4.17.20 to ^4.18.1 (fixes SNYK-JS-LODASH-15869625 - Arbitrary Code Injection) - Add picomatch resolution to 2.3.2 (fixes SNYK-JS-PICOMATCH-15765511 - ReDoS)
| "istanbul-lib-instrument/semver": "6.3.1" | ||
| "istanbul-lib-instrument/semver": "6.3.1", | ||
| "fast-xml-parser": "5.5.9", | ||
| "picomatch": "2.3.2" |
The previous lodash update in package.json files was not enough because transitive dependencies were still pulling in lodash@4.17.21. Adding a yarn resolution forces ALL lodash versions to resolve to 4.18.1. Fixes SNYK-JS-LODASH-15869625 - Arbitrary Code Injection vulnerability
| "istanbul-lib-instrument/semver": "6.3.1" | ||
| "istanbul-lib-instrument/semver": "6.3.1", | ||
| "fast-xml-parser": "5.5.9", | ||
| "picomatch": "2.3.2", |
| "cheerio": "^1.0.0-rc.10", | ||
| "dayjs": "^1.10.7", | ||
| "escape-goat": "^3", | ||
| "liquidjs": "^10.8.4", |
There was a problem hiding this comment.
We have liquidjs validation in UI as well. Can we ensure that action-destination and UI's liquidjs version aren't in conflict.
| "istanbul-lib-instrument/semver": "6.3.1" | ||
| "istanbul-lib-instrument/semver": "6.3.1", | ||
| "fast-xml-parser": "5.5.9", | ||
| "picomatch": "2.3.2", |
| "istanbul-lib-instrument/semver": "6.3.1" | ||
| "istanbul-lib-instrument/semver": "6.3.1", | ||
| "fast-xml-parser": "5.5.9", | ||
| "picomatch": "2.3.2", |
⚡ Quickly spin up Copilot coding agent tasks from anywhere on your macOS or Windows machine with Raycast.
Testing
No discrepency found in liquidjs mme-e2e tests:
