Repository navigation
fix(middlewareNode): downgrade node-nlp 4.27.0 -> 3.10.2 (Issue 4) - #245
Open
Deepesh-Katudia wants to merge 1 commit into
Open
Deepesh-Katudia wants to merge 1 commit into
Deepesh-Katudia wants to merge 1 commit into
Conversation
This does NOT close the finding. node-nlp pulls @nlpjs/xtables -> xlsx (ReDoS + prototype pollution, no fix on npm). The vulnerable node-nlp range is 1.0.5-3.10.2 as well as >=4.0.0-rc.1; only 5.0.0-alpha.5 is clean, and an alpha is not viable for production. node-nlp and xlsx remain flagged high and need to be recorded as an accepted exception until a stable 5.x ships. Taken because it is what `npm audit fix --force` proposes and it behaves identically for our usage. chatService.js only uses NlpManager addDocument/train/process; no existing test covers it, so it was checked with a smoke test against the real nlpTrainingData: intent and sentiment output for 7 sample messages is identical on 4.27.0 and 3.10.2. Test suite passes after the downgrade.
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The known high-severity findings remain unresolved; an approved and documented security exception is required before merging.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Downgrades node-nlp in middlewareNode from 4.27.0 to 3.10.2 while retaining the existing API usage.
Changes:
- Updates the direct dependency range.
- Regenerates the lockfile.
- Retains the unresolved high-severity
node-nlp/xlsxfindings.
File summaries
| File | Description |
|---|---|
middlewareNode/package.json |
Updates the node-nlp dependency range. |
middlewareNode/package-lock.json |
Locks the downgraded dependency tree, including xlsx@0.15.6. |
Review details
Files not reviewed (1)
- middlewareNode/package-lock.json: Generated file
- Files reviewed: 1/2 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| "version": "0.18.5", | ||
| "resolved": "https://registry.npmjs.org/xlsx/-/xlsx-0.18.5.tgz", | ||
| "integrity": "sha512-dmg3LCjBPHZnQp5/F/+nnTa+miPJxUXB6vtk42YjBBKayDNagxGEeIdWApkYPOf3Z3pm3k62Knjzp7lMeTEtFQ==", | ||
| "version": "0.15.6", |
| "mongoose": "^6.8.4", | ||
| "multer": "^2.2.0", | ||
| "node-nlp": "^4.27.0", | ||
| "node-nlp": "^3.10.2", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Downgrade node-nlp 4.27.0 -> 3.10.2 in
middlewareNode, isolated in its own PR so it can be reviewed and reverted on its own.Part of a stacked series. Merge in order: audit-fix -> axios -> nodemailer -> googleapis -> uuid -> node-nlp. Each PR targets the previous branch, so its diff shows only its own bump; After merging each one, click "Delete branch" (this repo does not auto-delete merged branches). That makes GitHub retarget the next PR to
mainand run CI on it; if the branch is not deleted, the next PR must be retargeted tomainby hand before merging, or it will merge into a dead branch. (6/6, stacked on #244)Type of Change
Key Changes
middlewareNode/package.json: one-line range change; lockfile updated accordingly.npm audit fix --forceproposes and behaves identically for our usage.chatService.jsonly usesNlpManageraddDocument/train/process. No existing test covers it, so it was checked with a smoke test against the realnlpTrainingData: intent + sentiment output for 7 sample messages is identical on 4.27.0 and 3.10.2. Side effect: 3.10.2 no longer prints ~190 training-epoch lines to the server log at startup.Testing
node -e "require(...)"of the package (catches CommonJS/ESM breakage that Jest mocks can hide)npm ciBugs Fixed (if applicable)
npm auditafter this PR: 2 findings (0 critical, 2 high: node-nlp, xlsx). Does not close the node-nlp/xlsx finding.TODO (Follow-up Work)
Additional Notes
Version vetted by @THRISHMA2424 on
dependancyFix; regenerated fresh off current main.