Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: Potential ReDoS Vulnerability or Inefficient Regular Expression in Project: Need for Assessment and Mitigation#7478

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
mmmsssttt404 wants to merge4 commits intovuejs:dev
base:dev
Choose a base branch
Loading
frommmmsssttt404:dev

Conversation

mmmsssttt404
Copy link

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Docs
  • Underlying tools
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

Other information:

I am writing to report a potential Regular Expression Denial of Service (ReDoS) vulnerability or Inefficient Regular Expression in the project. When using specially crafted input strings in the context, it may lead to extremely high CPU usage, application freezing, or denial of service attacks.

https://github.com/mmmsssttt404/vue-cli/blob/d7eb1fdfff4f71f9d7ef7a20a88f42ca582ebfca/packages/%40vue/cli-plugin-pwa/lib/HtmlPwaPlugin.js#L67

Describe the steps to verify that the changes are working as expected.

1.git clonehttps://github.com/mmmsssttt404/vue-cli.git
2.yarn
3.yarn test pwa

changes:

<linkrel="icon"(?!<linkrel="icon")[^>]+>
test('ReDos test',async()=>{HtmlWebpackPlugin.getHooks=()=>({beforeEmit:{tapAsync:(id,handler)=>{consthugeHtml='<link rel="icon"'.repeat(100000)+'\u0000';constdata={html:hugeHtml};handler(data,(err,result)=>{});}},alterAssetTagGroups:{tapAsync:()=>{}}});constplugin=newHtmlPwaPlugin()constfakeCompiler={options:{output:{publicPath:'/'}},hooks:{compilation:{tap:(_id,cb)=>{constfakeCompilation={hooks:{processAssets:{tap:(_opts,fn)=>{}}}}cb(fakeCompilation)}}}}conststartTime=performance.now()plugin.apply(fakeCompiler)constendTime=performance.now()consttimeTaken=endTime-startTimeconsole.log(` time taken:${timeTaken.toFixed(3)} ms`)expect(timeTaken).toBeLessThan(3000)},3000)

before:
屏幕截图 2025-05-06 195804

after:
屏幕截图 2025-05-07 082832

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant
@mmmsssttt404

[8]ページ先頭

©2009-2025 Movatter.jp