Drop node-telegram-bot-api to fix 7 of 8 Dependabot alerts - #10
Merged
Conversation
telegram-bot.js only ever called sendMessage() once, so replace the deprecated request/@cypress/request-based library with a raw https POST to api.telegram.org (same zero-dep pattern as sendDiscord() in server.js). This removes the whole request/form-data/qs/uuid/tough-cookie chain that accounted for 7 of the 8 alerts GitHub reported on first lockfile visibility. The remaining js-yaml alert (eslint devDependency, not reachable from any code path) is documented as an accepted risk in SECURITY.md. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
GitHub reported 8 Dependabot alerts (1 critical, 2 high, 5 moderate) the first time
pnpm-lock.yamlwas committed to git — a first-visibility event, not a new regression.Traced each alert directly via
gh api repos/DrummingBird1/RedAlert/dependabot/alerts:request,form-data×2 incl. the critical one,qs×2,uuid,tough-cookie) all trace to one chain: the deprecatedrequest/@cypress/requestclient pulled in transitively bynode-telegram-bot-api@0.66.0(anoptionalDependency). That library's only actual use in this repo wasnew TelegramBot(token, {polling:false})+bot.sendMessage(...)— a single Telegram Bot API call.telegram-bot.jsis rewritten to POST toapi.telegram.orgdirectly via rawhttps(same zero-dep pattern assendDiscord()inserver.js), andnode-telegram-bot-apiis dropped frompackage.jsonentirely. Nonpm installstep needed anymore for the Telegram bot.js-yaml, high) comes fromeslint@9.39.5→@eslint/eslintrc, adevDependencyonly, never reachable from any code path (the project never parses untrusted YAML —docs/openapi.yamlis static and served as-is). Fixing it requires eslint v10, which needs a.eslintrc.json→ flat-config migration and raising the Node engine requirement to^20.19 || ^22.13 || >=24(currently>=18). Documented as an accepted, deferred risk in.github/SECURITY.mdrather than fixed here.Note: there's an existing open Dependabot PR proposing
node-telegram-bot-api0.66.0 → 2.1.0 — that's a from-scratch API rewrite with no v1 compatibility, not a safe drop-in bump. This PR removes the dependency instead, so that Dependabot PR becomes moot once this merges.Test plan
node --check telegram-bot.jssendTelegramMessage()request/response/error-handling logic against a local mock HTTP server (success, API error, network error paths)node test/unit.js— 91/91 passnode test/integration.js— 12/12 passpnpm install --frozen-lockfile— lockfile consistentpnpm whyconfirmsrequest/form-data/qs/uuid/tough-cookie/node-telegram-bot-apiare all gone from the dependency tree🤖 Generated with Claude Code