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: fix breaking change about RSA_PKCS1_PADDING. #650

Merged
merged 1 commit into from
Feb 20, 2024

Conversation

hljwkwm
Copy link
Contributor

@hljwkwm hljwkwm commented Feb 20, 2024

问题:

Node.JS安全性修复导致RSA_PKCS1_PADDING不可用,会报出以下错误:

RSA_PKCS1_PADDING is no longer supported for private decryption, this can be reverted with --security-revert=CVE-2023-46809

该PR用于修复以上问题。

参考链接:https://www.eggjs.org/zh-CN/core/security#revert-cve

Copy link

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/egg-scripts@3.0.0 Transitive: environment, filesystem, network, shell +96 6.74 MB

🚮 Removed packages: npm/egg-scripts@2.17.0

View full report↗︎

@fengmk2 fengmk2 added the bug Something isn't working label Feb 20, 2024
@fengmk2
Copy link
Member

fengmk2 commented Feb 20, 2024

是否可以将 RSA_PKCS1_PADDING 改掉?

Copy link

codecov bot commented Feb 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (26d2ef2) 96.84% compared to head (c055a0c) 96.84%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #650   +/-   ##
=======================================
  Coverage   96.84%   96.84%           
=======================================
  Files         180      180           
  Lines       17598    17598           
  Branches     2292     2292           
=======================================
  Hits        17043    17043           
  Misses        555      555           

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

@hljwkwm
Copy link
Contributor Author

hljwkwm commented Feb 20, 2024

是否可以将 RSA_PKCS1_PADDING 改掉?

这个我不大清楚改掉是否可行,但是通过更新egg-scripts传入revert参数,目前程序是可以正常使用的,可以解决这个报错。

@hljwkwm
Copy link
Contributor Author

hljwkwm commented Feb 20, 2024

另外补充一下,该问题会导致用户无法登录,接口会返回500。

Copy link
Member

@fengmk2 fengmk2 left a comment

Choose a reason for hiding this comment

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

+1

@fengmk2 fengmk2 self-assigned this Feb 20, 2024
@fengmk2 fengmk2 merged commit a6737e6 into cnpm:master Feb 20, 2024
11 of 12 checks passed
fengmk2 pushed a commit that referenced this pull request Feb 20, 2024
[skip ci]

## [3.53.1](v3.53.0...v3.53.1) (2024-02-20)

### Bug Fixes

* fix breaking change about RSA_PKCS1_PADDING ([#650](#650)) ([a6737e6](a6737e6))
@hljwkwm hljwkwm deleted the fix_breaking_security branch February 20, 2024 14:17
@fengmk2
Copy link
Member

fengmk2 commented May 16, 2024

@hljwkwm 我准备将 CVE-2023-46809 删除,这个会引发安全问题,cnpmcore 并没有依赖这个能力。

fengmk2 added a commit that referenced this pull request May 16, 2024
revert #650

run test on Node.js 22
@fengmk2
Copy link
Member

fengmk2 commented May 16, 2024

#683

@hljwkwm
Copy link
Contributor Author

hljwkwm commented May 16, 2024

@hljwkwm 我准备将 CVE-2023-46809 删除,这个会引发安全问题,cnpmcore 并没有依赖这个能力。

Get✅

fengmk2 added a commit that referenced this pull request May 16, 2024
use RSA_PKCS1_OAEP_PADDING instead of RSA_PKCS1_PADDING

revert #650

run test on Node.js 22
fengmk2 added a commit that referenced this pull request May 17, 2024
use node-rsa instead of RSA_PKCS1_PADDING

revert #650

run test on Node.js 22
fengmk2 added a commit that referenced this pull request May 17, 2024
use node-rsa instead of RSA_PKCS1_PADDING

revert #650

run test on Node.js 22
fengmk2 added a commit that referenced this pull request May 17, 2024
revert #650

run test on Node.js 22

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Chores**
  - Updated Node.js version support to 18, 20, and 22.
  - Removed unnecessary configuration from the release workflow.
- Cleaned up outdated security-related entries in the package
configuration.
  - Updated encryption functions in CryptoUtil.ts for improved security.
- Refactored import statements for ES module syntax in
webauthController.test.ts.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants