Skip to content

Fix ReDoS in previous-map#1567

Merged
ai merged 1 commit intopostcss:mainfrom
yetingli:main
Apr 26, 2021
Merged

Fix ReDoS in previous-map#1567
ai merged 1 commit intopostcss:mainfrom
yetingli:main

Conversation

@yetingli
Copy link
Contributor

Fix Strategy: Replace (.*) with (?:(?!sourceMappingURL=).)*

Fix Strategy: Replace `(.*)` with `(?:(?!sourceMappingURL=).)*`
@ai ai merged commit 2b1d04c into postcss:main Apr 26, 2021
@ai
Copy link
Member

ai commented Apr 26, 2021

Thanks. Released in 8.2.13.

@AndrewRayCode
Copy link

I'm looking at snyk and I don't understand how this would be exploited. Would you somehow need to construct a malicious source map (?) and inject it (?) into someone's build pipeline that uses postcss?

@ai
Copy link
Member

ai commented May 13, 2021

@AndrewRayCode yeap. It could be used on services like CodePen, when users use servers to compile user’s CSS.

And it is not a real vulnerability. But a way to increase used resources. Even without fixing PostCSS you can add extra timeout check and kill commands which takes too much time.

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