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: remove CVE-2023-46809 revert config #683

Merged
merged 3 commits into from
May 17, 2024
Merged

fix: remove CVE-2023-46809 revert config #683

merged 3 commits into from
May 17, 2024

Conversation

fengmk2
Copy link
Member

@fengmk2 fengmk2 commented May 16, 2024

revert #650

run test on Node.js 22

Summary by CodeRabbit

  • New Features

    • Enhanced cryptographic functions with improved encryption and decryption using NodeRSA.
  • Bug Fixes

    • Updated Node.js version compatibility for workflows to ensure smoother CI/CD processes.
  • Chores

    • Removed outdated configuration and dependencies.
    • Updated test cases to align with new cryptographic utilities.
  • Refactor

    • Refactored import statements in tests for consistency and compatibility with ES module syntax.

@fengmk2 fengmk2 added the enhancement New feature or request label May 16, 2024
@fengmk2 fengmk2 requested review from elrrrrrrr and killagu May 16, 2024 05:51
Copy link
Contributor

coderabbitai bot commented May 16, 2024

Warning

Rate Limit Exceeded

@fengmk2 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 20 minutes and 38 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.
Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.
Please see our FAQ for further information.

Commits Files that changed from the base of the PR and between 307792d and 40f1a26.

Walkthrough

The recent updates encompass multiple files, focusing on modernizing the Node.js version matrix, enhancing the encryption and decryption mechanisms using NodeRSA, and refining import statements to leverage ES module syntax. Additionally, a minor configuration change was made in the release workflow, and dependencies were updated in package.json. These changes collectively aim to improve security, maintain compatibility with newer Node.js versions, and streamline cryptographic operations.

Changes

File Change Summary
.github/workflows/nodejs.yml Updated node-version matrix from [16, 18, 20] to [18, 20, 22] in job configurations.
.github/workflows/release.yml Removed checkTest: false configuration.
app/common/CryptoUtil.ts Refactored encryption/decryption functions to use NodeRSA instead of crypto module.
package.json Removed "revert": ["CVE-2023-46809"], added "node-rsa": "^1.1.1" and "@types/node-rsa": "^1.1.4".
test/common/CryptoUtil.test.ts, test/port/webauth/webauthController.test.ts Updated import statements to use ES module syntax and added necessary imports for testing cryptographic functions.

🐇
In the land of code, where changes flow,
Node versions rise, old ones go.
RSA keys now shine so bright,
Encrypting data, day and night.
Dependencies fresh, imports refined,
A safer, swifter app you'll find.
🌟


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 65d6f44 and 9708dc8.
Files selected for processing (3)
  • .github/workflows/nodejs.yml (2 hunks)
  • .github/workflows/release.yml (1 hunks)
  • package.json (1 hunks)
Files skipped from review due to trivial changes (2)
  • .github/workflows/release.yml
  • package.json
Additional comments not posted (2)
.github/workflows/nodejs.yml (2)

35-35: LGTM! The node-version matrix update to include Node.js 22 is appropriate.


86-86: LGTM! The node-version matrix update to include Node.js 22 is appropriate.

Copy link

socket-security bot commented May 16, 2024

@fengmk2
Copy link
Member Author

fengmk2 commented May 16, 2024

image
看起来不简单

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 9708dc8 and 2fee366.
Files selected for processing (5)
  • .github/workflows/nodejs.yml (2 hunks)
  • .github/workflows/release.yml (1 hunks)
  • app/common/CryptoUtil.ts (1 hunks)
  • package.json (1 hunks)
  • test/port/webauth/webauthController.test.ts (1 hunks)
Files not reviewed due to errors (1)
  • app/common/CryptoUtil.ts (no review received)
Files skipped from review due to trivial changes (1)
  • test/port/webauth/webauthController.test.ts
Files skipped from review as they are similar to previous changes (3)
  • .github/workflows/nodejs.yml
  • .github/workflows/release.yml
  • package.json

Copy link

codecov bot commented May 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.84%. Comparing base (a51891d) to head (442dc40).
Report is 1 commits behind head on master.

Current head 442dc40 differs from pull request most recent head 40f1a26

Please upload reports for the commit 40f1a26 to get more accurate results.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #683   +/-   ##
=======================================
  Coverage   96.84%   96.84%           
=======================================
  Files         181      181           
  Lines       17899    17902    +3     
  Branches     2311     2318    +7     
=======================================
+ Hits        17334    17337    +3     
  Misses        565      565           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fengmk2
Copy link
Member Author

fengmk2 commented May 16, 2024

travist/jsencrypt#84

app/common/CryptoUtil.ts Outdated Show resolved Hide resolved
use node-rsa instead of RSA_PKCS1_PADDING

revert #650

run test on Node.js 22
@fengmk2 fengmk2 marked this pull request as ready for review May 17, 2024 14:21
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

Out of diff range and nitpick comments (1)
app/common/CryptoUtil.ts (1)

Line range hint 2-10: Consider increasing the modulus length from 512 to at least 2048 for enhanced security.

- modulusLength: 512,
+ modulusLength: 2048,
Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 2fee366 and 442dc40.
Files selected for processing (6)
  • .github/workflows/nodejs.yml (2 hunks)
  • .github/workflows/release.yml (1 hunks)
  • app/common/CryptoUtil.ts (2 hunks)
  • package.json (3 hunks)
  • test/common/CryptoUtil.test.ts (1 hunks)
  • test/port/webauth/webauthController.test.ts (19 hunks)
Files skipped from review as they are similar to previous changes (4)
  • .github/workflows/nodejs.yml
  • .github/workflows/release.yml
  • package.json
  • test/port/webauth/webauthController.test.ts
Additional comments not posted (1)
test/common/CryptoUtil.test.ts (1)

1-2: The updated import statements using ES module syntax are correctly implemented.

test/common/CryptoUtil.test.ts Outdated Show resolved Hide resolved
test/common/CryptoUtil.test.ts Outdated Show resolved Hide resolved
app/common/CryptoUtil.ts Show resolved Hide resolved
app/common/CryptoUtil.ts Show resolved Hide resolved
fengmk2 and others added 2 commits May 17, 2024 22:26
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@fengmk2 fengmk2 merged commit ff00e42 into master May 17, 2024
9 of 10 checks passed
@fengmk2 fengmk2 deleted the fix-test branch May 17, 2024 14:27
fengmk2 pushed a commit that referenced this pull request May 17, 2024
[skip ci]

## [3.58.1](v3.58.0...v3.58.1) (2024-05-17)

### Bug Fixes

* remove CVE-2023-46809 revert config ([#683](#683)) ([ff00e42](ff00e42))
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 442dc40 and 307792d.
Files selected for processing (1)
  • test/common/CryptoUtil.test.ts (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • test/common/CryptoUtil.test.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant