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

Vulnerability : CVE-2022-37620 #182

Open
borrelm opened this issue Sep 4, 2024 · 4 comments
Open

Vulnerability : CVE-2022-37620 #182

borrelm opened this issue Sep 4, 2024 · 4 comments

Comments

@borrelm
Copy link

borrelm commented Sep 4, 2024

What happened?

Hi,

IMO this fork of https://github.com/kangax/html-minifier is still vulnerable to CVE-2022-37620 as the regex in the candidate variable is still the same.
References :
https://nvd.nist.gov/vuln/detail/CVE-2022-37620
kangax/html-minifier#1135

Version

All

What browsers are you seeing the problem on?

No response

Link to reproduce

No response

Relevant log output

No response

Willing to submit a PR?

None

@DanielRuf
Copy link
Contributor

DanielRuf commented Nov 3, 2024

It seems the CVE record differs from https://security.snyk.io/vuln/SNYK-JS-HTMLMINIFIER-3091181, which contains more details.

Not sure why this is the case. I will clarify with Snyk.

The described PoC does not work with html-minifier-terser:

import { minify } from 'html-minifier-terser';
result = minify(attrName = '\t'.repeat(547703) + '.\t1x', tag = '\t'.repeat(547703) + '.\t1x'  )

image

But with valid code, the PoC works:

import { minify } from 'html-minifier-terser';
const result = minify('\t'.repeat(547703) + '.\t1x')

@DanielRuf
Copy link
Contributor

DanielRuf commented Nov 3, 2024

It seems no one really confirmed the actual issue here. See my addition regarding the candidate variable: kangax/html-minifier#1135 (comment)

Detailed analysis and recommended mitigations: kangax/html-minifier#1135 (comment)

@teknosains
Copy link

Hi @DanielRuf

im using this in Remix

import { minify } from 'html-minifier-terser';

got this error

Cannot find module 'html-minifier-terser'

how do you manage to succfuly using import?

@DanielRuf
Copy link
Contributor

Cannot find module 'html-minifier-terser'

This means the step with npm i html-minifier-terser was forotten.

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

No branches or pull requests

3 participants