Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Snyk] Upgrade: debug, mongoose, shutterstock-api, telegraf #198

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

peterleiva
Copy link
Owner

snyk-top-banner

Snyk has created this PR to upgrade multiple dependencies.

👯‍♂ The following dependencies are linked and will therefore be updated together.

ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.

Name Versions Released on

debug
from 4.3.3 to 4.3.6 | 3 versions ahead of your current version | 2 months ago
on 2024-07-27
mongoose
from 6.0.12 to 6.13.0 | 97 versions ahead of your current version | 3 months ago
on 2024-06-06
shutterstock-api
from 1.1.12 to 1.1.41 | 26 versions ahead of your current version | 3 months ago
on 2024-06-20
telegraf
from 4.5.2 to 4.16.3 | 58 versions ahead of your current version | 7 months ago
on 2024-02-29

Issues fixed by the recommended upgrade:

Issue Score Exploit Maturity
high severity Prototype Pollution
SNYK-JS-MONGOOSE-2961688
506 Proof of Concept
high severity Prototype Pollution
SNYK-JS-MONGOOSE-5777721
506 Proof of Concept
medium severity Information Exposure
SNYK-JS-MONGODB-5871303
506 No Known Exploit
low severity Prototype Pollution
SNYK-JS-MINIMIST-2429795
506 Proof of Concept
Release notes
Package name: debug
  • 4.3.6 - 2024-07-27

    What's Changed

    New Contributors

    Full Changelog: 4.3.5...4.3.6

  • 4.3.5 - 2024-05-31

    Patch

    Thank you @ calvintwr for the fix.

  • 4.3.4 - 2022-03-17

    What's Changed

    New Contributors

    Full Changelog: 4.3.3...4.3.4

  • 4.3.3 - 2021-11-27

    Patch Release 4.3.3

    This is a documentation-only release. Further, the repository was transferred. Please see notes below.

    Thank you to @ taylor1791 and @ kristofkalocsai for their contributions.


    Repository Migration Information

    I've formatted this as a FAQ, please feel free to open an issue for any additional question and I'll add the response here.

    Q: What impact will this have on me?

    In most cases, you shouldn't notice any change.

    The only exception I can think of is if you pull code directly from https://github.com/visionmedia/debug, e.g. via a "debug": "visionmedia/debug"-type version entry in your package.json - in which case, you should still be fine due to the automatic redirection Github sets up, but you should also update any references as soon as possible.

    Q: What are the security implications of this change?

    If you pull code directly from the old URL, you should update the URL to https://github.com/debug-js/debug as soon as possible. The old organization has many approved owners and thus a new repository could (in theory) be created at the old URL, circumventing Github's automatic redirect that is in place now and serving malicious code. I (@ Qix-) also wouldn't have access to that repository, so while I don't think it would happen, it's still something to consider.

    Even in such a case, however, the officially released package on npm (debug) would not be affected. That package is still very much under control (even more than it used to be).

    Q: What should I do if I encounter an issue related to the migration?

    Search the issues first to see if someone has already reported it, and then open a new issue if someone has not.

    Q: Why was this done as a 'patch' release? Isn't this breaking?

    No, it shouldn't be breaking. The package on npm shouldn't be affected (aside from this patch release) and any references to the old repository should automatically redirect.

    Thus, according to all of the "APIs" (loosely put) involved, nothing should have broken.

    I understand there are a lot of edge cases so please open issues as needed so I can assist in any way necessary.

    Q: Why was the repository transferred?

    I'll just list them off in no particular order.

    • The old organization was defunct and abandoned.
    • I was not an owner of the old organization and thus could not ban the non-trivial amount of spam users or the few truly abusive users from the org. This hindered my ability to properly maintain this package.
    • The debug ecosystem intends to grow beyond a single package, and since new packages could not be created in the old org (nor did it make sense for them to live there), a new org made the most sense - especially from a security point of view.
    • The old org has way, way too many approved members with push access, for which there was nothing I could do. This presented a pretty sizable security risk given that many packages in recent years have fallen victim to backdoors and the like due to lax security access.

    Q: Was this approved?

    Yes.[archive]

    Q: Do I need to worry about another migration sometime in the future?

    No.

from debug GitHub release notes
Package name: mongoose
  • 6.13.0 - 2024-06-06
  • 6.12.9 - 2024-05-24
  • 6.12.8 - 2024-04-10
  • 6.12.7 - 2024-03-01
  • 6.12.6 - 2024-01-22
  • 6.12.5 - 2024-01-03
  • 6.12.4 - 2023-12-27
  • 6.12.3 - 2023-11-07
  • 6.12.2 - 2023-10-25
  • 6.12.1 - 2023-10-12
  • 6.12.0 - 2023-08-24
  • 6.11.6 - 2023-08-21
  • 6.11.5 - 2023-08-01
  • 6.11.4 - 2023-07-17
  • 6.11.3 - 2023-07-11
  • 6.11.2 - 2023-06-08
  • 6.11.1 - 2023-05-08
  • 6.11.0 - 2023-05-01
  • 6.10.5 - 2023-04-06
  • 6.10.4 - 2023-03-21
  • 6.10.3 - 2023-03-13
  • 6.10.2 - 2023-03-07
  • 6.10.1 - 2023-03-03
  • 6.10.0 - 2023-02-22
  • 6.9.3 - 2023-02-22
  • 6.9.2 - 2023-02-16
  • 6.9.1 - 2023-02-06
  • 6.9.0 - 2023-01-25
  • 6.8.4 - 2023-01-17
  • 6.8.3 - 2023-01-06
  • 6.8.2 - 2022-12-28
  • 6.8.1 - 2022-12-19
  • 6.8.0 - 2022-12-05
  • 6.7.5 - 2022-11-30
  • 6.7.4 - 2022-11-28
  • 6.7.3 - 2022-11-22
  • 6.7.2 - 2022-11-07
  • 6.7.1 - 2022-11-02
  • 6.7.0 - 2022-10-24
  • 6.6.7 - 2022-10-21
  • 6.6.6 - 2022-10-20
  • 6.6.5 - 2022-10-05
  • 6.6.4 - 2022-10-03
  • 6.6.3 - 2022-09-30
  • 6.6.2 - 2022-09-26
  • 6.6.1 - 2022-09-14
  • 6.6.0 - 2022-09-08
  • 6.5.5 - 2022-09-07
  • 6.5.4 - 2022-08-30
  • 6.5.3 - 2022-08-25
  • 6.5.2 - 2022-08-10
  • 6.5.1 - 2022-08-03
  • 6.5.0 - 2022-07-26
  • 6.4.7 - 2022-07-25
  • 6.4.6 - 2022-07-20
  • 6.4.5 - 2022-07-18
  • 6.4.4 - 2022-07-08
  • 6.4.3 - 2022-07-05
  • 6.4.2 - 2022-07-01
  • 6.4.1 - 2022-06-27
  • 6.4.0 - 2022-06-17
  • 6.3.9 - 2022-06-17
  • 6.3.8 - 2022-06-13
  • 6.3.7 - 2022-06-13
  • 6.3.6 - 2022-06-07
  • 6.3.5 - 2022-05-30
  • 6.3.4 - 2022-05-19
  • 6.3.3 - 2022-05-09
  • 6.3.2 - 2022-05-02
  • 6.3.1 - 2022-04-21
  • 6.3.0 - 2022-04-14
  • 6.2.11 - 2022-04-13
  • 6.2.10 - 2022-04-04
  • 6.2.9 - 2022-03-28
  • 6.2.8 - 2022-03-23
  • 6.2.7 - 2022-03-16
  • 6.2.6 - 2022-03-11
  • 6.2.5 - 2022-03-09
  • 6.2.4 - 2022-02-28
  • 6.2.3 - 2022-02-21
  • 6.2.2 - 2022-02-16
  • 6.2.1 - 2022-02-07
  • 6.2.0 - 2022-02-02
  • 6.1.10 - 2022-02-01
  • 6.1.9 - 2022-01-31
  • 6.1.8 - 2022-01-24
  • 6.1.7 - 2022-01-17
  • 6.1.6 - 2022-01-10
  • 6.1.5 - 2022-01-04
  • 6.1.4 - 2021-12-27
  • 6.1.3 - 2021-12-21
  • 6.1.2 - 2021-12-15
  • 6.1.1 - 2021-12-09
  • 6.1.0 - 2021-12-07
  • 6.0.15 - 2021-12-06
  • 6.0.14 - 2021-11-29
  • 6.0.13 - 2021-11-15
  • 6.0.12 - 2021-10-21
from mongoose GitHub release notes
Package name: telegraf
  • 4.16.3 - 2024-02-29
    • Fix: bug with link_preview_options.url caused client to try sending it as media
    • Fix: add CommandContextExtn type to Composer::{start|help|settings} (adds ctx.command, payload, args)
  • 4.16.2 - 2024-02-26

    Fixed Context::text: was undefined if entities was undefined. Thanks to @ AnotiaWang.

  • 4.16.1 - 2024-02-25

    Fixed Context::from: now uses callbackQuery.from instead of msg.from

  • 4.16.0 - 2024-02-25

    Phew, what a feature-packed release! 🎉

    *tsk tsk* There's a big announcement at the end of this release!

    🆙 Bot API Updates
    • Support for API 7.0. Highlights are Reactions, Replies 2.0, Link Previews, Blockquotes, and Chat Boosts.
    • Support for API 7.1.
    • All methods and update types from these API versions are now fully supported.
    👍 Working with Reactions
    • To listen on reaction addition and removal, use Composer.reaction:

      bot.reaction("👍", (ctx) => {
      // user added a 👍 reaction
      });

      // prefix with - to listen to reaction removal
      bot.reaction("-👍", (ctx) => {
      // user removed a 👍 reaction
      });

      This also just works with custom emoji IDs.

      bot.reaction("5368742036629364794", (ctx) => {
      // user added a reaction with the given custom emoji ID
      });

      bot.reaction("-5368742036629364794", (ctx) => {
      // user removed a reaction with the given custom emoji ID
      });

    • You can probe and inspect the reaction list with the ctx.reactions smart object:

      bot.on("message_reaction", async (ctx) => {
      // remember that ctx.reactions is a smart object, but not an array

      // message has a 👍 reaction
      ctx.reactions.has("👍");

      // message has a reaction with the given custom emoji ID
      ctx.reactions.has("5368742036629364794");

      // number of reactions from this user on the message
      ctx.reaction.count;

      // indexed access is allowed:
      const first = ctx.reactions[0];

      // the 👍 emoji was added in this update
      if (ctx.reactions.added.has("👍")) {
      // user added a 👍 reaction
      await User.updateOne({ id: ctx.from.id }, { $inc: { likes: 1 } });
      }

      // the 👍 emoji was removed in this update
      if (ctx.reactions.removed.has("👍")) {
      // user removed a 👍 reaction
      await User.updateOne({ id: ctx.from.id }, { $inc: { likes: -1 } });
      };

      // to copy any of these smart objects into an array, call the toArray method
      const reactions = ctx.reactions.toArray();
      const added = ctx.reactions.added.toArray();
      const removed = ctx.reactions.removed.toArray();
      });

    • To react to a message, use ctx.react:

      bot.on("text", async (ctx) => {
        await ctx.react("👍");
      });

      You can also react to a message with a custom emoji ID:

      bot.on("text", async (ctx) => {
        await ctx.react("5368742036629364794");
      });

      The bot.telegram.setMessageReaction method is also available.

    💅 Context::text and Context::entities() helpers
    • Added the ctx.entities() method to fetch entities in any message.

      bot.on("text", (ctx) => {
        // fetch all entities
        const entities = ctx.entities();
        // fetch all command entities
        const commandEntities = ctx.entities("bot_command");
        // fetch all mentions and text mentions
        const mentions = ctx.entities("mention", "text_mention");
      });

      Not only does this method fetch entities from any message, but also works with captions, game text, and poll explanations. In short, if an update has any text and entities, this method will find them.

    • ctx.text is the companion to ctx.entities(). It fetches the text from the update, and works with any message type. This includes message text, media captions, game text, and poll explanations.

      bot.on(message("text"), (ctx) => {
      // fetch the text from the update
      const text = ctx.text;
      });

      bot.on(message("photo"), (ctx) => {
      // fetch the caption from the photo
      const caption = ctx.text;
      });

    • 🎁 Bonus! Every entity in the ctx.entities() array will have a fragment of the text they represent!

      bot.on("text", (ctx) => {
        const entities = ctx.entities("bold");
        for (const entity of entities) {
          // the text that is bold
          const boldText = entity.fragment;
        }
      });
    📬 Context::msg and Context::msgId shorthands
    • Context::msg shorthand to get any message in the update.

      bot.use((ctx) => {
        // finds one of:
        // ctx.message ?? ctx.editedMessage ?? ctx.callbackQuery?.message ?? ctx.channelPost ?? ctx.editedChannelPost
        const msg = ctx.msg;
      });

      ctx.msg is decorated with the isAccessible and has methods. The has method works similarly to the message() filter in bot.on. It checks if the message has a certain property.

      if (ctx.msg.isAccessible()) {
      // msg is accessible, not deleted or otherwise unavailable
      // this is a type-guard based on the runtime check for msg.date === 0
      }

      if (ctx.msg.has("text")) {
      // ctx.msg.text exists
      }

    • Context::msgId shorthand to get any available message ID in the update. This also includes message_id present in updates that do not contain a message, such as message_reaction, and message_reaction_count.

      bot.use((ctx) => {
        // finds one of:
        // ctx.msg.message_id ?? ctx.messageReaction.message_id ?? ctx.messageReactionCount.message_id
        const msgId = ctx.msgId;
      });
    🚀 bot.launch takes an onLaunch callback
    • bot.launch now takes an optional callback that is called when the bot is launched.

      bot.launch(() => console.log("Bot is starting!"));

      If you pass LaunchOptions, the callback goes after the options.

      bot.launch({ dropPendingUpdates: true }, () => console.log("Bot is starting!"));

      This is useful for running some code when the bot is launched, such as logging to the console, or sending a message to a channel. Remember that errors thrown in this callback will not be caught by the bot's error handler. You must handle them yourself.

      It's worth noting that the callback is called once the first getMe call is successful. This means network is working, and bot token is valid. Due to how networks work, there isn't a way to define when the bot is "fully" launched. The bot may still crash after the callback is called, for example if another instance of the bot is running elsewhere and polling getUpdates fails. For these reasons, onLaunch callback exists under @ experimental, and may receive improvements based on feedback.

    🖍 Format helpers
    • Added quote format helper for Blockquotes.
    • Stricter types for format helpers. For example, it will now be a type-error to try to nest pre within another entity.
    🔧 Other fixes and improvements
    • Added ctx.match for Composer.command (#1938).
    • Fixed thumbnail uploads in media groups (#1947).
    • The shorthand ctx.chat now includes chat from this.messageReaction ?? this.messageReactionCount ?? this.removedChatBoost.
    • The shorthand ctx.from now includes the field user from ctx.messageReaction ?? ctx.pollAnswer ?? ctx.chatBoost?.boost.source, in addition to fetching from in other updates.
    • useNewReplies uses ctx.msgId instead of ctx.message.message_id to reply to messages, which works for more update types than before.
    • The following modules are now directly importable: types, scenes, filters, format, future, utils, markup, session. For example, via import { WizardScene } from "telegraf/scenes". This was previously available in v3, and was removed in v4.
    💔 Minor breaking changes
    • (Breaking) Markup.button.userRequest will take extra instead of user_is_premium as the third parameter.
    • (Breaking) Markup.button.botRequest will take extra before hide as the third parameter.
    • (Types breaking) reply_to_message_id and allow_sending_without_reply replaced by reply_parameters.
    • (Types breaking) disable_web_page_preview and link_preview_options replaced by link_preview_options.
    🎉 BIG announcement 🥳

    Telegraf v4 - Last Major Update

    This will be the last major update for Telegraf v4.

    What to Expect

    If you are currently using Telegraf v4, you can continue using it as you have been. Telegraf v4 will be supported until February 2025, with the following commitments:

    • Bug fixes and security updates will still be released for Telegraf v4.
    • The existing documentation for Telegraf v4 will remain available.
    • New API updates will only focus on ensuring compatibility with the latest Telegram Bot API. No new convenience features will be added to Telegraf v4.

    Introducing Telegraf v5

    In the coming weeks, we plan to release Telegraf v5. v5 will bring a revamped API, new functionalities, numerous convenient helpers, an improved approach to handling updates, and enhanced documentation.

    One of the key highlights of Telegraf v5 is its platform-agnostic nature, allowing you to run it on any JavaScript runtime environment, including Deno, Bun, edge runtimes (such as Cloudflare Workers and Vercel), browsers, and more.

    Smooth Transition to v5

    If you have closely followed the development of v4 in the past year and stayed updated with deprecation notices, the transition to v5 will be relatively seamless for you. For those still using v4, we will provide a comprehensive migration guide to assist you in upgrading to v5. Stay tuned for more information on the release of v5!

    Thanks for all the love ❤️! Go follow the releases channel on Telegram: t.me/Telegraf_JS.

    You can sponsor the maintainer (@ MKRhere) via GitHub Sponsors, Patreon, or Ko-fi.

  • 4.16.0-rc.2 - 2024-02-21
  • 4.16.0-rc.1 - 2024-02-21
  • 4.15.3 - 2023-12-03
    • Fix: unable to upload media
    • Fix: thumbnail is now respected in all APIs that accept it
  • 4.15.2 - 2023-11-30

    EXPERIMENTAL_SESSION_CHECKS introduced in the last minor release had been reporting false positives. This has been fixed; it will now work as intended.

  • 4.15.1 - 2023-11-29
    • 🔧 Fixed sendPhoto and friends irrecoverably erroring if passed an invalid path, such as a directory.

    • ⚠️ Set the env var EXPERIMENTAL_SESSION_CHECKS=1 to catch session bugs in your code.

      When this is enabled, Telegraf will throw errors if you access/assign to session after Telegraf thinks the middleware chain has exhausted. This can happen if you're missing awaits in async code, and session changes might not get persisted! Previously, these bugs were silently ignored until someone noticed their session was not saved. It's always safe to enable this feature. This behaviour may be default in v5.

  • 4.15.0 - 2023-10-23

    This is a rather minor release.

    anyOf and allOf filter combinators

    v4.11.0 introduced support for type-guard filters in Composer::on, which allowed you to filter updates based on their content.

    This release adds two new combinators to the filter API: anyOf and allOf. This will play very nicely with custom filters. For example:

    import { anyOf, allOf } from "telegraf/filters";

    // must match all filters
    bot.on(allOf(message(), isGroup), ctx => {
    // ...
    });

    Deprecating hookPath

    The confusingly named hookPath in bot.launch webhook options is now deprecated. It will be removed in the next major release. You can start using path instead, today.


    Meanwhile, we're working on new modules to add to the Telegraf ecosystem. Look forward to them, and join discussions in the official Telegraf chat!

  • 4.14.0 - 2023-09-22
    • ⬆️ Bot API 6.9 support
    • Added missing Markup.keyboard([]).persistent() method
  • 4.13.1 - 2023-09-02
    • Fix README to mention API 6.8
  • 4.13.0 - 2023-09-02
  • 4.12.3-canary.1 - 2023-04-01
  • 4.12.2 - 2023-03-09
  • 4.12.1 - 2023-03-07
  • 4.12.0 - 2023-03-05
  • 4.11.2 - 2022-11-19
  • 4.11.1 - 2022-11-19
  • 4.11.1-canary.2 - 2022-11-19
  • 4.11.1-canary.1 - 2022-11-19
  • 4.11.0 - 2022-11-18
  • 4.11.0-canary.1 - 2022-11-12
  • 4.10.0 - 2022-10-01
  • 4.9.2 - 2022-09-13
  • 4.9.1 - 2022-08-29
  • 4.9.0 - 2022-08-26
  • 4.9.0-canary.12 - 2022-08-24
  • 4.9.0-canary.11 - 2022-08-24
  • 4.9.0-canary.10 - 2022-08-18
  • 4.9.0-canary.9 - 2022-05-18
  • 4.9.0-canary.8 - 2022-05-18
  • 4.9.0-canary.7 - 2022-05-18
  • 4.9.0-canary.6 - 2022-05-15
  • 4.9.0-canary.5 - 2022-05-15
  • 4.9.0-canary.4 - 2022-05-15
  • 4.9.0-canary.3 - 2022-05-15
  • 4.9.0-canary.2 - 2022-05-15
  • 4.9.0-canary.1 - 2022-05-15
  • 4.8.6 - 2022-07-25
  • 4.8.5 - 2022-06-08
  • 4.8.5-canary.1 - 2022-06-08
  • 4.8.4 - 2022-06-07
  • 4.8.3 - 2022-05-29
  • 4.8.2 - 2022-05-13
  • 4.8.1 - 2022-04-29
  • 4.8.0 - 2022-04-29
  • 4.8.0-canary.8 - 2022-04-29
  • 4.8.0-canary.7 - 2022-04-29
  • 4.8.0-canary.6 - 2022-04-29
  • 4.8.0-canary.5 - 2022-04-28
  • 4.8.0-canary.4 - 2022-04-28
  • 4.8.0-canary.3 - 2022-04-28
  • 4.8.0-canary.2 - 2022-04-28
  • 4.8.0-canary.1 - 2022-04-28
  • 4.7.0 - 2022-02-05
  • 4.7.0-canary.1 - 2022-02-04
  • 4.6.0 - 2022-01-15
  • 4.5.2 - 2021-12-08
from telegraf GitHub release notes

Important

  • Check the changes in this PR to ensure they won't cause issues with your project.
  • This PR was automatically created by Snyk using the credentials of a real user.
  • Max score is 1000. Note that the real score may have changed since the PR was raised.

Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.

For more information:

Snyk has created this PR to upgrade:
  - debug from 4.3.3 to 4.3.6.
    See this package in npm: https://www.npmjs.com/package/debug
  - mongoose from 6.0.12 to 6.13.0.
    See this package in npm: https://www.npmjs.com/package/mongoose
  - shutterstock-api from 1.1.12 to 1.1.41.
    See this package in npm: https://www.npmjs.com/package/shutterstock-api
  - telegraf from 4.5.2 to 4.16.3.
    See this package in npm: https://www.npmjs.com/package/telegraf

See this project in Snyk:
https://app.snyk.io/org/pherval/project/58e01004-41a9-4e45-bb0c-b0feb6cf7a0b?utm_source=github&utm_medium=referral&page=upgrade-pr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants