security: patch runtime dependency vulnerabilities (mongoose, grpc-js, bn.js)#839
Conversation
…, bn.js) Resolves the runtime (production-scope) Dependabot alerts: - mongoose ^8.17.1 -> ^8.24.0 (GHSA-wpg9-53fq-2r8h, high): improper sanitization of $nor in sanitizeFilter. Mongoose 8.22+ tightened the generic typing of Document._id, so the three model interfaces that declare a string _id (IOrder, ICommunity, UserDocument) now extend Document<string> to stay compatible. - @grpc/grpc-js -> ^1.13.5 via overrides (GHSA-5375-pq7m-f5r2, GHSA-99f4-grh7-6pcq, high): malformed request/compressed message can crash client or server. Transitive via lightning. - bn.js -> ^5.2.3 via overrides (GHSA-378v-28hj-76wf, medium): infinite loop DoS. Transitive via invoices/lightning. The remaining runtime alert (valibot ReDoS via ecpair/lightning) is left out: it requires a lightning minor bump and the vulnerable EMOJI_REGEX path is not reachable from this app. Dev-only alerts (axios 0.x, express, etc. via telegram-test-api and mocha) are out of scope here. Verified: npm ci, tsc, eslint and all 133 tests pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
Walkthrough
ChangesMongoose Upgrade and Model Type Fixes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed due to a network error. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Qué hace
Cierra las alertas de Dependabot de scope runtime (producción) que son seguras de aplicar:
mongoose@grpc/grpc-js^1.13.5)bn.js@grpc/grpc-jsybn.jsson transitivas (víalightning/invoices), por eso se fijan conoverrides.Cambio de tipos por mongoose
Mongoose 8.22+ endureció el genérico de
Document._id. Las tres interfaces que declaran_id: string(IOrder,ICommunity,UserDocument) ahora extiendenDocument<string>para mantener la compatibilidad. Sin esto el build de TypeScript falla.Fuera de alcance (a tratar aparte)
ecpair→lightning): requiere subirlightning(10.25→10.27.x). La ruta vulnerable (EMOJI_REGEX) no es alcanzable desde esta app, así que se difiere a un PR propio con pruebas de la integración LND.axios0.x,express,body-parser,qs,serialize-javascript,glob, etc.): provienen detelegram-test-apiymocha; no se despliegan a producción. Se limpiarán subiendo esas herramientas en un PR aparte.Verificación
npm ci✓ (lockfile en sync)npx tsc✓npm run lint✓npm test✓ — 133 tests🤖 Generated with Claude Code
Summary by CodeRabbit