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

fix: [#4545] Please upgrade zod package - botbuilder-dialogs #385

Closed
wants to merge 9 commits into from

Conversation

JhontSouth
Copy link

@JhontSouth JhontSouth commented Nov 6, 2023

#minor

Description

This PR migrates the use of zod 1.11.17 to ^3.0.0 to avoid ReDoS vulnerability.

Specific Changes

  • Updated zod version to ^3.22.4 in
    • botbuilder-dialogs-adaptive-runtime
    • botbuilder-dialogs-adaptive-runtime-integration-azure-functions
    • botbuilder-dialogs-adaptive-runtime-integration-express
    • botbuilder-dialogs-adaptive-runtime-integration-restify
    • botbuilder-dialogs-adaptive-testing
    • botbuilder-dialogs-declarative
    • botbuilder-dialogs
  • Replaced use of check method with safeParse.

Testing

The following image shows some bot samples working after the update.
image
image

@JhontSouth JhontSouth changed the title [#4545] Please upgrade zod package - botbuilder-dialogs fix: [#4545] Please upgrade zod package - botbuilder-dialogs Nov 6, 2023
Copy link

@sw-joelmut sw-joelmut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found this https://github.com/colinhacks/zod/blob/master/MIGRATION.md to compare the changes, just leaving it here for others.

@@ -33,7 +33,7 @@
"botbuilder-dialogs-adaptive-runtime": "4.1.6",
"botbuilder-dialogs-adaptive-runtime-core": "4.1.6",
"mime": "^2.5.2",
"zod": "~1.11.17"
"zod": "^3.0.0"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the latest ^3.22.4 https://www.npmjs.com/package/zod?activeTab=versions, also in other packages as well.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remember to update it in the description as well

Copy link

@ceciliaavila ceciliaavila left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apply the changes Joel mentioned. The rest, LGTM.

@coveralls
Copy link

coveralls commented Nov 8, 2023

Pull Request Test Coverage Report for Build 6799578840

  • 16 of 21 (76.19%) changed or added relevant lines in 6 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 84.633%

Changes Missing Coverage Covered Lines Changed/Added Lines %
libraries/botbuilder-dialogs-declarative/src/componentDeclarativeTypes.ts 0 1 0.0%
libraries/botbuilder-dialogs/src/prompts/userTokenAccess.ts 11 15 73.33%
Totals Coverage Status
Change from base Build 6799548110: 0.0%
Covered Lines: 20330
Relevant Lines: 22752

💛 - Coveralls

@sw-joelmut
Copy link

/promoted 4563

@sw-joelmut sw-joelmut closed this Nov 8, 2023
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.

4 participants